| 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 <memory> |
| 10 #include <set> | 11 #include <set> |
| 11 #include <string> | 12 #include <string> |
| 12 #include <utility> | 13 #include <utility> |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "ash/common/login_status.h" | 16 #include "ash/common/login_status.h" |
| 16 #include "ash/common/session/session_state_delegate.h" | 17 #include "ash/common/session/session_state_delegate.h" |
| 17 #include "ash/common/session/session_state_observer.h" | 18 #include "ash/common/session/session_state_observer.h" |
| 18 #include "ash/common/shell_delegate.h" | 19 #include "ash/common/shell_delegate.h" |
| 19 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" | 20 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 47 #include "chrome/browser/chromeos/login/login_wizard.h" | 48 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 48 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 49 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 49 #include "chrome/browser/chromeos/login/user_flow.h" | 50 #include "chrome/browser/chromeos/login/user_flow.h" |
| 50 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 51 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 51 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 52 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
| 52 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 53 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 53 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 54 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| 54 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" | 55 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
| 55 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 56 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 56 #include "chrome/browser/profiles/profile_manager.h" | 57 #include "chrome/browser/profiles/profile_manager.h" |
| 57 #include "chrome/browser/ui/ash/cast_config_delegate_media_router.h" | |
| 58 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 58 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 59 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" | 59 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" |
| 60 #include "chrome/browser/ui/ash/system_tray_client.h" | 60 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 61 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" | 61 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" |
| 62 #include "chrome/browser/ui/browser.h" | 62 #include "chrome/browser/ui/browser.h" |
| 63 #include "chrome/browser/ui/browser_list.h" | 63 #include "chrome/browser/ui/browser_list.h" |
| 64 #include "chrome/browser/ui/chrome_pages.h" | 64 #include "chrome/browser/ui/chrome_pages.h" |
| 65 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 65 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 66 #include "chrome/browser/ui/singleton_tabs.h" | 66 #include "chrome/browser/ui/singleton_tabs.h" |
| 67 #include "chrome/browser/upgrade_detector.h" | 67 #include "chrome/browser/upgrade_detector.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 bool IsSessionInSecondaryLoginScreen() { | 136 bool IsSessionInSecondaryLoginScreen() { |
| 137 return ash::WmShell::Get() | 137 return ash::WmShell::Get() |
| 138 ->GetSessionStateDelegate() | 138 ->GetSessionStateDelegate() |
| 139 ->IsInSecondaryLoginScreen(); | 139 ->IsInSecondaryLoginScreen(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace | 142 } // namespace |
| 143 | 143 |
| 144 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() | 144 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() |
| 145 : cast_config_delegate_(base::MakeUnique<CastConfigDelegateMediaRouter>()), | 145 : networking_config_delegate_(new NetworkingConfigDelegateChromeos()), |
| 146 networking_config_delegate_(new NetworkingConfigDelegateChromeos()), | |
| 147 weak_ptr_factory_(this) { | 146 weak_ptr_factory_(this) { |
| 148 // Register notifications on construction so that events such as | 147 // Register notifications on construction so that events such as |
| 149 // PROFILE_CREATED do not get missed if they happen before Initialize(). | 148 // PROFILE_CREATED do not get missed if they happen before Initialize(). |
| 150 registrar_.reset(new content::NotificationRegistrar); | 149 registrar_.reset(new content::NotificationRegistrar); |
| 151 registrar_->Add(this, | 150 registrar_->Add(this, |
| 152 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, | 151 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, |
| 153 content::NotificationService::AllSources()); | 152 content::NotificationService::AllSources()); |
| 154 registrar_->Add(this, | 153 registrar_->Add(this, |
| 155 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 154 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
| 156 content::NotificationService::AllSources()); | 155 content::NotificationService::AllSources()); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 535 |
| 537 bool SystemTrayDelegateChromeOS::GetBluetoothEnabled() { | 536 bool SystemTrayDelegateChromeOS::GetBluetoothEnabled() { |
| 538 return bluetooth_adapter_ && bluetooth_adapter_->IsPowered(); | 537 return bluetooth_adapter_ && bluetooth_adapter_->IsPowered(); |
| 539 } | 538 } |
| 540 | 539 |
| 541 bool SystemTrayDelegateChromeOS::GetBluetoothDiscovering() { | 540 bool SystemTrayDelegateChromeOS::GetBluetoothDiscovering() { |
| 542 return bluetooth_discovery_session_ && | 541 return bluetooth_discovery_session_ && |
| 543 bluetooth_discovery_session_->IsActive(); | 542 bluetooth_discovery_session_->IsActive(); |
| 544 } | 543 } |
| 545 | 544 |
| 546 ash::CastConfigDelegate* SystemTrayDelegateChromeOS::GetCastConfigDelegate() { | |
| 547 return cast_config_delegate_.get(); | |
| 548 } | |
| 549 | |
| 550 ash::NetworkingConfigDelegate* | 545 ash::NetworkingConfigDelegate* |
| 551 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { | 546 SystemTrayDelegateChromeOS::GetNetworkingConfigDelegate() const { |
| 552 return networking_config_delegate_.get(); | 547 return networking_config_delegate_.get(); |
| 553 } | 548 } |
| 554 | 549 |
| 555 bool SystemTrayDelegateChromeOS::GetSessionStartTime( | 550 bool SystemTrayDelegateChromeOS::GetSessionStartTime( |
| 556 base::TimeTicks* session_start_time) { | 551 base::TimeTicks* session_start_time) { |
| 557 *session_start_time = session_start_time_; | 552 *session_start_time = session_start_time_; |
| 558 return have_session_start_time_; | 553 return have_session_start_time_; |
| 559 } | 554 } |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 995 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1001 << "ENABLE_SUPERVISED_USERS undefined."; | 996 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1002 return base::string16(); | 997 return base::string16(); |
| 1003 } | 998 } |
| 1004 | 999 |
| 1005 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1000 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1006 return new SystemTrayDelegateChromeOS(); | 1001 return new SystemTrayDelegateChromeOS(); |
| 1007 } | 1002 } |
| 1008 | 1003 |
| 1009 } // namespace chromeos | 1004 } // namespace chromeos |
| OLD | NEW |