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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 have_session_start_time_(false), | 191 have_session_start_time_(false), |
191 have_session_length_limit_(false), | 192 have_session_length_limit_(false), |
192 should_run_bluetooth_discovery_(false), | 193 should_run_bluetooth_discovery_(false), |
193 session_started_(false), | 194 session_started_(false), |
194 networking_config_delegate_(new NetworkingConfigDelegateChromeos()), | 195 networking_config_delegate_(new NetworkingConfigDelegateChromeos()), |
195 volume_control_delegate_(new VolumeController()), | 196 volume_control_delegate_(new VolumeController()), |
196 device_settings_observer_(CrosSettings::Get()->AddSettingsObserver( | 197 device_settings_observer_(CrosSettings::Get()->AddSettingsObserver( |
197 kSystemUse24HourClock, | 198 kSystemUse24HourClock, |
198 base::Bind(&SystemTrayDelegateChromeOS::UpdateClockType, | 199 base::Bind(&SystemTrayDelegateChromeOS::UpdateClockType, |
199 base::Unretained(this)))), | 200 base::Unretained(this)))), |
| 201 vpn_delegate_(new VPNDelegateChromeOS), |
200 weak_ptr_factory_(this) { | 202 weak_ptr_factory_(this) { |
201 // Register notifications on construction so that events such as | 203 // Register notifications on construction so that events such as |
202 // PROFILE_CREATED do not get missed if they happen before Initialize(). | 204 // PROFILE_CREATED do not get missed if they happen before Initialize(). |
203 registrar_.reset(new content::NotificationRegistrar); | 205 registrar_.reset(new content::NotificationRegistrar); |
204 registrar_->Add(this, | 206 registrar_->Add(this, |
205 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, | 207 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, |
206 content::NotificationService::AllSources()); | 208 content::NotificationService::AllSources()); |
207 registrar_->Add(this, | 209 registrar_->Add(this, |
208 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 210 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
209 content::NotificationService::AllSources()); | 211 content::NotificationService::AllSources()); |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 void SystemTrayDelegateChromeOS::RemoveShutdownPolicyObserver( | 854 void SystemTrayDelegateChromeOS::RemoveShutdownPolicyObserver( |
853 ash::ShutdownPolicyObserver* observer) { | 855 ash::ShutdownPolicyObserver* observer) { |
854 shutdown_policy_observers_.RemoveObserver(observer); | 856 shutdown_policy_observers_.RemoveObserver(observer); |
855 } | 857 } |
856 | 858 |
857 void SystemTrayDelegateChromeOS::ShouldRebootOnShutdown( | 859 void SystemTrayDelegateChromeOS::ShouldRebootOnShutdown( |
858 const ash::RebootOnShutdownCallback& callback) { | 860 const ash::RebootOnShutdownCallback& callback) { |
859 shutdown_policy_handler_->CheckIfRebootOnShutdown(callback); | 861 shutdown_policy_handler_->CheckIfRebootOnShutdown(callback); |
860 } | 862 } |
861 | 863 |
| 864 ash::VPNDelegate* SystemTrayDelegateChromeOS::GetVPNDelegate() const { |
| 865 return vpn_delegate_.get(); |
| 866 } |
| 867 |
862 void SystemTrayDelegateChromeOS::UserAddedToSession( | 868 void SystemTrayDelegateChromeOS::UserAddedToSession( |
863 const user_manager::User* active_user) { | 869 const user_manager::User* active_user) { |
864 } | 870 } |
865 | 871 |
866 void SystemTrayDelegateChromeOS::ActiveUserChanged( | 872 void SystemTrayDelegateChromeOS::ActiveUserChanged( |
867 const user_manager::User* /* active_user */) { | 873 const user_manager::User* /* active_user */) { |
868 } | 874 } |
869 | 875 |
870 void SystemTrayDelegateChromeOS::UserChangedChildStatus( | 876 void SystemTrayDelegateChromeOS::UserChangedChildStatus( |
871 user_manager::User* user) { | 877 user_manager::User* user) { |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1390 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
1385 << "ENABLE_SUPERVISED_USERS undefined."; | 1391 << "ENABLE_SUPERVISED_USERS undefined."; |
1386 return base::string16(); | 1392 return base::string16(); |
1387 } | 1393 } |
1388 | 1394 |
1389 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1395 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1390 return new SystemTrayDelegateChromeOS(); | 1396 return new SystemTrayDelegateChromeOS(); |
1391 } | 1397 } |
1392 | 1398 |
1393 } // namespace chromeos | 1399 } // namespace chromeos |
OLD | NEW |