| 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 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 50 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 51 #include "chrome/browser/shell_integration.h" | 51 #include "chrome/browser/shell_integration.h" |
| 52 #include "chrome/browser/sidebar/sidebar_manager.h" | 52 #include "chrome/browser/sidebar/sidebar_manager.h" |
| 53 #include "chrome/browser/tab_closeable_state_watcher.h" | 53 #include "chrome/browser/tab_closeable_state_watcher.h" |
| 54 #include "chrome/common/chrome_constants.h" | 54 #include "chrome/common/chrome_constants.h" |
| 55 #include "chrome/common/chrome_paths.h" | 55 #include "chrome/common/chrome_paths.h" |
| 56 #include "chrome/common/chrome_switches.h" | 56 #include "chrome/common/chrome_switches.h" |
| 57 #include "chrome/common/extensions/extension_resource.h" | 57 #include "chrome/common/extensions/extension_resource.h" |
| 58 #include "chrome/common/extensions/extension_l10n_util.h" | 58 #include "chrome/common/extensions/extension_l10n_util.h" |
| 59 #include "chrome/common/json_pref_store.h" | 59 #include "chrome/common/json_pref_store.h" |
| 60 #include "chrome/common/net/url_request_context_getter.h" |
| 60 #include "chrome/common/notification_service.h" | 61 #include "chrome/common/notification_service.h" |
| 61 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
| 62 #include "chrome/common/url_constants.h" | 63 #include "chrome/common/url_constants.h" |
| 63 #include "chrome/common/switch_utils.h" | 64 #include "chrome/common/switch_utils.h" |
| 64 #include "chrome/installer/util/google_update_constants.h" | 65 #include "chrome/installer/util/google_update_constants.h" |
| 65 #include "ipc/ipc_logging.h" | 66 #include "ipc/ipc_logging.h" |
| 66 #include "ui/base/clipboard/clipboard.h" | 67 #include "ui/base/clipboard/clipboard.h" |
| 67 #include "ui/base/l10n/l10n_util.h" | 68 #include "ui/base/l10n/l10n_util.h" |
| 68 #include "webkit/database/database_tracker.h" | 69 #include "webkit/database/database_tracker.h" |
| 69 | 70 |
| 70 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 71 #include "views/focus/view_storage.h" | 72 #include "views/focus/view_storage.h" |
| 72 #endif | 73 #endif |
| 73 | 74 |
| 74 #if defined(IPC_MESSAGE_LOG_ENABLED) | 75 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 75 #include "chrome/common/plugin_messages.h" | 76 #include "chrome/common/plugin_messages.h" |
| 76 #include "chrome/common/render_messages.h" | 77 #include "chrome/common/render_messages.h" |
| 77 #endif | 78 #endif |
| 78 | 79 |
| 80 #if defined(OS_CHROMEOS) |
| 81 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 82 #endif // defined(OS_CHROMEOS) |
| 83 |
| 79 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 84 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 80 // How often to check if the persistent instance of Chrome needs to restart | 85 // How often to check if the persistent instance of Chrome needs to restart |
| 81 // to install an update. | 86 // to install an update. |
| 82 static const int kUpdateCheckIntervalHours = 6; | 87 static const int kUpdateCheckIntervalHours = 6; |
| 83 #endif | 88 #endif |
| 84 | 89 |
| 85 #if defined(USE_X11) | 90 #if defined(USE_X11) |
| 86 // How long to wait for the File thread to complete during EndSession, on | 91 // How long to wait for the File thread to complete during EndSession, on |
| 87 // Linux. We have a timeout here because we're unable to run the UI messageloop | 92 // Linux. We have a timeout here because we're unable to run the UI messageloop |
| 88 // and there's some deadlock risk. Our only option is to exit anyway. | 93 // and there's some deadlock risk. Our only option is to exit anyway. |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 if (!created_sidebar_manager_) | 421 if (!created_sidebar_manager_) |
| 417 CreateSidebarManager(); | 422 CreateSidebarManager(); |
| 418 return sidebar_manager_.get(); | 423 return sidebar_manager_.get(); |
| 419 } | 424 } |
| 420 | 425 |
| 421 ui::Clipboard* BrowserProcessImpl::clipboard() { | 426 ui::Clipboard* BrowserProcessImpl::clipboard() { |
| 422 DCHECK(CalledOnValidThread()); | 427 DCHECK(CalledOnValidThread()); |
| 423 return clipboard_.get(); | 428 return clipboard_.get(); |
| 424 } | 429 } |
| 425 | 430 |
| 431 scoped_refptr<URLRequestContextGetter> |
| 432 BrowserProcessImpl::system_request_context() { |
| 433 DCHECK(CalledOnValidThread()); |
| 434 return io_thread()->system_url_request_context_getter(); |
| 435 } |
| 436 |
| 437 #if defined(OS_CHROMEOS) |
| 438 chromeos::ProxyConfigServiceImpl* |
| 439 BrowserProcessImpl::chromeos_proxy_config_service_impl() { |
| 440 if (!chromeos_proxy_config_service_impl_) { |
| 441 chromeos_proxy_config_service_impl_ = |
| 442 new chromeos::ProxyConfigServiceImpl(); |
| 443 } |
| 444 return chromeos_proxy_config_service_impl_; |
| 445 } |
| 446 #endif // defined(OS_CHROMEOS) |
| 447 |
| 426 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() { | 448 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() { |
| 427 DCHECK(CalledOnValidThread()); | 449 DCHECK(CalledOnValidThread()); |
| 428 if (!created_notification_ui_manager_) | 450 if (!created_notification_ui_manager_) |
| 429 CreateNotificationUIManager(); | 451 CreateNotificationUIManager(); |
| 430 return notification_ui_manager_.get(); | 452 return notification_ui_manager_.get(); |
| 431 } | 453 } |
| 432 | 454 |
| 433 policy::ConfigurationPolicyProviderKeeper* | 455 policy::ConfigurationPolicyProviderKeeper* |
| 434 BrowserProcessImpl::configuration_policy_provider_keeper() { | 456 BrowserProcessImpl::configuration_policy_provider_keeper() { |
| 435 DCHECK(CalledOnValidThread()); | 457 DCHECK(CalledOnValidThread()); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 } | 969 } |
| 948 | 970 |
| 949 void BrowserProcessImpl::OnAutoupdateTimer() { | 971 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 950 if (CanAutorestartForUpdate()) { | 972 if (CanAutorestartForUpdate()) { |
| 951 DLOG(WARNING) << "Detected update. Restarting browser."; | 973 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 952 RestartPersistentInstance(); | 974 RestartPersistentInstance(); |
| 953 } | 975 } |
| 954 } | 976 } |
| 955 | 977 |
| 956 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 978 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |