| 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_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
| 15 #include "base/task.h" | 15 #include "base/task.h" |
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
| 18 #include "chrome/browser/automation/automation_provider_list.h" | 18 #include "chrome/browser/automation/automation_provider_list.h" |
| 19 #include "chrome/browser/background/background_mode_manager.h" | 19 #include "chrome/browser/background/background_mode_manager.h" |
| 20 #include "chrome/browser/browser_main.h" | 20 #include "chrome/browser/browser_main.h" |
| 21 #include "chrome/browser/browser_process_sub_thread.h" | 21 #include "chrome/browser/browser_process_sub_thread.h" |
| 22 #include "chrome/browser/browser_trial.h" | 22 #include "chrome/browser/browser_trial.h" |
| 23 #include "chrome/browser/component_updater/component_updater_configurator.h" | 23 #include "chrome/browser/component_updater/component_updater_configurator.h" |
| 24 #include "chrome/browser/component_updater/component_updater_service.h" | 24 #include "chrome/browser/component_updater/component_updater_service.h" |
| 25 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 25 #include "chrome/browser/debugger/devtools_protocol_handler.h" |
| 26 #include "chrome/browser/debugger/remote_debugging_server.h" | 26 #include "chrome/browser/debugger/remote_debugging_server.h" |
| 27 #include "chrome/browser/download/download_request_limiter.h" |
| 27 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 28 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
| 28 #include "chrome/browser/extensions/extension_tab_id_map.h" | 29 #include "chrome/browser/extensions/extension_tab_id_map.h" |
| 29 #include "chrome/browser/extensions/user_script_listener.h" | 30 #include "chrome/browser/extensions/user_script_listener.h" |
| 30 #include "chrome/browser/first_run/upgrade_util.h" | 31 #include "chrome/browser/first_run/upgrade_util.h" |
| 31 #include "chrome/browser/google/google_url_tracker.h" | 32 #include "chrome/browser/google/google_url_tracker.h" |
| 32 #include "chrome/browser/icon_manager.h" | 33 #include "chrome/browser/icon_manager.h" |
| 33 #include "chrome/browser/intranet_redirect_detector.h" | 34 #include "chrome/browser/intranet_redirect_detector.h" |
| 34 #include "chrome/browser/io_thread.h" | 35 #include "chrome/browser/io_thread.h" |
| 35 #include "chrome/browser/metrics/metrics_service.h" | 36 #include "chrome/browser/metrics/metrics_service.h" |
| 36 #include "chrome/browser/metrics/thread_watcher.h" | 37 #include "chrome/browser/metrics/thread_watcher.h" |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 580 |
| 580 void BrowserProcessImpl::SetApplicationLocale(const std::string& locale) { | 581 void BrowserProcessImpl::SetApplicationLocale(const std::string& locale) { |
| 581 locale_ = locale; | 582 locale_ = locale; |
| 582 extension_l10n_util::SetProcessLocale(locale); | 583 extension_l10n_util::SetProcessLocale(locale); |
| 583 } | 584 } |
| 584 | 585 |
| 585 DownloadStatusUpdater* BrowserProcessImpl::download_status_updater() { | 586 DownloadStatusUpdater* BrowserProcessImpl::download_status_updater() { |
| 586 return &download_status_updater_; | 587 return &download_status_updater_; |
| 587 } | 588 } |
| 588 | 589 |
| 590 DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { |
| 591 DCHECK(CalledOnValidThread()); |
| 592 if (!download_request_limiter_) |
| 593 download_request_limiter_ = new DownloadRequestLimiter(); |
| 594 return download_request_limiter_; |
| 595 } |
| 596 |
| 589 TabCloseableStateWatcher* BrowserProcessImpl::tab_closeable_state_watcher() { | 597 TabCloseableStateWatcher* BrowserProcessImpl::tab_closeable_state_watcher() { |
| 590 DCHECK(CalledOnValidThread()); | 598 DCHECK(CalledOnValidThread()); |
| 591 if (!tab_closeable_state_watcher_.get()) | 599 if (!tab_closeable_state_watcher_.get()) |
| 592 CreateTabCloseableStateWatcher(); | 600 CreateTabCloseableStateWatcher(); |
| 593 return tab_closeable_state_watcher_.get(); | 601 return tab_closeable_state_watcher_.get(); |
| 594 } | 602 } |
| 595 | 603 |
| 596 BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { | 604 BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { |
| 597 DCHECK(CalledOnValidThread()); | 605 DCHECK(CalledOnValidThread()); |
| 598 if (!background_mode_manager_.get()) | 606 if (!background_mode_manager_.get()) |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 } | 1126 } |
| 1119 | 1127 |
| 1120 void BrowserProcessImpl::OnAutoupdateTimer() { | 1128 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1121 if (CanAutorestartForUpdate()) { | 1129 if (CanAutorestartForUpdate()) { |
| 1122 DLOG(WARNING) << "Detected update. Restarting browser."; | 1130 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1123 RestartPersistentInstance(); | 1131 RestartPersistentInstance(); |
| 1124 } | 1132 } |
| 1125 } | 1133 } |
| 1126 | 1134 |
| 1127 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1135 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |