Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 2753313002: cros: Init SystemTrayDelegate earlier to break bluetooth init dependency (Closed)
Patch Set: fix test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 UserAddingScreen::Get()->Start(); 117 UserAddingScreen::Get()->Start();
118 } 118 }
119 119
120 bool IsSessionInSecondaryLoginScreen() { 120 bool IsSessionInSecondaryLoginScreen() {
121 return session_manager::SessionManager::Get()->IsInSecondaryLoginScreen(); 121 return session_manager::SessionManager::Get()->IsInSecondaryLoginScreen();
122 } 122 }
123 123
124 } // namespace 124 } // namespace
125 125
126 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() 126 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
127 : bluetooth_helper_(base::MakeUnique<TrayBluetoothHelper>(this)), 127 : bluetooth_helper_(base::MakeUnique<TrayBluetoothHelper>()),
128 networking_config_delegate_( 128 networking_config_delegate_(
129 base::MakeUnique<NetworkingConfigDelegateChromeos>()) { 129 base::MakeUnique<NetworkingConfigDelegateChromeos>()) {
130 // Register notifications on construction so that events such as 130 // Register notifications on construction so that events such as
131 // PROFILE_CREATED do not get missed if they happen before Initialize(). 131 // PROFILE_CREATED do not get missed if they happen before Initialize().
132 registrar_.reset(new content::NotificationRegistrar); 132 registrar_.reset(new content::NotificationRegistrar);
133 if (GetUserLoginStatus() == ash::LoginStatus::NOT_LOGGED_IN) { 133 if (GetUserLoginStatus() == ash::LoginStatus::NOT_LOGGED_IN) {
134 registrar_->Add(this, 134 registrar_->Add(this,
135 chrome::NOTIFICATION_SESSION_STARTED, 135 chrome::NOTIFICATION_SESSION_STARTED,
136 content::NotificationService::AllSources()); 136 content::NotificationService::AllSources());
137 } 137 }
(...skipping 17 matching lines...) Expand all
155 void SystemTrayDelegateChromeOS::Initialize() { 155 void SystemTrayDelegateChromeOS::Initialize() {
156 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); 156 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this);
157 157
158 input_method::InputMethodManager::Get()->AddObserver(this); 158 input_method::InputMethodManager::Get()->AddObserver(this);
159 input_method::InputMethodManager::Get()->AddImeMenuObserver(this); 159 input_method::InputMethodManager::Get()->AddImeMenuObserver(this);
160 ui::ime::InputMethodMenuManager::GetInstance()->AddObserver(this); 160 ui::ime::InputMethodMenuManager::GetInstance()->AddObserver(this);
161 161
162 bluetooth_helper_->Initialize(); 162 bluetooth_helper_->Initialize();
163 163
164 BrowserList::AddObserver(this); 164 BrowserList::AddObserver(this);
165 }
166 165
167 void SystemTrayDelegateChromeOS::InitializeOnAdapterReady() {
168 local_state_registrar_.reset(new PrefChangeRegistrar); 166 local_state_registrar_.reset(new PrefChangeRegistrar);
169 local_state_registrar_->Init(g_browser_process->local_state()); 167 local_state_registrar_->Init(g_browser_process->local_state());
170 168
171 UpdateSessionStartTime(); 169 UpdateSessionStartTime();
172 UpdateSessionLengthLimit(); 170 UpdateSessionLengthLimit();
173 171
174 local_state_registrar_->Add( 172 local_state_registrar_->Add(
175 prefs::kSessionStartTime, 173 prefs::kSessionStartTime,
176 base::Bind(&SystemTrayDelegateChromeOS::UpdateSessionStartTime, 174 base::Bind(&SystemTrayDelegateChromeOS::UpdateSessionStartTime,
177 base::Unretained(this))); 175 base::Unretained(this)));
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 842 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
845 << "ENABLE_SUPERVISED_USERS undefined."; 843 << "ENABLE_SUPERVISED_USERS undefined.";
846 return base::string16(); 844 return base::string16();
847 } 845 }
848 846
849 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 847 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
850 return new SystemTrayDelegateChromeOS(); 848 return new SystemTrayDelegateChromeOS();
851 } 849 }
852 850
853 } // namespace chromeos 851 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | chrome/browser/ui/ash/tray_bluetooth_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698