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

Side by Side Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 11819007: Changed DefaultAdapter to RunCallbackOnAdapterReady function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created IsBluetoothSupported in BluetoothEventRouter to fix browser_tests. Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698