| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 base::TimeDelta* session_length_limit) OVERRIDE { | 896 base::TimeDelta* session_length_limit) OVERRIDE { |
| 897 *session_length_limit = session_length_limit_; | 897 *session_length_limit = session_length_limit_; |
| 898 return have_session_length_limit_; | 898 return have_session_length_limit_; |
| 899 } | 899 } |
| 900 | 900 |
| 901 virtual int GetSystemTrayMenuWidth() OVERRIDE { | 901 virtual int GetSystemTrayMenuWidth() OVERRIDE { |
| 902 return l10n_util::GetLocalizedContentsWidthInPixels( | 902 return l10n_util::GetLocalizedContentsWidthInPixels( |
| 903 IDS_SYSTEM_TRAY_MENU_BUBBLE_WIDTH_PIXELS); | 903 IDS_SYSTEM_TRAY_MENU_BUBBLE_WIDTH_PIXELS); |
| 904 } | 904 } |
| 905 | 905 |
| 906 virtual void ActiveUserChanged() OVERRIDE { |
| 907 GetSystemTrayNotifier()->NotifyUserUpdate(); |
| 908 } |
| 909 |
| 906 private: | 910 private: |
| 907 ash::SystemTray* GetPrimarySystemTray() { | 911 ash::SystemTray* GetPrimarySystemTray() { |
| 908 return ash::Shell::GetInstance()->GetPrimarySystemTray(); | 912 return ash::Shell::GetInstance()->GetPrimarySystemTray(); |
| 909 } | 913 } |
| 910 | 914 |
| 911 ash::SystemTrayNotifier* GetSystemTrayNotifier() { | 915 ash::SystemTrayNotifier* GetSystemTrayNotifier() { |
| 912 return ash::Shell::GetInstance()->system_tray_notifier(); | 916 return ash::Shell::GetInstance()->system_tray_notifier(); |
| 913 } | 917 } |
| 914 | 918 |
| 915 void SetProfile(Profile* profile) { | 919 void SetProfile(Profile* profile) { |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 // Overridden from CloudPolicyStore::Observer | 1296 // Overridden from CloudPolicyStore::Observer |
| 1293 virtual void OnStoreLoaded(policy::CloudPolicyStore* store) OVERRIDE { | 1297 virtual void OnStoreLoaded(policy::CloudPolicyStore* store) OVERRIDE { |
| 1294 UpdateEnterpriseDomain(); | 1298 UpdateEnterpriseDomain(); |
| 1295 } | 1299 } |
| 1296 | 1300 |
| 1297 virtual void OnStoreError(policy::CloudPolicyStore* store) OVERRIDE { | 1301 virtual void OnStoreError(policy::CloudPolicyStore* store) OVERRIDE { |
| 1298 UpdateEnterpriseDomain(); | 1302 UpdateEnterpriseDomain(); |
| 1299 } | 1303 } |
| 1300 | 1304 |
| 1301 // Overridden from ash::SessionStateObserver | 1305 // Overridden from ash::SessionStateObserver |
| 1302 virtual void ActiveUserChanged(const std::string& user_id) OVERRIDE { | |
| 1303 GetSystemTrayNotifier()->NotifyUserUpdate(); | |
| 1304 } | |
| 1305 | |
| 1306 virtual void UserAddedToSession(const std::string& user_id) OVERRIDE { | 1306 virtual void UserAddedToSession(const std::string& user_id) OVERRIDE { |
| 1307 GetSystemTrayNotifier()->NotifyUserAddedToSession(); | 1307 GetSystemTrayNotifier()->NotifyUserAddedToSession(); |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 scoped_ptr<base::WeakPtrFactory<SystemTrayDelegate> > ui_weak_ptr_factory_; | 1310 scoped_ptr<base::WeakPtrFactory<SystemTrayDelegate> > ui_weak_ptr_factory_; |
| 1311 scoped_ptr<content::NotificationRegistrar> registrar_; | 1311 scoped_ptr<content::NotificationRegistrar> registrar_; |
| 1312 scoped_ptr<PrefChangeRegistrar> local_state_registrar_; | 1312 scoped_ptr<PrefChangeRegistrar> local_state_registrar_; |
| 1313 scoped_ptr<PrefChangeRegistrar> user_pref_registrar_; | 1313 scoped_ptr<PrefChangeRegistrar> user_pref_registrar_; |
| 1314 Profile* user_profile_; | 1314 Profile* user_profile_; |
| 1315 base::HourClockType clock_type_; | 1315 base::HourClockType clock_type_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1327 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1327 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1328 }; | 1328 }; |
| 1329 | 1329 |
| 1330 } // namespace | 1330 } // namespace |
| 1331 | 1331 |
| 1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1333 return new chromeos::SystemTrayDelegate(); | 1333 return new chromeos::SystemTrayDelegate(); |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 } // namespace chromeos | 1336 } // namespace chromeos |
| OLD | NEW |