| 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 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "chrome/common/chrome_switches.h" | 64 #include "chrome/common/chrome_switches.h" |
| 65 #include "chrome/common/extensions/extension_l10n_util.h" | 65 #include "chrome/common/extensions/extension_l10n_util.h" |
| 66 #include "chrome/common/extensions/extension_resource.h" | 66 #include "chrome/common/extensions/extension_resource.h" |
| 67 #include "chrome/common/json_pref_store.h" | 67 #include "chrome/common/json_pref_store.h" |
| 68 #include "chrome/common/pref_names.h" | 68 #include "chrome/common/pref_names.h" |
| 69 #include "chrome/common/switch_utils.h" | 69 #include "chrome/common/switch_utils.h" |
| 70 #include "chrome/common/url_constants.h" | 70 #include "chrome/common/url_constants.h" |
| 71 #include "chrome/installer/util/google_update_constants.h" | 71 #include "chrome/installer/util/google_update_constants.h" |
| 72 #include "content/browser/browser_process_sub_thread.h" | 72 #include "content/browser/browser_process_sub_thread.h" |
| 73 #include "content/browser/child_process_security_policy.h" | 73 #include "content/browser/child_process_security_policy.h" |
| 74 #include "content/browser/debugger/devtools_manager.h" | |
| 75 #include "content/browser/download/download_file_manager.h" | 74 #include "content/browser/download/download_file_manager.h" |
| 76 #include "content/browser/download/download_status_updater.h" | 75 #include "content/browser/download/download_status_updater.h" |
| 77 #include "content/browser/download/mhtml_generation_manager.h" | 76 #include "content/browser/download/mhtml_generation_manager.h" |
| 78 #include "content/browser/download/save_file_manager.h" | 77 #include "content/browser/download/save_file_manager.h" |
| 79 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 78 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 80 #include "content/browser/net/browser_online_state_observer.h" | 79 #include "content/browser/net/browser_online_state_observer.h" |
| 81 #include "content/browser/plugin_service.h" | 80 #include "content/browser/plugin_service.h" |
| 82 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 81 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 83 #include "content/public/browser/browser_thread.h" | 82 #include "content/public/browser/browser_thread.h" |
| 84 #include "content/public/browser/notification_details.h" | 83 #include "content/public/browser/notification_details.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 created_db_thread_(false), | 130 created_db_thread_(false), |
| 132 created_process_launcher_thread_(false), | 131 created_process_launcher_thread_(false), |
| 133 created_cache_thread_(false), | 132 created_cache_thread_(false), |
| 134 created_watchdog_thread_(false), | 133 created_watchdog_thread_(false), |
| 135 #if defined(OS_CHROMEOS) | 134 #if defined(OS_CHROMEOS) |
| 136 created_web_socket_proxy_thread_(false), | 135 created_web_socket_proxy_thread_(false), |
| 137 #endif | 136 #endif |
| 138 created_profile_manager_(false), | 137 created_profile_manager_(false), |
| 139 created_local_state_(false), | 138 created_local_state_(false), |
| 140 created_icon_manager_(false), | 139 created_icon_manager_(false), |
| 141 created_devtools_manager_(false), | |
| 142 created_sidebar_manager_(false), | 140 created_sidebar_manager_(false), |
| 143 created_browser_policy_connector_(false), | 141 created_browser_policy_connector_(false), |
| 144 created_notification_ui_manager_(false), | 142 created_notification_ui_manager_(false), |
| 145 created_safe_browsing_service_(false), | 143 created_safe_browsing_service_(false), |
| 146 module_ref_count_(0), | 144 module_ref_count_(0), |
| 147 did_start_(false), | 145 did_start_(false), |
| 148 checked_for_new_frames_(false), | 146 checked_for_new_frames_(false), |
| 149 using_new_frames_(false), | 147 using_new_frames_(false), |
| 150 thumbnail_generator_(new ThumbnailGenerator), | 148 thumbnail_generator_(new ThumbnailGenerator), |
| 151 download_status_updater_(new DownloadStatusUpdater) { | 149 download_status_updater_(new DownloadStatusUpdater) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 return profile_manager_.get(); | 457 return profile_manager_.get(); |
| 460 } | 458 } |
| 461 | 459 |
| 462 PrefService* BrowserProcessImpl::local_state() { | 460 PrefService* BrowserProcessImpl::local_state() { |
| 463 DCHECK(CalledOnValidThread()); | 461 DCHECK(CalledOnValidThread()); |
| 464 if (!created_local_state_) | 462 if (!created_local_state_) |
| 465 CreateLocalState(); | 463 CreateLocalState(); |
| 466 return local_state_.get(); | 464 return local_state_.get(); |
| 467 } | 465 } |
| 468 | 466 |
| 469 DevToolsManager* BrowserProcessImpl::devtools_manager() { | |
| 470 DCHECK(CalledOnValidThread()); | |
| 471 if (!created_devtools_manager_) | |
| 472 CreateDevToolsManager(); | |
| 473 return devtools_manager_.get(); | |
| 474 } | |
| 475 | |
| 476 SidebarManager* BrowserProcessImpl::sidebar_manager() { | 467 SidebarManager* BrowserProcessImpl::sidebar_manager() { |
| 477 DCHECK(CalledOnValidThread()); | 468 DCHECK(CalledOnValidThread()); |
| 478 if (!created_sidebar_manager_) | 469 if (!created_sidebar_manager_) |
| 479 CreateSidebarManager(); | 470 CreateSidebarManager(); |
| 480 return sidebar_manager_.get(); | 471 return sidebar_manager_.get(); |
| 481 } | 472 } |
| 482 | 473 |
| 483 ui::Clipboard* BrowserProcessImpl::clipboard() { | 474 ui::Clipboard* BrowserProcessImpl::clipboard() { |
| 484 DCHECK(CalledOnValidThread()); | 475 DCHECK(CalledOnValidThread()); |
| 485 return clipboard_.get(); | 476 return clipboard_.get(); |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 | 940 |
| 950 local_state_->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false); | 941 local_state_->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false); |
| 951 } | 942 } |
| 952 | 943 |
| 953 void BrowserProcessImpl::CreateIconManager() { | 944 void BrowserProcessImpl::CreateIconManager() { |
| 954 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 945 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
| 955 created_icon_manager_ = true; | 946 created_icon_manager_ = true; |
| 956 icon_manager_.reset(new IconManager); | 947 icon_manager_.reset(new IconManager); |
| 957 } | 948 } |
| 958 | 949 |
| 959 void BrowserProcessImpl::CreateDevToolsManager() { | |
| 960 DCHECK(devtools_manager_.get() == NULL); | |
| 961 created_devtools_manager_ = true; | |
| 962 devtools_manager_.reset(new DevToolsManager()); | |
| 963 } | |
| 964 | |
| 965 void BrowserProcessImpl::CreateSidebarManager() { | 950 void BrowserProcessImpl::CreateSidebarManager() { |
| 966 DCHECK(sidebar_manager_.get() == NULL); | 951 DCHECK(sidebar_manager_.get() == NULL); |
| 967 created_sidebar_manager_ = true; | 952 created_sidebar_manager_ = true; |
| 968 sidebar_manager_ = new SidebarManager(); | 953 sidebar_manager_ = new SidebarManager(); |
| 969 } | 954 } |
| 970 | 955 |
| 971 void BrowserProcessImpl::CreateGoogleURLTracker() { | 956 void BrowserProcessImpl::CreateGoogleURLTracker() { |
| 972 DCHECK(google_url_tracker_.get() == NULL); | 957 DCHECK(google_url_tracker_.get() == NULL); |
| 973 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); | 958 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); |
| 974 google_url_tracker_.swap(google_url_tracker); | 959 google_url_tracker_.swap(google_url_tracker); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 } | 1085 } |
| 1101 | 1086 |
| 1102 void BrowserProcessImpl::OnAutoupdateTimer() { | 1087 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1103 if (CanAutorestartForUpdate()) { | 1088 if (CanAutorestartForUpdate()) { |
| 1104 DLOG(WARNING) << "Detected update. Restarting browser."; | 1089 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1105 RestartBackgroundInstance(); | 1090 RestartBackgroundInstance(); |
| 1106 } | 1091 } |
| 1107 } | 1092 } |
| 1108 | 1093 |
| 1109 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1094 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |