11e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 21e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 31e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// found in the LICENSE file. 41e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 51e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/ui/ash/system_tray_delegate_win.h" 61e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 71e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include <string> 81e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 91e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ash/shell.h" 101e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ash/shell_delegate.h" 111e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ash/system/tray/system_tray.h" 121e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ash/system/tray/system_tray_delegate.h" 131e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ash/system/tray/system_tray_notifier.h" 141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ash/volume_control_delegate.h" 151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "base/logging.h" 161e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "base/time/time.h" 171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/chrome_notification_types.h" 181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/lifetime/application_lifetime.h" 191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/profiles/profile_manager.h" 201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/ui/chrome_pages.h" 211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/ui/host_desktop.h" 221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/upgrade_detector.h" 231320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "chrome/grit/locale_settings.h" 241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "content/public/browser/notification_observer.h" 251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "content/public/browser/notification_service.h" 261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "ui/base/l10n/l10n_util.h" 271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)namespace { 291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)class SystemTrayDelegateWin : public ash::SystemTrayDelegate, 311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) public content::NotificationObserver { 321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) public: 331e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) SystemTrayDelegateWin() 341e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) : clock_type_(base::GetHourClockType()) { 351e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // Register notifications on construction so that events such as 361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // PROFILE_CREATED do not get missed if they happen before Initialize(). 371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) registrar_.reset(new content::NotificationRegistrar); 381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) registrar_->Add(this, 391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) chrome::NOTIFICATION_UPGRADE_RECOMMENDED, 401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) content::NotificationService::AllSources()); 411e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 421e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 431e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual ~SystemTrayDelegateWin() { 441e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) registrar_.reset(); 451e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 461e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 471e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // Overridden from ash::SystemTrayDelegate: 481e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void Initialize() OVERRIDE { 491e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) UpdateClockType(); 501e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 511e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 521e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void Shutdown() OVERRIDE { 531e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 541e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 551e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool GetTrayVisibilityOnStartup() OVERRIDE { 561e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return true; 571e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 581e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 591e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual ash::user::LoginStatus GetUserLoginStatus() const OVERRIDE { 601e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return ash::user::LOGGED_IN_OWNER; 611e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 621e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 631e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ChangeProfilePicture() OVERRIDE { 641e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 651e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 661e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual const std::string GetEnterpriseDomain() const OVERRIDE { 671e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return std::string(); 681e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 691e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 70a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) virtual const base::string16 GetEnterpriseMessage() const OVERRIDE { 71a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) return base::string16(); 721e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 731e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 745f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) virtual const std::string GetSupervisedUserManager() const OVERRIDE { 751e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return std::string(); 761e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 771e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 785f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) virtual const base::string16 GetSupervisedUserManagerName() const OVERRIDE { 79a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) return base::string16(); 801e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 811e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 825f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) virtual const base::string16 GetSupervisedUserMessage() const OVERRIDE { 83a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) return base::string16(); 841e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 851e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 861320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci virtual bool IsUserSupervised() const OVERRIDE { 871320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci return false; 881320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci } 891320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 901e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool SystemShouldUpgrade() const OVERRIDE { 911e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return UpgradeDetector::GetInstance()->notify_upgrade(); 921e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 931e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 941e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual base::HourClockType GetHourClockType() const OVERRIDE { 951e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return clock_type_; 961e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 971e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 981e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowSettings() OVERRIDE { 991e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1001e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1011e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool ShouldShowSettings() OVERRIDE { 1021e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return true; 1031e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1041e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1051e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowDateSettings() OVERRIDE { 1061e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1071e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1085c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu virtual void ShowSetTimeDialog() OVERRIDE { 1095c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu } 1105c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu 1111e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowNetworkSettings(const std::string& service_path) OVERRIDE { 1121e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1131e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowBluetoothSettings() OVERRIDE { 1151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1161e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowDisplaySettings() OVERRIDE { 1181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowChromeSlow() OVERRIDE { 1211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool ShouldShowDisplayNotification() OVERRIDE { 1241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return false; 1251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowIMESettings() OVERRIDE { 1281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowHelp() OVERRIDE { 1310f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) chrome::ShowHelpForProfile( 1325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ProfileManager::GetLastUsedProfile(), 1330f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) chrome::HOST_DESKTOP_TYPE_ASH, 1340f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) chrome::HELP_SOURCE_MENU); 1351e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowAccessibilityHelp() OVERRIDE { 1381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowAccessibilitySettings() OVERRIDE { 1411e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1421e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1431e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowPublicAccountInfo() OVERRIDE { 1441e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1451e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1465f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) virtual void ShowSupervisedUserInfo() OVERRIDE { 1471e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1481e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1491e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowEnterpriseInfo() OVERRIDE { 1501e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1511e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1521e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowUserLogin() OVERRIDE { 1531e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1541e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1555d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool ShowSpringChargerReplacementDialog() OVERRIDE { 1565d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 1575d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 1585d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 1595d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool IsSpringChargerReplacementDialogVisible() OVERRIDE { 1605d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 1615d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 1625d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 1635d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual bool HasUserConfirmedSafeSpringCharger() OVERRIDE { 1645d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return false; 1655d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 1665d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 1671e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShutDown() OVERRIDE { 1681e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1691e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1701e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void SignOut() OVERRIDE { 1711e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1721e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1731e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void RequestLockScreen() OVERRIDE { 1741e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1751e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1761e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void RequestRestartForUpdate() OVERRIDE { 1771e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) chrome::AttemptRestart(); 1781e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1791e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1801e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void GetAvailableBluetoothDevices( 1811e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ash::BluetoothDeviceList* list) OVERRIDE { 1821e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1831e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1841e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void BluetoothStartDiscovering() OVERRIDE { 1851e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1861e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1871e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void BluetoothStopDiscovering() OVERRIDE { 1881e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1891e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1901e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ConnectToBluetoothDevice(const std::string& address) OVERRIDE { 1911e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1921e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1931e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool IsBluetoothDiscovering() OVERRIDE { 1941e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return false; 1951e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1961e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 1971e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void GetCurrentIME(ash::IMEInfo* info) OVERRIDE { 1981e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 1991e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2001e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void GetAvailableIMEList(ash::IMEInfoList* list) OVERRIDE { 2011e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2021e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2031e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void GetCurrentIMEProperties( 2041e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ash::IMEPropertyInfoList* list) OVERRIDE { 2051e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2061e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2071e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void SwitchIME(const std::string& ime_id) OVERRIDE { 2081e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2091e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2101e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ActivateIMEProperty(const std::string& key) OVERRIDE { 2111e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2121e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2131320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci virtual void ShowNetworkConfigure(const std::string& network_id) OVERRIDE { 2141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2161320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci virtual bool EnrollNetwork(const std::string& network_id) OVERRIDE { 2171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return true; 2181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ManageBluetoothDevices() OVERRIDE { 2211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ToggleBluetooth() OVERRIDE { 2241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowMobileSimDialog() OVERRIDE { 2271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowMobileSetupDialog(const std::string& service_path) OVERRIDE { 2301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ShowOtherNetworkDialog(const std::string& type) OVERRIDE { 2331e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2341e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2351e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool GetBluetoothAvailable() OVERRIDE { 2361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return false; 2371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool GetBluetoothEnabled() OVERRIDE { 2401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return false; 2411e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2421e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 243e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch virtual bool GetBluetoothDiscovering() OVERRIDE { 244e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch return false; 245e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch } 246e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch 2471e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void ChangeProxySettings() OVERRIDE { 2481e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2491e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2501e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual ash::VolumeControlDelegate* 2511e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) GetVolumeControlDelegate() const OVERRIDE { 2521e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return NULL; 2531e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2541e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2551e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void SetVolumeControlDelegate( 2561e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) scoped_ptr<ash::VolumeControlDelegate> delegate) OVERRIDE { 2571e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2581e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2591e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool GetSessionStartTime( 2601e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::TimeTicks* session_start_time) OVERRIDE { 2611e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return false; 2621e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2631e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2641e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual bool GetSessionLengthLimit( 2651e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::TimeDelta* session_length_limit) OVERRIDE { 2661e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return false; 2671e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2681e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2691e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual int GetSystemTrayMenuWidth() OVERRIDE { 2701e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return l10n_util::GetLocalizedContentsWidthInPixels( 2711e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) IDS_SYSTEM_TRAY_MENU_BUBBLE_WIDTH_PIXELS); 2721e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2731e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2745d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void ActiveUserWasChanged() OVERRIDE { 2755d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 2765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 277a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual bool IsSearchKeyMappedToCapsLock() OVERRIDE { 278a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) return false; 279a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) } 280a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 281a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch virtual ash::tray::UserAccountsDelegate* GetUserAccountsDelegate( 282a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch const std::string& user_id) OVERRIDE { 283a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch return NULL; 284a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch } 285a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch 2861e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) private: 2871e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ash::SystemTrayNotifier* GetSystemTrayNotifier() { 2881e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return ash::Shell::GetInstance()->system_tray_notifier(); 2891e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2901e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2911e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) void UpdateClockType() { 2921e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) clock_type_ = (base::GetHourClockType() == base::k24HourClock) ? 2931e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::k24HourClock : base::k12HourClock; 2941e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) GetSystemTrayNotifier()->NotifyDateFormatChanged(); 2951e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 2961e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 2971e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // content::NotificationObserver implementation. 2981e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual void Observe(int type, 2991e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) const content::NotificationSource& source, 3001e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) const content::NotificationDetails& details) OVERRIDE { 3011e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) if (type == chrome::NOTIFICATION_UPGRADE_RECOMMENDED) { 3021e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) UpgradeDetector* detector = 3031e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) content::Source<UpgradeDetector>(source).ptr(); 3041e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ash::UpdateObserver::UpdateSeverity severity = 3051e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) ash::UpdateObserver::UPDATE_NORMAL; 3061e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) switch (detector->upgrade_notification_stage()) { 30746d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) case UpgradeDetector::UPGRADE_ANNOYANCE_CRITICAL: 3081e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE: 3091e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) severity = ash::UpdateObserver::UPDATE_SEVERE_RED; 3101e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) break; 3111e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH: 3121e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) severity = ash::UpdateObserver::UPDATE_HIGH_ORANGE; 3131e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) break; 3141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED: 3151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) severity = ash::UpdateObserver::UPDATE_LOW_GREEN; 3161e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) break; 3171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) case UpgradeDetector::UPGRADE_ANNOYANCE_LOW: 31846d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles) case UpgradeDetector::UPGRADE_ANNOYANCE_NONE: 3191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) severity = ash::UpdateObserver::UPDATE_NORMAL; 3201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) break; 3211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 3221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) GetSystemTrayNotifier()->NotifyUpdateRecommended(severity); 3231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } else { 3241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) NOTREACHED(); 3251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 3261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) } 3271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 3281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) scoped_ptr<content::NotificationRegistrar> registrar_; 3291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::HourClockType clock_type_; 3301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 3311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateWin); 3321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)}; 3331e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 3341e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)} // namespace 3351e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 3361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 3371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)ash::SystemTrayDelegate* CreateWindowsSystemTrayDelegate() { 3381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) return new SystemTrayDelegateWin(); 3391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)} 340