Chromium Code Reviews| 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_); | |
|
Nikita (slow)
2013/01/10 10:29:55
You're passing adapter as a weak pointer so NULL c
youngki
2013/01/10 18:58:54
Yes, a weak pointer passed from BluetoothAdapterFa
Nikita (slow)
2013/01/11 11:15:09
So do you actually need a CHECK here or would it b
youngki
2013/01/11 13:18:47
I think we need a check here since bluetooth_adapt
Nikita (slow)
2013/01/11 15:34:21
I don't want to block this CL but it seems a bit s
youngki
2013/01/11 16:47:56
That's a valid concern; I appreciate you point it
| |
| 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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1399 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1407 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1400 }; | 1408 }; |
| 1401 | 1409 |
| 1402 } // namespace | 1410 } // namespace |
| 1403 | 1411 |
| 1404 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1412 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1405 return new chromeos::SystemTrayDelegate(); | 1413 return new chromeos::SystemTrayDelegate(); |
| 1406 } | 1414 } |
| 1407 | 1415 |
| 1408 } // namespace chromeos | 1416 } // namespace chromeos |
| OLD | NEW |