| 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 "ui/views/focus/view_storage.h" | 88 #include "ui/views/focus/view_storage.h" |
| 90 #elif defined(OS_MACOSX) | 89 #elif defined(OS_MACOSX) |
| 91 #include "chrome/browser/chrome_browser_main_mac.h" | 90 #include "chrome/browser/chrome_browser_main_mac.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 created_icon_manager_(false), | 133 created_icon_manager_(false), |
| 135 created_notification_ui_manager_(false), | 134 created_notification_ui_manager_(false), |
| 136 created_safe_browsing_service_(false), | 135 created_safe_browsing_service_(false), |
| 137 module_ref_count_(0), | 136 module_ref_count_(0), |
| 138 did_start_(false), | 137 did_start_(false), |
| 139 checked_for_new_frames_(false), | 138 checked_for_new_frames_(false), |
| 140 using_new_frames_(false), | 139 using_new_frames_(false), |
| 141 thumbnail_generator_(new ThumbnailGenerator), | 140 thumbnail_generator_(new ThumbnailGenerator), |
| 142 download_status_updater_(new DownloadStatusUpdater) { | 141 download_status_updater_(new DownloadStatusUpdater) { |
| 143 g_browser_process = this; | 142 g_browser_process = this; |
| 144 clipboard_.reset(new ui::Clipboard); | |
| 145 | 143 |
| 146 #if defined(ENABLE_PRINTING) | 144 #if defined(ENABLE_PRINTING) |
| 147 // Must be created after the NotificationService. | 145 // Must be created after the NotificationService. |
| 148 print_job_manager_.reset(new printing::PrintJobManager); | 146 print_job_manager_.reset(new printing::PrintJobManager); |
| 149 #endif | 147 #endif |
| 150 | 148 |
| 151 net_log_.reset(new ChromeNetLog); | 149 net_log_.reset(new ChromeNetLog); |
| 152 | 150 |
| 153 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 151 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
| 154 chrome::kExtensionScheme); | 152 chrome::kExtensionScheme); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 return profile_manager_.get(); | 378 return profile_manager_.get(); |
| 381 } | 379 } |
| 382 | 380 |
| 383 PrefService* BrowserProcessImpl::local_state() { | 381 PrefService* BrowserProcessImpl::local_state() { |
| 384 DCHECK(CalledOnValidThread()); | 382 DCHECK(CalledOnValidThread()); |
| 385 if (!created_local_state_) | 383 if (!created_local_state_) |
| 386 CreateLocalState(); | 384 CreateLocalState(); |
| 387 return local_state_.get(); | 385 return local_state_.get(); |
| 388 } | 386 } |
| 389 | 387 |
| 390 ui::Clipboard* BrowserProcessImpl::clipboard() { | |
| 391 DCHECK(CalledOnValidThread()); | |
| 392 return clipboard_.get(); | |
| 393 } | |
| 394 | |
| 395 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { | 388 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { |
| 396 DCHECK(CalledOnValidThread()); | 389 DCHECK(CalledOnValidThread()); |
| 397 return io_thread()->system_url_request_context_getter(); | 390 return io_thread()->system_url_request_context_getter(); |
| 398 } | 391 } |
| 399 | 392 |
| 400 chrome_variations::VariationsService* BrowserProcessImpl::variations_service() { | 393 chrome_variations::VariationsService* BrowserProcessImpl::variations_service() { |
| 401 DCHECK(CalledOnValidThread()); | 394 DCHECK(CalledOnValidThread()); |
| 402 if (!variations_service_.get()) | 395 if (!variations_service_.get()) |
| 403 variations_service_.reset(new chrome_variations::VariationsService()); | 396 variations_service_.reset(new chrome_variations::VariationsService()); |
| 404 return variations_service_.get(); | 397 return variations_service_.get(); |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 } | 924 } |
| 932 | 925 |
| 933 void BrowserProcessImpl::OnAutoupdateTimer() { | 926 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 934 if (CanAutorestartForUpdate()) { | 927 if (CanAutorestartForUpdate()) { |
| 935 DLOG(WARNING) << "Detected update. Restarting browser."; | 928 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 936 RestartBackgroundInstance(); | 929 RestartBackgroundInstance(); |
| 937 } | 930 } |
| 938 } | 931 } |
| 939 | 932 |
| 940 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 933 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |