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

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

Issue 10899037: Refactoring bluetooth API code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed ASSERT_TRUE checks. Created 8 years, 2 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
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 "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/system/audio/audio_observer.h" 9 #include "ash/system/audio/audio_observer.h"
10 #include "ash/system/bluetooth/bluetooth_observer.h" 10 #include "ash/system/bluetooth/bluetooth_observer.h"
(...skipping 14 matching lines...) Expand all
25 #include "base/bind_helpers.h" 25 #include "base/bind_helpers.h"
26 #include "base/callback.h" 26 #include "base/callback.h"
27 #include "base/chromeos/chromeos_version.h" 27 #include "base/chromeos/chromeos_version.h"
28 #include "base/logging.h" 28 #include "base/logging.h"
29 #include "base/memory/weak_ptr.h" 29 #include "base/memory/weak_ptr.h"
30 #include "base/utf_string_conversions.h" 30 #include "base/utf_string_conversions.h"
31 #include "chrome/browser/browser_process.h" 31 #include "chrome/browser/browser_process.h"
32 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 32 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
33 #include "chrome/browser/chromeos/audio/audio_handler.h" 33 #include "chrome/browser/chromeos/audio/audio_handler.h"
34 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" 34 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
35 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_factory.h"
35 #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" 36 #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h"
36 #include "chrome/browser/chromeos/cros/cros_library.h" 37 #include "chrome/browser/chromeos/cros/cros_library.h"
37 #include "chrome/browser/chromeos/cros/network_library.h" 38 #include "chrome/browser/chromeos/cros/network_library.h"
38 #include "chrome/browser/chromeos/gdata/drive_service_interface.h" 39 #include "chrome/browser/chromeos/gdata/drive_service_interface.h"
39 #include "chrome/browser/chromeos/gdata/drive_system_service.h" 40 #include "chrome/browser/chromeos/gdata/drive_system_service.h"
40 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 41 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
41 #include "chrome/browser/chromeos/input_method/input_method_util.h" 42 #include "chrome/browser/chromeos/input_method/input_method_util.h"
42 #include "chrome/browser/chromeos/input_method/xkeyboard.h" 43 #include "chrome/browser/chromeos/input_method/xkeyboard.h"
43 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 44 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
44 #include "chrome/browser/chromeos/login/base_login_display_host.h" 45 #include "chrome/browser/chromeos/login/base_login_display_host.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 registrar_.Add(this, 210 registrar_.Add(this,
210 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 211 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
211 content::NotificationService::AllSources()); 212 content::NotificationService::AllSources());
212 213
213 accessibility_enabled_.Init(prefs::kSpokenFeedbackEnabled, 214 accessibility_enabled_.Init(prefs::kSpokenFeedbackEnabled,
214 g_browser_process->local_state(), this); 215 g_browser_process->local_state(), this);
215 216
216 network_icon_->SetResourceColorTheme(NetworkMenuIcon::COLOR_LIGHT); 217 network_icon_->SetResourceColorTheme(NetworkMenuIcon::COLOR_LIGHT);
217 network_icon_dark_->SetResourceColorTheme(NetworkMenuIcon::COLOR_DARK); 218 network_icon_dark_->SetResourceColorTheme(NetworkMenuIcon::COLOR_DARK);
218 219
219 bluetooth_adapter_ = BluetoothAdapter::DefaultAdapter(); 220 bluetooth_adapter_ = BluetoothAdapterFactory::DefaultAdapter();
220 bluetooth_adapter_->AddObserver(this); 221 bluetooth_adapter_->AddObserver(this);
221 } 222 }
222 223
223 virtual ~SystemTrayDelegate() { 224 virtual ~SystemTrayDelegate() {
224 AudioHandler* audiohandler = AudioHandler::GetInstance(); 225 AudioHandler* audiohandler = AudioHandler::GetInstance();
225 if (audiohandler) 226 if (audiohandler)
226 audiohandler->RemoveVolumeObserver(this); 227 audiohandler->RemoveVolumeObserver(this);
227 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); 228 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this);
228 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); 229 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
229 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); 230 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary();
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1260 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1260 }; 1261 };
1261 1262
1262 } // namespace 1263 } // namespace
1263 1264
1264 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { 1265 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) {
1265 return new chromeos::SystemTrayDelegate(tray); 1266 return new chromeos::SystemTrayDelegate(tray);
1266 } 1267 }
1267 1268
1268 } // namespace chromeos 1269 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/bluetooth_event_router.cc ('k') | chrome/browser/extensions/api/bluetooth/bluetooth_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698