OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
10 #include "ash/system/brightness/brightness_observer.h" | 10 #include "ash/system/brightness/brightness_observer.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/chromeos/audio/audio_handler.h" | 24 #include "chrome/browser/chromeos/audio/audio_handler.h" |
25 #include "chrome/browser/chromeos/cros/cros_library.h" | 25 #include "chrome/browser/chromeos/cros/cros_library.h" |
26 #include "chrome/browser/chromeos/cros/network_library.h" | 26 #include "chrome/browser/chromeos/cros/network_library.h" |
27 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 27 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
28 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 28 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
30 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 30 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
31 #include "chrome/browser/chromeos/input_method/input_method_whitelist.h" | 31 #include "chrome/browser/chromeos/input_method/input_method_whitelist.h" |
32 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 32 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
33 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h" | |
33 #include "chrome/browser/chromeos/login/base_login_display_host.h" | 34 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
34 #include "chrome/browser/chromeos/login/login_display_host.h" | 35 #include "chrome/browser/chromeos/login/login_display_host.h" |
35 #include "chrome/browser/chromeos/login/user.h" | 36 #include "chrome/browser/chromeos/login/user.h" |
36 #include "chrome/browser/chromeos/login/user_manager.h" | 37 #include "chrome/browser/chromeos/login/user_manager.h" |
37 #include "chrome/browser/chromeos/status/network_menu.h" | 38 #include "chrome/browser/chromeos/status/network_menu.h" |
38 #include "chrome/browser/chromeos/status/network_menu_icon.h" | 39 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
39 #include "chrome/browser/chromeos/system/timezone_settings.h" | 40 #include "chrome/browser/chromeos/system/timezone_settings.h" |
40 #include "chrome/browser/chromeos/system_key_event_listener.h" | 41 #include "chrome/browser/chromeos/system_key_event_listener.h" |
41 #include "chrome/browser/prefs/pref_service.h" | 42 #include "chrome/browser/prefs/pref_service.h" |
42 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 AudioHandler* audiohandler = AudioHandler::GetInstance(); | 129 AudioHandler* audiohandler = AudioHandler::GetInstance(); |
129 if (audiohandler) | 130 if (audiohandler) |
130 audiohandler->RemoveVolumeObserver(this); | 131 audiohandler->RemoveVolumeObserver(this); |
131 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); | 132 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); |
132 input_method::InputMethodManager::GetInstance()->RemoveObserver(this); | 133 input_method::InputMethodManager::GetInstance()->RemoveObserver(this); |
133 system::TimezoneSettings::GetInstance()->RemoveObserver(this); | 134 system::TimezoneSettings::GetInstance()->RemoveObserver(this); |
134 if (SystemKeyEventListener::GetInstance()) | 135 if (SystemKeyEventListener::GetInstance()) |
135 SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this); | 136 SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this); |
136 } | 137 } |
137 | 138 |
139 virtual bool GetTrayVisibilityOnStartup() OVERRIDE { | |
140 return !chromeos::KioskModeHelper::IsKioskModeEnabled(); | |
sadrul
2012/03/22 04:15:36
Does this work correctly if you login (in kiosk mo
varunjain
2012/03/22 04:19:38
Seems to work.
| |
141 } | |
142 | |
138 // Overridden from ash::SystemTrayDelegate: | 143 // Overridden from ash::SystemTrayDelegate: |
139 virtual const std::string GetUserDisplayName() const OVERRIDE { | 144 virtual const std::string GetUserDisplayName() const OVERRIDE { |
140 return UserManager::Get()->GetLoggedInUser().GetDisplayName(); | 145 return UserManager::Get()->GetLoggedInUser().GetDisplayName(); |
141 } | 146 } |
142 | 147 |
143 virtual const std::string GetUserEmail() const OVERRIDE { | 148 virtual const std::string GetUserEmail() const OVERRIDE { |
144 return UserManager::Get()->GetLoggedInUser().email(); | 149 return UserManager::Get()->GetLoggedInUser().email(); |
145 } | 150 } |
146 | 151 |
147 virtual const SkBitmap& GetUserImage() const OVERRIDE { | 152 virtual const SkBitmap& GetUserImage() const OVERRIDE { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 virtual void OnCellularDataPlanChanged(NetworkLibrary* crosnet) OVERRIDE { | 519 virtual void OnCellularDataPlanChanged(NetworkLibrary* crosnet) OVERRIDE { |
515 NotifyRefreshNetwork(); | 520 NotifyRefreshNetwork(); |
516 } | 521 } |
517 | 522 |
518 // content::NotificationObserver implementation. | 523 // content::NotificationObserver implementation. |
519 virtual void Observe(int type, | 524 virtual void Observe(int type, |
520 const content::NotificationSource& source, | 525 const content::NotificationSource& source, |
521 const content::NotificationDetails& details) OVERRIDE { | 526 const content::NotificationDetails& details) OVERRIDE { |
522 switch (type) { | 527 switch (type) { |
523 case chrome::NOTIFICATION_LOGIN_USER_CHANGED: { | 528 case chrome::NOTIFICATION_LOGIN_USER_CHANGED: { |
524 tray_->UpdateAfterLoginStatusChange(GetUserLoginStatus()); | 529 tray_->UpdateAfterLoginStatusChange(GetUserLoginStatus()); |
sadrul
2012/03/22 04:15:36
Update visibility in SystemTray::UpdateAfterLoginS
varunjain
2012/03/22 04:19:38
Done.
| |
530 // If tray is not initially visible, show it now that we have logged in. | |
531 if (!GetTrayVisibilityOnStartup()) | |
532 tray_->SetVisible(true); | |
525 break; | 533 break; |
526 } | 534 } |
527 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { | 535 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { |
528 ash::UpdateObserver* observer = | 536 ash::UpdateObserver* observer = |
529 ash::Shell::GetInstance()->tray()->update_observer(); | 537 ash::Shell::GetInstance()->tray()->update_observer(); |
530 if (observer) | 538 if (observer) |
531 observer->OnUpdateRecommended(); | 539 observer->OnUpdateRecommended(); |
532 break; | 540 break; |
533 } | 541 } |
534 case chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED: { | 542 case chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED: { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
615 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 623 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
616 }; | 624 }; |
617 | 625 |
618 } // namespace | 626 } // namespace |
619 | 627 |
620 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 628 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
621 return new chromeos::SystemTrayDelegate(tray); | 629 return new chromeos::SystemTrayDelegate(tray); |
622 } | 630 } |
623 | 631 |
624 } // namespace chromeos | 632 } // namespace chromeos |
OLD | NEW |