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/system/audio/audio_controller.h" | 8 #include "ash/system/audio/audio_controller.h" |
9 #include "ash/system/brightness/brightness_controller.h" | 9 #include "ash/system/brightness/brightness_controller.h" |
10 #include "ash/system/power/power_status_controller.h" | 10 #include "ash/system/power/power_status_controller.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 content::NotificationService::AllSources()); | 42 content::NotificationService::AllSources()); |
43 } | 43 } |
44 | 44 |
45 virtual ~SystemTrayDelegate() { | 45 virtual ~SystemTrayDelegate() { |
46 AudioHandler* audiohandler = AudioHandler::GetInstance(); | 46 AudioHandler* audiohandler = AudioHandler::GetInstance(); |
47 if (audiohandler) | 47 if (audiohandler) |
48 audiohandler->RemoveVolumeObserver(this); | 48 audiohandler->RemoveVolumeObserver(this); |
49 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); | 49 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); |
50 } | 50 } |
51 | 51 |
52 // Overridden from ash::SystemTrayDelegate. | 52 // Overridden from ash::SystemTrayDelegate: |
53 virtual const std::string GetUserDisplayName() OVERRIDE { | 53 virtual const std::string GetUserDisplayName() const OVERRIDE { |
54 return UserManager::Get()->logged_in_user().GetDisplayName(); | 54 return UserManager::Get()->logged_in_user().GetDisplayName(); |
55 } | 55 } |
56 | 56 |
57 virtual const std::string GetUserEmail() OVERRIDE { | 57 virtual const std::string GetUserEmail() const OVERRIDE { |
58 return UserManager::Get()->logged_in_user().email(); | 58 return UserManager::Get()->logged_in_user().email(); |
59 } | 59 } |
60 | 60 |
61 virtual const SkBitmap& GetUserImage() OVERRIDE { | 61 virtual const SkBitmap& GetUserImage() const OVERRIDE { |
62 return UserManager::Get()->logged_in_user().image(); | 62 return UserManager::Get()->logged_in_user().image(); |
63 } | 63 } |
64 | 64 |
65 virtual ash::user::LoginStatus GetUserLoginStatus() OVERRIDE { | 65 virtual ash::user::LoginStatus GetUserLoginStatus() const OVERRIDE { |
66 UserManager* manager = UserManager::Get(); | 66 UserManager* manager = UserManager::Get(); |
67 if (!manager->user_is_logged_in()) | 67 if (!manager->user_is_logged_in()) |
68 return ash::user::LOGGED_IN_NONE; | 68 return ash::user::LOGGED_IN_NONE; |
69 if (manager->current_user_is_owner()) | 69 if (manager->current_user_is_owner()) |
70 return ash::user::LOGGED_IN_OWNER; | 70 return ash::user::LOGGED_IN_OWNER; |
71 if (manager->IsLoggedInAsGuest()) | 71 if (manager->IsLoggedInAsGuest()) |
72 return ash::user::LOGGED_IN_GUEST; | 72 return ash::user::LOGGED_IN_GUEST; |
73 return ash::user::LOGGED_IN_USER; | 73 return ash::user::LOGGED_IN_USER; |
74 } | 74 } |
75 | 75 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 152 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
153 }; | 153 }; |
154 | 154 |
155 } // namespace | 155 } // namespace |
156 | 156 |
157 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 157 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
158 return new chromeos::SystemTrayDelegate(tray); | 158 return new chromeos::SystemTrayDelegate(tray); |
159 } | 159 } |
160 | 160 |
161 } // namespace chromeos | 161 } // namespace chromeos |
OLD | NEW |