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

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

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Add NetworkConnectionHandler to NetworkHandler Created 7 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 #include "chromeos/chromeos_switches.h" 99 #include "chromeos/chromeos_switches.h"
100 #include "chromeos/cryptohome/async_method_caller.h" 100 #include "chromeos/cryptohome/async_method_caller.h"
101 #include "chromeos/cryptohome/cryptohome_library.h" 101 #include "chromeos/cryptohome/cryptohome_library.h"
102 #include "chromeos/dbus/dbus_thread_manager.h" 102 #include "chromeos/dbus/dbus_thread_manager.h"
103 #include "chromeos/dbus/power_manager_client.h" 103 #include "chromeos/dbus/power_manager_client.h"
104 #include "chromeos/dbus/session_manager_client.h" 104 #include "chromeos/dbus/session_manager_client.h"
105 #include "chromeos/disks/disk_mount_manager.h" 105 #include "chromeos/disks/disk_mount_manager.h"
106 #include "chromeos/ime/input_method_manager.h" 106 #include "chromeos/ime/input_method_manager.h"
107 #include "chromeos/ime/xkeyboard.h" 107 #include "chromeos/ime/xkeyboard.h"
108 #include "chromeos/login/login_state.h" 108 #include "chromeos/login/login_state.h"
109 #include "chromeos/network/cert_loader.h"
110 #include "chromeos/network/geolocation_handler.h"
111 #include "chromeos/network/managed_network_configuration_handler.h"
112 #include "chromeos/network/network_change_notifier_chromeos.h" 109 #include "chromeos/network/network_change_notifier_chromeos.h"
113 #include "chromeos/network/network_change_notifier_factory_chromeos.h" 110 #include "chromeos/network/network_change_notifier_factory_chromeos.h"
114 #include "chromeos/network/network_configuration_handler.h" 111 #include "chromeos/network/network_handler.h"
115 #include "chromeos/network/network_connection_handler.h"
116 #include "chromeos/network/network_event_log.h"
117 #include "chromeos/network/network_profile_handler.h"
118 #include "chromeos/network/network_state_handler.h"
119 #include "content/public/browser/browser_thread.h" 112 #include "content/public/browser/browser_thread.h"
120 #include "content/public/browser/notification_service.h" 113 #include "content/public/browser/notification_service.h"
121 #include "content/public/browser/power_save_blocker.h" 114 #include "content/public/browser/power_save_blocker.h"
122 #include "content/public/common/main_function_params.h" 115 #include "content/public/common/main_function_params.h"
123 #include "grit/platform_locale_settings.h" 116 #include "grit/platform_locale_settings.h"
124 #include "net/base/network_change_notifier.h" 117 #include "net/base/network_change_notifier.h"
125 #include "net/url_request/url_request.h" 118 #include "net/url_request/url_request.h"
126 #include "net/url_request/url_request_context_getter.h" 119 #include "net/url_request/url_request_context_getter.h"
127 120
128 namespace chromeos { 121 namespace chromeos {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 user_data_dir.AppendASCII("stub_user_policy")); 299 user_data_dir.AppendASCII("stub_user_policy"));
307 } 300 }
308 } 301 }
309 302
310 // Initialize DBusThreadManager for the browser. This must be done after 303 // Initialize DBusThreadManager for the browser. This must be done after
311 // the main message loop is started, as it uses the message loop. 304 // the main message loop is started, as it uses the message loop.
312 DBusThreadManager::Initialize(); 305 DBusThreadManager::Initialize();
313 CrosDBusService::Initialize(); 306 CrosDBusService::Initialize();
314 307
315 LoginState::Initialize(); 308 LoginState::Initialize();
316 CertLoader::Initialize();
317 CertLibrary::Initialize();
318 CryptohomeLibrary::Initialize(); 309 CryptohomeLibrary::Initialize();
319 310
320 // This function and SystemKeyEventListener use InputMethodManager. 311 // This function and SystemKeyEventListener use InputMethodManager.
321 chromeos::input_method::Initialize( 312 chromeos::input_method::Initialize(
322 content::BrowserThread::GetMessageLoopProxyForThread( 313 content::BrowserThread::GetMessageLoopProxyForThread(
323 content::BrowserThread::UI), 314 content::BrowserThread::UI),
324 content::BrowserThread::GetMessageLoopProxyForThread( 315 content::BrowserThread::GetMessageLoopProxyForThread(
325 content::BrowserThread::FILE)); 316 content::BrowserThread::FILE));
326 disks::DiskMountManager::Initialize(); 317 disks::DiskMountManager::Initialize();
327 cryptohome::AsyncMethodCaller::Initialize(); 318 cryptohome::AsyncMethodCaller::Initialize();
328 319
329 // Always initialize these handlers which should not conflict with 320 // Always initialize these handlers which should not conflict with
330 // NetworkLibrary. 321 // NetworkLibrary.
331 network_event_log::Initialize(); 322 NetworkHandler::Initialize();
332 GeolocationHandler::Initialize(); 323 CertLibrary::Initialize();
333 NetworkStateHandler::Initialize();
334
335 NetworkProfileHandler* profile_handler =
336 NetworkProfileHandler::Initialize();
337 NetworkConfigurationHandler::Initialize();
338 ManagedNetworkConfigurationHandler::Initialize(profile_handler);
339 NetworkConnectionHandler::Initialize();
340 324
341 // Initialize the network change notifier for Chrome OS. The network 325 // Initialize the network change notifier for Chrome OS. The network
342 // change notifier starts to monitor changes from the power manager and 326 // change notifier starts to monitor changes from the power manager and
343 // the network manager. 327 // the network manager.
344 if (!CommandLine::ForCurrentProcess()->HasSwitch( 328 if (!CommandLine::ForCurrentProcess()->HasSwitch(
345 chromeos::switches::kDisableNewNetworkChangeNotifier)) { 329 chromeos::switches::kDisableNewNetworkChangeNotifier)) {
346 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); 330 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize();
347 } else { 331 } else {
348 CrosNetworkChangeNotifierFactory::GetInstance()->Init(); 332 CrosNetworkChangeNotifierFactory::GetInstance()->Init();
349 } 333 }
(...skipping 21 matching lines...) Expand all
371 ~DBusServices() { 355 ~DBusServices() {
372 ConnectivityStateHelper::Shutdown(); 356 ConnectivityStateHelper::Shutdown();
373 // CrosLibrary is shut down before DBusThreadManager even though it 357 // CrosLibrary is shut down before DBusThreadManager even though it
374 // is initialized first becuase some of its libraries depend on DBus 358 // is initialized first becuase some of its libraries depend on DBus
375 // clients. 359 // clients.
376 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. 360 // TODO(hashimoto): Resolve this situation by removing CrosLibrary.
377 // (crosbug.com/26160) 361 // (crosbug.com/26160)
378 if (cros_initialized_ && CrosLibrary::Get()) 362 if (cros_initialized_ && CrosLibrary::Get())
379 CrosLibrary::Shutdown(); 363 CrosLibrary::Shutdown();
380 364
381 ManagedNetworkConfigurationHandler::Shutdown(); 365 CertLibrary::Shutdown();
382 NetworkConfigurationHandler::Shutdown(); 366 NetworkHandler::Shutdown();
383 NetworkConnectionHandler::Shutdown();
384 NetworkProfileHandler::Shutdown();
385
386 NetworkStateHandler::Shutdown();
387 GeolocationHandler::Shutdown();
388 network_event_log::Shutdown();
389 367
390 cryptohome::AsyncMethodCaller::Shutdown(); 368 cryptohome::AsyncMethodCaller::Shutdown();
391 disks::DiskMountManager::Shutdown(); 369 disks::DiskMountManager::Shutdown();
392 input_method::Shutdown(); 370 input_method::Shutdown();
371
393 CryptohomeLibrary::Shutdown(); 372 CryptohomeLibrary::Shutdown();
394 CertLibrary::Shutdown();
395 CertLoader::Shutdown();
396 LoginState::Shutdown(); 373 LoginState::Shutdown();
397 374
398 CrosDBusService::Shutdown(); 375 CrosDBusService::Shutdown();
399 376
400 // NOTE: This must only be called if Initialize() was called. 377 // NOTE: This must only be called if Initialize() was called.
401 DBusThreadManager::Shutdown(); 378 DBusThreadManager::Shutdown();
402 } 379 }
403 380
404 private: 381 private:
405 bool cros_initialized_; 382 bool cros_initialized_;
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 881 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
905 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 882 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
906 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 883 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
907 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 884 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
908 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 885 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
909 // This is necessary to start the experiment as a side effect. 886 // This is necessary to start the experiment as a side effect.
910 trial->group(); 887 trial->group();
911 } 888 }
912 889
913 } // namespace chromeos 890 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698