OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 input_method::GetInputMethodManager()->AddObserver(this); | 263 input_method::GetInputMethodManager()->AddObserver(this); |
264 | 264 |
265 system::TimezoneSettings::GetInstance()->AddObserver(this); | 265 system::TimezoneSettings::GetInstance()->AddObserver(this); |
266 | 266 |
267 if (SystemKeyEventListener::GetInstance()) | 267 if (SystemKeyEventListener::GetInstance()) |
268 SystemKeyEventListener::GetInstance()->AddCapsLockObserver(this); | 268 SystemKeyEventListener::GetInstance()->AddCapsLockObserver(this); |
269 | 269 |
270 network_icon_->SetResourceColorTheme(NetworkMenuIcon::COLOR_LIGHT); | 270 network_icon_->SetResourceColorTheme(NetworkMenuIcon::COLOR_LIGHT); |
271 network_icon_dark_->SetResourceColorTheme(NetworkMenuIcon::COLOR_DARK); | 271 network_icon_dark_->SetResourceColorTheme(NetworkMenuIcon::COLOR_DARK); |
272 | 272 |
273 bluetooth_adapter_ = device::BluetoothAdapterFactory::DefaultAdapter(); | 273 device::BluetoothAdapterFactory::RunCallbackOnAdapterReady( |
| 274 base::Bind(&SystemTrayDelegate::InitializeOnAdapterReady, |
| 275 ui_weak_ptr_factory_->GetWeakPtr())); |
| 276 } |
| 277 |
| 278 void InitializeOnAdapterReady( |
| 279 scoped_refptr<device::BluetoothAdapter> adapter) { |
| 280 bluetooth_adapter_ = adapter; |
| 281 CHECK(bluetooth_adapter_); |
274 bluetooth_adapter_->AddObserver(this); | 282 bluetooth_adapter_->AddObserver(this); |
275 | 283 |
276 local_state_registrar_.Init(g_browser_process->local_state()); | 284 local_state_registrar_.Init(g_browser_process->local_state()); |
277 | 285 |
278 UpdateSessionStartTime(); | 286 UpdateSessionStartTime(); |
279 UpdateSessionLengthLimit(); | 287 UpdateSessionLengthLimit(); |
280 | 288 |
281 local_state_registrar_.Add( | 289 local_state_registrar_.Add( |
282 prefs::kSessionStartTime, | 290 prefs::kSessionStartTime, |
283 base::Bind(&SystemTrayDelegate::UpdateSessionStartTime, | 291 base::Bind(&SystemTrayDelegate::UpdateSessionStartTime, |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1412 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
1405 }; | 1413 }; |
1406 | 1414 |
1407 } // namespace | 1415 } // namespace |
1408 | 1416 |
1409 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1417 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1410 return new chromeos::SystemTrayDelegate(); | 1418 return new chromeos::SystemTrayDelegate(); |
1411 } | 1419 } |
1412 | 1420 |
1413 } // namespace chromeos | 1421 } // namespace chromeos |
OLD | NEW |