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