| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" | 66 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" |
| 67 #include "chrome/browser/lifetime/application_lifetime.h" | 67 #include "chrome/browser/lifetime/application_lifetime.h" |
| 68 #include "chrome/browser/profiles/profile_manager.h" | 68 #include "chrome/browser/profiles/profile_manager.h" |
| 69 #include "chrome/browser/supervised_user/supervised_user_service.h" | 69 #include "chrome/browser/supervised_user/supervised_user_service.h" |
| 70 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 70 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 71 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 71 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 72 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" | 72 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" |
| 73 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" | 73 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" |
| 74 #include "chrome/browser/ui/ash/user_accounts_delegate_chromeos.h" | 74 #include "chrome/browser/ui/ash/user_accounts_delegate_chromeos.h" |
| 75 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 75 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
| 76 #include "chrome/browser/ui/ash/vpn_delegate_chromeos.h" |
| 76 #include "chrome/browser/ui/browser.h" | 77 #include "chrome/browser/ui/browser.h" |
| 77 #include "chrome/browser/ui/browser_finder.h" | 78 #include "chrome/browser/ui/browser_finder.h" |
| 78 #include "chrome/browser/ui/browser_list.h" | 79 #include "chrome/browser/ui/browser_list.h" |
| 79 #include "chrome/browser/ui/chrome_pages.h" | 80 #include "chrome/browser/ui/chrome_pages.h" |
| 80 #include "chrome/browser/ui/host_desktop.h" | 81 #include "chrome/browser/ui/host_desktop.h" |
| 81 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 82 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 82 #include "chrome/browser/ui/singleton_tabs.h" | 83 #include "chrome/browser/ui/singleton_tabs.h" |
| 83 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 84 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 84 #include "chrome/browser/upgrade_detector.h" | 85 #include "chrome/browser/upgrade_detector.h" |
| 85 #include "chrome/common/chrome_switches.h" | 86 #include "chrome/common/chrome_switches.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 have_session_start_time_(false), | 198 have_session_start_time_(false), |
| 198 have_session_length_limit_(false), | 199 have_session_length_limit_(false), |
| 199 should_run_bluetooth_discovery_(false), | 200 should_run_bluetooth_discovery_(false), |
| 200 session_started_(false), | 201 session_started_(false), |
| 201 networking_config_delegate_(new NetworkingConfigDelegateChromeos()), | 202 networking_config_delegate_(new NetworkingConfigDelegateChromeos()), |
| 202 volume_control_delegate_(new VolumeController()), | 203 volume_control_delegate_(new VolumeController()), |
| 203 device_settings_observer_(CrosSettings::Get()->AddSettingsObserver( | 204 device_settings_observer_(CrosSettings::Get()->AddSettingsObserver( |
| 204 kSystemUse24HourClock, | 205 kSystemUse24HourClock, |
| 205 base::Bind(&SystemTrayDelegateChromeOS::UpdateClockType, | 206 base::Bind(&SystemTrayDelegateChromeOS::UpdateClockType, |
| 206 base::Unretained(this)))), | 207 base::Unretained(this)))), |
| 208 vpn_delegate_(new VPNDelegateChromeOS), |
| 207 weak_ptr_factory_(this) { | 209 weak_ptr_factory_(this) { |
| 208 // Register notifications on construction so that events such as | 210 // Register notifications on construction so that events such as |
| 209 // PROFILE_CREATED do not get missed if they happen before Initialize(). | 211 // PROFILE_CREATED do not get missed if they happen before Initialize(). |
| 210 registrar_.reset(new content::NotificationRegistrar); | 212 registrar_.reset(new content::NotificationRegistrar); |
| 211 registrar_->Add(this, | 213 registrar_->Add(this, |
| 212 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, | 214 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, |
| 213 content::NotificationService::AllSources()); | 215 content::NotificationService::AllSources()); |
| 214 registrar_->Add(this, | 216 registrar_->Add(this, |
| 215 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 217 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
| 216 content::NotificationService::AllSources()); | 218 content::NotificationService::AllSources()); |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 void SystemTrayDelegateChromeOS::RemoveShutdownPolicyObserver( | 857 void SystemTrayDelegateChromeOS::RemoveShutdownPolicyObserver( |
| 856 ash::ShutdownPolicyObserver* observer) { | 858 ash::ShutdownPolicyObserver* observer) { |
| 857 shutdown_policy_observers_.RemoveObserver(observer); | 859 shutdown_policy_observers_.RemoveObserver(observer); |
| 858 } | 860 } |
| 859 | 861 |
| 860 void SystemTrayDelegateChromeOS::ShouldRebootOnShutdown( | 862 void SystemTrayDelegateChromeOS::ShouldRebootOnShutdown( |
| 861 const ash::RebootOnShutdownCallback& callback) { | 863 const ash::RebootOnShutdownCallback& callback) { |
| 862 shutdown_policy_handler_->CheckIfRebootOnShutdown(callback); | 864 shutdown_policy_handler_->CheckIfRebootOnShutdown(callback); |
| 863 } | 865 } |
| 864 | 866 |
| 867 ash::VPNDelegate* SystemTrayDelegateChromeOS::GetVPNDelegate() const { |
| 868 return vpn_delegate_.get(); |
| 869 } |
| 870 |
| 865 void SystemTrayDelegateChromeOS::UserAddedToSession( | 871 void SystemTrayDelegateChromeOS::UserAddedToSession( |
| 866 const user_manager::User* active_user) { | 872 const user_manager::User* active_user) { |
| 867 } | 873 } |
| 868 | 874 |
| 869 void SystemTrayDelegateChromeOS::ActiveUserChanged( | 875 void SystemTrayDelegateChromeOS::ActiveUserChanged( |
| 870 const user_manager::User* /* active_user */) { | 876 const user_manager::User* /* active_user */) { |
| 871 } | 877 } |
| 872 | 878 |
| 873 void SystemTrayDelegateChromeOS::UserChangedChildStatus( | 879 void SystemTrayDelegateChromeOS::UserChangedChildStatus( |
| 874 user_manager::User* user) { | 880 user_manager::User* user) { |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1393 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1388 << "ENABLE_SUPERVISED_USERS undefined."; | 1394 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1389 return base::string16(); | 1395 return base::string16(); |
| 1390 } | 1396 } |
| 1391 | 1397 |
| 1392 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1398 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1393 return new SystemTrayDelegateChromeOS(); | 1399 return new SystemTrayDelegateChromeOS(); |
| 1394 } | 1400 } |
| 1395 | 1401 |
| 1396 } // namespace chromeos | 1402 } // namespace chromeos |
| OLD | NEW |