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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 11887008: Deprecate ShillNetworkClient and add GeolocationHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittest 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
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/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "chrome/common/chrome_version_info.h" 79 #include "chrome/common/chrome_version_info.h"
80 #include "chrome/common/logging_chrome.h" 80 #include "chrome/common/logging_chrome.h"
81 #include "chrome/common/pref_names.h" 81 #include "chrome/common/pref_names.h"
82 #include "chromeos/chromeos_switches.h" 82 #include "chromeos/chromeos_switches.h"
83 #include "chromeos/cryptohome/async_method_caller.h" 83 #include "chromeos/cryptohome/async_method_caller.h"
84 #include "chromeos/dbus/dbus_thread_manager.h" 84 #include "chromeos/dbus/dbus_thread_manager.h"
85 #include "chromeos/dbus/power_manager_client.h" 85 #include "chromeos/dbus/power_manager_client.h"
86 #include "chromeos/dbus/session_manager_client.h" 86 #include "chromeos/dbus/session_manager_client.h"
87 #include "chromeos/disks/disk_mount_manager.h" 87 #include "chromeos/disks/disk_mount_manager.h"
88 #include "chromeos/display/output_configurator.h" 88 #include "chromeos/display/output_configurator.h"
89 #include "chromeos/network/geolocation_handler.h"
89 #include "chromeos/network/network_change_notifier_chromeos.h" 90 #include "chromeos/network/network_change_notifier_chromeos.h"
90 #include "chromeos/network/network_change_notifier_factory_chromeos.h" 91 #include "chromeos/network/network_change_notifier_factory_chromeos.h"
91 #include "chromeos/network/network_configuration_handler.h" 92 #include "chromeos/network/network_configuration_handler.h"
93 #include "chromeos/network/network_device_handler.h"
92 #include "chromeos/network/network_event_log.h" 94 #include "chromeos/network/network_event_log.h"
93 #include "chromeos/network/network_state_handler.h" 95 #include "chromeos/network/network_state_handler.h"
94 #include "chromeos/power/power_state_override.h" 96 #include "chromeos/power/power_state_override.h"
95 #include "content/public/browser/notification_service.h" 97 #include "content/public/browser/notification_service.h"
96 #include "content/public/common/main_function_params.h" 98 #include "content/public/common/main_function_params.h"
97 #include "grit/platform_locale_settings.h" 99 #include "grit/platform_locale_settings.h"
98 #include "net/base/network_change_notifier.h" 100 #include "net/base/network_change_notifier.h"
99 #include "net/url_request/url_request.h" 101 #include "net/url_request/url_request.h"
100 102
101 namespace chromeos { 103 namespace chromeos {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 OwnerKeyUtil::Create()); 281 OwnerKeyUtil::Create());
280 282
281 // Add observers for WallpaperManager. This depends on PowerManagerClient(). 283 // Add observers for WallpaperManager. This depends on PowerManagerClient().
282 WallpaperManager::Get()->AddObservers(); 284 WallpaperManager::Get()->AddObservers();
283 } 285 }
284 286
285 // TODO(stevenjb): Move this into DBusServices() once the switch is no 287 // TODO(stevenjb): Move this into DBusServices() once the switch is no
286 // longer required. (Switch is set in about_flags.cc and not applied until 288 // longer required. (Switch is set in about_flags.cc and not applied until
287 // after DBusServices() is called). 289 // after DBusServices() is called).
288 void InitializeNetworkHandlers() { 290 void InitializeNetworkHandlers() {
291 network_handlers_initialized_ = true;
292
293 // Always initialize these handlers which should not conflict with
294 // NetworkLibrary.
289 chromeos::network_event_log::Initialize(); 295 chromeos::network_event_log::Initialize();
290 if (!CommandLine::ForCurrentProcess()->HasSwitch( 296 chromeos::GeolocationHandler::Initialize();
291 chromeos::switches::kEnableNewNetworkHandlers)) 297
292 return; 298 if (CommandLine::ForCurrentProcess()->HasSwitch(
293 chromeos::NetworkStateHandler::Initialize(); 299 chromeos::switches::kEnableNewNetworkHandlers)) {
294 chromeos::NetworkConfigurationHandler::Initialize(); 300 chromeos::NetworkDeviceHandler::Initialize();
295 network_handlers_initialized_ = true; 301 chromeos::NetworkStateHandler::Initialize();
296 // TODO(gauravsh): This needs re-factoring. NetworkChangeNotifier choice 302 chromeos::NetworkConfigurationHandler::Initialize();
297 // needs to be made before about:flags are processed. 303 // TODO(gauravsh): This needs re-factoring. NetworkChangeNotifier choice
298 if (use_new_network_change_notifier_) 304 // needs to be made before about:flags are processed.
299 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); 305 if (use_new_network_change_notifier_)
306 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize();
307 }
300 } 308 }
301 309
302 ~DBusServices() { 310 ~DBusServices() {
303 // CrosLibrary is shut down before DBusThreadManager even though it 311 // CrosLibrary is shut down before DBusThreadManager even though it
304 // is initialized first becuase some of its libraries depend on DBus 312 // is initialized first becuase some of its libraries depend on DBus
305 // clients. 313 // clients.
306 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. 314 // TODO(hashimoto): Resolve this situation by removing CrosLibrary.
307 // (crosbug.com/26160) 315 // (crosbug.com/26160)
308 if (cros_initialized_ && CrosLibrary::Get()) 316 if (cros_initialized_ && CrosLibrary::Get())
309 CrosLibrary::Shutdown(); 317 CrosLibrary::Shutdown();
310 318
311 chromeos::network_event_log::Shutdown();
312 if (network_handlers_initialized_) { 319 if (network_handlers_initialized_) {
313 chromeos::NetworkStateHandler::Shutdown(); 320 if (CommandLine::ForCurrentProcess()->HasSwitch(
314 chromeos::NetworkConfigurationHandler::Shutdown(); 321 chromeos::switches::kEnableNewNetworkHandlers)) {
322 chromeos::NetworkDeviceHandler::Shutdown();
323 chromeos::NetworkStateHandler::Shutdown();
324 chromeos::NetworkConfigurationHandler::Shutdown();
325 }
326
327 chromeos::GeolocationHandler::Shutdown();
328 chromeos::network_event_log::Shutdown();
315 } 329 }
316 330
317 cryptohome::AsyncMethodCaller::Shutdown(); 331 cryptohome::AsyncMethodCaller::Shutdown();
318 disks::DiskMountManager::Shutdown(); 332 disks::DiskMountManager::Shutdown();
319 input_method::Shutdown(); 333 input_method::Shutdown();
320 CrosDBusService::Shutdown(); 334 CrosDBusService::Shutdown();
321 // NOTE: This must only be called if Initialize() was called. 335 // NOTE: This must only be called if Initialize() was called.
322 DBusThreadManager::Shutdown(); 336 DBusThreadManager::Shutdown();
323 } 337 }
324 338
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 trial->AppendGroup("2GB_RAM_3GB_swap", zram_group == '2' ? 1 : 0); 824 trial->AppendGroup("2GB_RAM_3GB_swap", zram_group == '2' ? 1 : 0);
811 trial->AppendGroup("4GB_RAM_no_swap", zram_group == '3' ? 1 : 0); 825 trial->AppendGroup("4GB_RAM_no_swap", zram_group == '3' ? 1 : 0);
812 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 826 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
813 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 827 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
814 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 828 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
815 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 829 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
816 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 830 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
817 } 831 }
818 832
819 } // namespace chromeos 833 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/mock_network_library.h » ('j') | chromeos/network/geolocation_handler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698