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" |
| 24 #include "chrome/browser/component_updater/component_updater_service.h" |
23 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 25 #include "chrome/browser/debugger/devtools_protocol_handler.h" |
24 #include "chrome/browser/debugger/remote_debugging_server.h" | 26 #include "chrome/browser/debugger/remote_debugging_server.h" |
25 #include "chrome/browser/download/download_file_manager.h" | 27 #include "chrome/browser/download/download_file_manager.h" |
26 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 28 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
27 #include "chrome/browser/extensions/extension_tab_id_map.h" | 29 #include "chrome/browser/extensions/extension_tab_id_map.h" |
28 #include "chrome/browser/extensions/user_script_listener.h" | 30 #include "chrome/browser/extensions/user_script_listener.h" |
29 #include "chrome/browser/first_run/upgrade_util.h" | 31 #include "chrome/browser/first_run/upgrade_util.h" |
30 #include "chrome/browser/google/google_url_tracker.h" | 32 #include "chrome/browser/google/google_url_tracker.h" |
31 #include "chrome/browser/icon_manager.h" | 33 #include "chrome/browser/icon_manager.h" |
32 #include "chrome/browser/intranet_redirect_detector.h" | 34 #include "chrome/browser/intranet_redirect_detector.h" |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 return mhtml_generation_manager_.get(); | 672 return mhtml_generation_manager_.get(); |
671 } | 673 } |
672 | 674 |
673 GpuBlacklistUpdater* BrowserProcessImpl::gpu_blacklist_updater() { | 675 GpuBlacklistUpdater* BrowserProcessImpl::gpu_blacklist_updater() { |
674 if (!gpu_blacklist_updater_.get()) | 676 if (!gpu_blacklist_updater_.get()) |
675 gpu_blacklist_updater_ = new GpuBlacklistUpdater(); | 677 gpu_blacklist_updater_ = new GpuBlacklistUpdater(); |
676 | 678 |
677 return gpu_blacklist_updater_.get(); | 679 return gpu_blacklist_updater_.get(); |
678 } | 680 } |
679 | 681 |
| 682 ComponentUpdateService* BrowserProcessImpl::component_updater() { |
| 683 #if defined(OS_CHROMEOS) |
| 684 return NULL; |
| 685 #else |
| 686 if (!component_updater_.get()) { |
| 687 ComponentUpdateService::Configurator* configurator = |
| 688 MakeChromeComponentUpdaterConfigurator( |
| 689 CommandLine::ForCurrentProcess(), |
| 690 io_thread()->system_url_request_context_getter()); |
| 691 // Creating the component updater does not do anything, components |
| 692 // need to be registered and Start() needs to be called. |
| 693 component_updater_.reset(ComponentUpdateServiceFactory(configurator)); |
| 694 } |
| 695 return component_updater_.get(); |
| 696 } |
| 697 #endif |
| 698 |
680 void BrowserProcessImpl::CreateResourceDispatcherHost() { | 699 void BrowserProcessImpl::CreateResourceDispatcherHost() { |
681 DCHECK(!created_resource_dispatcher_host_ && | 700 DCHECK(!created_resource_dispatcher_host_ && |
682 resource_dispatcher_host_.get() == NULL); | 701 resource_dispatcher_host_.get() == NULL); |
683 created_resource_dispatcher_host_ = true; | 702 created_resource_dispatcher_host_ = true; |
684 | 703 |
685 // UserScriptListener will delete itself. | 704 // UserScriptListener will delete itself. |
686 ResourceQueue::DelegateSet resource_queue_delegates; | 705 ResourceQueue::DelegateSet resource_queue_delegates; |
687 resource_queue_delegates.insert(new UserScriptListener()); | 706 resource_queue_delegates.insert(new UserScriptListener()); |
688 | 707 |
689 resource_dispatcher_host_.reset( | 708 resource_dispatcher_host_.reset( |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 } | 1118 } |
1100 | 1119 |
1101 void BrowserProcessImpl::OnAutoupdateTimer() { | 1120 void BrowserProcessImpl::OnAutoupdateTimer() { |
1102 if (CanAutorestartForUpdate()) { | 1121 if (CanAutorestartForUpdate()) { |
1103 DLOG(WARNING) << "Detected update. Restarting browser."; | 1122 DLOG(WARNING) << "Detected update. Restarting browser."; |
1104 RestartPersistentInstance(); | 1123 RestartPersistentInstance(); |
1105 } | 1124 } |
1106 } | 1125 } |
1107 | 1126 |
1108 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1127 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |