| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "chrome/installer/util/google_update_constants.h" | 71 #include "chrome/installer/util/google_update_constants.h" |
| 72 #include "content/public/browser/browser_thread.h" | 72 #include "content/public/browser/browser_thread.h" |
| 73 #include "content/public/browser/child_process_security_policy.h" | 73 #include "content/public/browser/child_process_security_policy.h" |
| 74 #include "content/public/browser/notification_details.h" | 74 #include "content/public/browser/notification_details.h" |
| 75 #include "content/public/browser/plugin_service.h" | 75 #include "content/public/browser/plugin_service.h" |
| 76 #include "content/public/browser/render_process_host.h" | 76 #include "content/public/browser/render_process_host.h" |
| 77 #include "content/public/browser/resource_dispatcher_host.h" | 77 #include "content/public/browser/resource_dispatcher_host.h" |
| 78 #include "content/public/common/pepper_plugin_info.h" | 78 #include "content/public/common/pepper_plugin_info.h" |
| 79 #include "net/socket/client_socket_pool_manager.h" | 79 #include "net/socket/client_socket_pool_manager.h" |
| 80 #include "net/url_request/url_request_context_getter.h" | 80 #include "net/url_request/url_request_context_getter.h" |
| 81 #include "ui/base/clipboard/clipboard.h" | |
| 82 #include "ui/base/l10n/l10n_util.h" | 81 #include "ui/base/l10n/l10n_util.h" |
| 83 | 82 |
| 84 #if !defined(ENABLE_CONFIGURATION_POLICY) | 83 #if !defined(ENABLE_CONFIGURATION_POLICY) |
| 85 #include "chrome/browser/policy/policy_service_stub.h" | 84 #include "chrome/browser/policy/policy_service_stub.h" |
| 86 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 85 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 87 | 86 |
| 88 #if defined(OS_WIN) | 87 #if defined(OS_WIN) |
| 89 #include "base/win/windows_version.h" | 88 #include "base/win/windows_version.h" |
| 90 #include "ui/views/focus/view_storage.h" | 89 #include "ui/views/focus/view_storage.h" |
| 91 #elif defined(OS_MACOSX) | 90 #elif defined(OS_MACOSX) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 created_icon_manager_(false), | 134 created_icon_manager_(false), |
| 136 created_notification_ui_manager_(false), | 135 created_notification_ui_manager_(false), |
| 137 created_safe_browsing_service_(false), | 136 created_safe_browsing_service_(false), |
| 138 module_ref_count_(0), | 137 module_ref_count_(0), |
| 139 did_start_(false), | 138 did_start_(false), |
| 140 checked_for_new_frames_(false), | 139 checked_for_new_frames_(false), |
| 141 using_new_frames_(false), | 140 using_new_frames_(false), |
| 142 thumbnail_generator_(new ThumbnailGenerator), | 141 thumbnail_generator_(new ThumbnailGenerator), |
| 143 download_status_updater_(new DownloadStatusUpdater) { | 142 download_status_updater_(new DownloadStatusUpdater) { |
| 144 g_browser_process = this; | 143 g_browser_process = this; |
| 145 clipboard_.reset(new ui::Clipboard); | |
| 146 | 144 |
| 147 #if defined(ENABLE_PRINTING) | 145 #if defined(ENABLE_PRINTING) |
| 148 // Must be created after the NotificationService. | 146 // Must be created after the NotificationService. |
| 149 print_job_manager_.reset(new printing::PrintJobManager); | 147 print_job_manager_.reset(new printing::PrintJobManager); |
| 150 #endif | 148 #endif |
| 151 | 149 |
| 152 net_log_.reset(new ChromeNetLog); | 150 net_log_.reset(new ChromeNetLog); |
| 153 | 151 |
| 154 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 152 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
| 155 chrome::kExtensionScheme); | 153 chrome::kExtensionScheme); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 return profile_manager_.get(); | 379 return profile_manager_.get(); |
| 382 } | 380 } |
| 383 | 381 |
| 384 PrefService* BrowserProcessImpl::local_state() { | 382 PrefService* BrowserProcessImpl::local_state() { |
| 385 DCHECK(CalledOnValidThread()); | 383 DCHECK(CalledOnValidThread()); |
| 386 if (!created_local_state_) | 384 if (!created_local_state_) |
| 387 CreateLocalState(); | 385 CreateLocalState(); |
| 388 return local_state_.get(); | 386 return local_state_.get(); |
| 389 } | 387 } |
| 390 | 388 |
| 391 ui::Clipboard* BrowserProcessImpl::clipboard() { | |
| 392 DCHECK(CalledOnValidThread()); | |
| 393 return clipboard_.get(); | |
| 394 } | |
| 395 | |
| 396 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { | 389 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { |
| 397 DCHECK(CalledOnValidThread()); | 390 DCHECK(CalledOnValidThread()); |
| 398 return io_thread()->system_url_request_context_getter(); | 391 return io_thread()->system_url_request_context_getter(); |
| 399 } | 392 } |
| 400 | 393 |
| 401 chrome_variations::VariationsService* BrowserProcessImpl::variations_service() { | 394 chrome_variations::VariationsService* BrowserProcessImpl::variations_service() { |
| 402 DCHECK(CalledOnValidThread()); | 395 DCHECK(CalledOnValidThread()); |
| 403 if (!variations_service_.get()) | 396 if (!variations_service_.get()) |
| 404 variations_service_.reset(new chrome_variations::VariationsService()); | 397 variations_service_.reset(new chrome_variations::VariationsService()); |
| 405 return variations_service_.get(); | 398 return variations_service_.get(); |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 } | 930 } |
| 938 | 931 |
| 939 void BrowserProcessImpl::OnAutoupdateTimer() { | 932 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 940 if (CanAutorestartForUpdate()) { | 933 if (CanAutorestartForUpdate()) { |
| 941 DLOG(WARNING) << "Detected update. Restarting browser."; | 934 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 942 RestartBackgroundInstance(); | 935 RestartBackgroundInstance(); |
| 943 } | 936 } |
| 944 } | 937 } |
| 945 | 938 |
| 946 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 939 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |