| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" | 55 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
| 56 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 56 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 57 #include "chrome/browser/profiles/profile_manager.h" | 57 #include "chrome/browser/profiles/profile_manager.h" |
| 58 #include "chrome/browser/supervised_user/supervised_user_service.h" | 58 #include "chrome/browser/supervised_user/supervised_user_service.h" |
| 59 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 59 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 60 #include "chrome/browser/ui/ash/cast_config_delegate_media_router.h" | 60 #include "chrome/browser/ui/ash/cast_config_delegate_media_router.h" |
| 61 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 61 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 62 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" | 62 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" |
| 63 #include "chrome/browser/ui/ash/system_tray_client.h" | 63 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 64 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" | 64 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" |
| 65 #include "chrome/browser/ui/ash/vpn_delegate_chromeos.h" | |
| 66 #include "chrome/browser/ui/browser.h" | 65 #include "chrome/browser/ui/browser.h" |
| 67 #include "chrome/browser/ui/browser_list.h" | 66 #include "chrome/browser/ui/browser_list.h" |
| 68 #include "chrome/browser/ui/chrome_pages.h" | 67 #include "chrome/browser/ui/chrome_pages.h" |
| 69 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 68 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 70 #include "chrome/browser/ui/singleton_tabs.h" | 69 #include "chrome/browser/ui/singleton_tabs.h" |
| 71 #include "chrome/browser/upgrade_detector.h" | 70 #include "chrome/browser/upgrade_detector.h" |
| 72 #include "chrome/common/chrome_switches.h" | 71 #include "chrome/common/chrome_switches.h" |
| 73 #include "chrome/common/features.h" | 72 #include "chrome/common/features.h" |
| 74 #include "chrome/common/pref_names.h" | 73 #include "chrome/common/pref_names.h" |
| 75 #include "chrome/common/url_constants.h" | 74 #include "chrome/common/url_constants.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 return ash::WmShell::Get() | 140 return ash::WmShell::Get() |
| 142 ->GetSessionStateDelegate() | 141 ->GetSessionStateDelegate() |
| 143 ->IsInSecondaryLoginScreen(); | 142 ->IsInSecondaryLoginScreen(); |
| 144 } | 143 } |
| 145 | 144 |
| 146 } // namespace | 145 } // namespace |
| 147 | 146 |
| 148 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() | 147 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() |
| 149 : cast_config_delegate_(base::MakeUnique<CastConfigDelegateMediaRouter>()), | 148 : cast_config_delegate_(base::MakeUnique<CastConfigDelegateMediaRouter>()), |
| 150 networking_config_delegate_(new NetworkingConfigDelegateChromeos()), | 149 networking_config_delegate_(new NetworkingConfigDelegateChromeos()), |
| 151 vpn_delegate_(new VPNDelegateChromeOS), | |
| 152 weak_ptr_factory_(this) { | 150 weak_ptr_factory_(this) { |
| 153 // Register notifications on construction so that events such as | 151 // Register notifications on construction so that events such as |
| 154 // PROFILE_CREATED do not get missed if they happen before Initialize(). | 152 // PROFILE_CREATED do not get missed if they happen before Initialize(). |
| 155 registrar_.reset(new content::NotificationRegistrar); | 153 registrar_.reset(new content::NotificationRegistrar); |
| 156 registrar_->Add(this, | 154 registrar_->Add(this, |
| 157 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, | 155 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, |
| 158 content::NotificationService::AllSources()); | 156 content::NotificationService::AllSources()); |
| 159 registrar_->Add(this, | 157 registrar_->Add(this, |
| 160 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 158 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
| 161 content::NotificationService::AllSources()); | 159 content::NotificationService::AllSources()); |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 void SystemTrayDelegateChromeOS::AddCustodianInfoTrayObserver( | 584 void SystemTrayDelegateChromeOS::AddCustodianInfoTrayObserver( |
| 587 ash::CustodianInfoTrayObserver* observer) { | 585 ash::CustodianInfoTrayObserver* observer) { |
| 588 custodian_info_changed_observers_.AddObserver(observer); | 586 custodian_info_changed_observers_.AddObserver(observer); |
| 589 } | 587 } |
| 590 | 588 |
| 591 void SystemTrayDelegateChromeOS::RemoveCustodianInfoTrayObserver( | 589 void SystemTrayDelegateChromeOS::RemoveCustodianInfoTrayObserver( |
| 592 ash::CustodianInfoTrayObserver* observer) { | 590 ash::CustodianInfoTrayObserver* observer) { |
| 593 custodian_info_changed_observers_.RemoveObserver(observer); | 591 custodian_info_changed_observers_.RemoveObserver(observer); |
| 594 } | 592 } |
| 595 | 593 |
| 596 ash::VPNDelegate* SystemTrayDelegateChromeOS::GetVPNDelegate() const { | |
| 597 return vpn_delegate_.get(); | |
| 598 } | |
| 599 | |
| 600 std::unique_ptr<ash::SystemTrayItem> | 594 std::unique_ptr<ash::SystemTrayItem> |
| 601 SystemTrayDelegateChromeOS::CreateRotationLockTrayItem(ash::SystemTray* tray) { | 595 SystemTrayDelegateChromeOS::CreateRotationLockTrayItem(ash::SystemTray* tray) { |
| 602 return base::MakeUnique<ash::TrayRotationLock>(tray); | 596 return base::MakeUnique<ash::TrayRotationLock>(tray); |
| 603 } | 597 } |
| 604 | 598 |
| 605 void SystemTrayDelegateChromeOS::UserAddedToSession( | 599 void SystemTrayDelegateChromeOS::UserAddedToSession( |
| 606 const user_manager::User* active_user) { | 600 const user_manager::User* active_user) { |
| 607 } | 601 } |
| 608 | 602 |
| 609 void SystemTrayDelegateChromeOS::ActiveUserChanged( | 603 void SystemTrayDelegateChromeOS::ActiveUserChanged( |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1003 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1010 << "ENABLE_SUPERVISED_USERS undefined."; | 1004 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1011 return base::string16(); | 1005 return base::string16(); |
| 1012 } | 1006 } |
| 1013 | 1007 |
| 1014 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1008 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1015 return new SystemTrayDelegateChromeOS(); | 1009 return new SystemTrayDelegateChromeOS(); |
| 1016 } | 1010 } |
| 1017 | 1011 |
| 1018 } // namespace chromeos | 1012 } // namespace chromeos |
| OLD | NEW |