| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 #include "chrome/browser/chromeos/cros/cros_library.h" | 138 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 139 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 139 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| 140 #include "chrome/browser/chromeos/customization_document.h" | 140 #include "chrome/browser/chromeos/customization_document.h" |
| 141 #include "chrome/browser/chromeos/external_metrics.h" | 141 #include "chrome/browser/chromeos/external_metrics.h" |
| 142 #include "chrome/browser/chromeos/login/authenticator.h" | 142 #include "chrome/browser/chromeos/login/authenticator.h" |
| 143 #include "chrome/browser/chromeos/login/login_utils.h" | 143 #include "chrome/browser/chromeos/login/login_utils.h" |
| 144 #include "chrome/browser/chromeos/login/ownership_service.h" | 144 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 145 #include "chrome/browser/chromeos/login/screen_locker.h" | 145 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 146 #include "chrome/browser/chromeos/login/user_manager.h" | 146 #include "chrome/browser/chromeos/login/user_manager.h" |
| 147 #include "chrome/browser/chromeos/metrics_cros_settings_provider.h" | 147 #include "chrome/browser/chromeos/metrics_cros_settings_provider.h" |
| 148 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
| 148 #include "chrome/browser/chromeos/system_key_event_listener.h" | 149 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 149 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 150 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
| 150 #include "chrome/browser/oom_priority_manager.h" | 151 #include "chrome/browser/oom_priority_manager.h" |
| 151 #include "chrome/browser/ui/views/browser_dialogs.h" | 152 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 152 #endif | 153 #endif |
| 153 | 154 |
| 154 // TODO(port): several win-only methods have been pulled out of this, but | 155 // TODO(port): several win-only methods have been pulled out of this, but |
| 155 // BrowserMain() as a whole needs to be broken apart so that it's usable by | 156 // BrowserMain() as a whole needs to be broken apart so that it's usable by |
| 156 // other platforms. For now, it's just a stub. This is a serious work in | 157 // other platforms. For now, it's just a stub. This is a serious work in |
| 157 // progress and should not be taken as an indication of a real refactoring. | 158 // progress and should not be taken as an indication of a real refactoring. |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // BrowserMainParts: |MainMessageLoopStart()| and related ---------------------- | 526 // BrowserMainParts: |MainMessageLoopStart()| and related ---------------------- |
| 526 | 527 |
| 527 void BrowserMainParts::MainMessageLoopStart() { | 528 void BrowserMainParts::MainMessageLoopStart() { |
| 528 PreMainMessageLoopStart(); | 529 PreMainMessageLoopStart(); |
| 529 | 530 |
| 530 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 531 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
| 531 | 532 |
| 532 // TODO(viettrungluu): should these really go before setting the thread name? | 533 // TODO(viettrungluu): should these really go before setting the thread name? |
| 533 system_monitor_.reset(new ui::SystemMonitor); | 534 system_monitor_.reset(new ui::SystemMonitor); |
| 534 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 535 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
| 536 #if defined(OS_CHROMEOS) |
| 537 // TODO(zelidrag): We need to move cros library glue code outside of |
| 538 // chrome/browser directory to avoid check_deps issues and then migrate |
| 539 // NetworkChangeNotifierCros class to net/base where other OS implementations |
| 540 // live. |
| 541 network_change_notifier_.reset(new chromeos::NetworkChangeNotifierCros()); |
| 542 #else |
| 535 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 543 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
| 536 | 544 #endif |
| 537 InitializeMainThread(); | 545 InitializeMainThread(); |
| 538 | 546 |
| 539 PostMainMessageLoopStart(); | 547 PostMainMessageLoopStart(); |
| 540 Profiling::MainMessageLoopStarted(); | 548 Profiling::MainMessageLoopStarted(); |
| 541 } | 549 } |
| 542 | 550 |
| 543 void BrowserMainParts::InitializeMainThread() { | 551 void BrowserMainParts::InitializeMainThread() { |
| 544 const char* kThreadName = "CrBrowserMain"; | 552 const char* kThreadName = "CrBrowserMain"; |
| 545 base::PlatformThread::SetName(kThreadName); | 553 base::PlatformThread::SetName(kThreadName); |
| 546 main_message_loop().set_thread_name(kThreadName); | 554 main_message_loop().set_thread_name(kThreadName); |
| (...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 #if defined(OS_CHROMEOS) | 1960 #if defined(OS_CHROMEOS) |
| 1953 // To be precise, logout (browser shutdown) is not yet done, but the | 1961 // To be precise, logout (browser shutdown) is not yet done, but the |
| 1954 // remaining work is negligible, hence we say LogoutDone here. | 1962 // remaining work is negligible, hence we say LogoutDone here. |
| 1955 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1963 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 1956 false); | 1964 false); |
| 1957 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1965 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 1958 #endif | 1966 #endif |
| 1959 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 1967 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
| 1960 return result_code; | 1968 return result_code; |
| 1961 } | 1969 } |
| OLD | NEW |