| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 47 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 48 #include "chrome/browser/shell_integration.h" | 48 #include "chrome/browser/shell_integration.h" |
| 49 #include "chrome/browser/sidebar/sidebar_manager.h" | 49 #include "chrome/browser/sidebar/sidebar_manager.h" |
| 50 #include "chrome/browser/tab_closeable_state_watcher.h" | 50 #include "chrome/browser/tab_closeable_state_watcher.h" |
| 51 #include "chrome/common/chrome_constants.h" | 51 #include "chrome/common/chrome_constants.h" |
| 52 #include "chrome/common/chrome_paths.h" | 52 #include "chrome/common/chrome_paths.h" |
| 53 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
| 54 #include "chrome/common/extensions/extension_l10n_util.h" | 54 #include "chrome/common/extensions/extension_l10n_util.h" |
| 55 #include "chrome/common/extensions/extension_resource.h" | 55 #include "chrome/common/extensions/extension_resource.h" |
| 56 #include "chrome/common/json_pref_store.h" | 56 #include "chrome/common/json_pref_store.h" |
| 57 #include "chrome/common/net/url_request_context_getter.h" |
| 57 #include "chrome/common/pref_names.h" | 58 #include "chrome/common/pref_names.h" |
| 58 #include "chrome/common/switch_utils.h" | 59 #include "chrome/common/switch_utils.h" |
| 59 #include "chrome/common/url_constants.h" | 60 #include "chrome/common/url_constants.h" |
| 60 #include "chrome/installer/util/google_update_constants.h" | 61 #include "chrome/installer/util/google_update_constants.h" |
| 61 #include "content/browser/browser_child_process_host.h" | 62 #include "content/browser/browser_child_process_host.h" |
| 62 #include "content/browser/browser_thread.h" | 63 #include "content/browser/browser_thread.h" |
| 63 #include "content/browser/plugin_service.h" | 64 #include "content/browser/plugin_service.h" |
| 64 #include "content/browser/renderer_host/render_process_host.h" | 65 #include "content/browser/renderer_host/render_process_host.h" |
| 65 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 66 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 66 #include "content/common/notification_service.h" | 67 #include "content/common/notification_service.h" |
| 67 #include "ipc/ipc_logging.h" | 68 #include "ipc/ipc_logging.h" |
| 68 #include "ui/base/clipboard/clipboard.h" | 69 #include "ui/base/clipboard/clipboard.h" |
| 69 #include "ui/base/l10n/l10n_util.h" | 70 #include "ui/base/l10n/l10n_util.h" |
| 70 #include "webkit/database/database_tracker.h" | 71 #include "webkit/database/database_tracker.h" |
| 71 | 72 |
| 72 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
| 73 #include "views/focus/view_storage.h" | 74 #include "views/focus/view_storage.h" |
| 74 #endif | 75 #endif |
| 75 | 76 |
| 76 #if defined(IPC_MESSAGE_LOG_ENABLED) | 77 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 77 #include "content/common/child_process_messages.h" | 78 #include "content/common/child_process_messages.h" |
| 78 #endif | 79 #endif |
| 79 | 80 |
| 81 #if defined(OS_CHROMEOS) |
| 82 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 83 #endif // defined(OS_CHROMEOS) |
| 84 |
| 80 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 85 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 81 // How often to check if the persistent instance of Chrome needs to restart | 86 // How often to check if the persistent instance of Chrome needs to restart |
| 82 // to install an update. | 87 // to install an update. |
| 83 static const int kUpdateCheckIntervalHours = 6; | 88 static const int kUpdateCheckIntervalHours = 6; |
| 84 #endif | 89 #endif |
| 85 | 90 |
| 86 #if defined(USE_X11) | 91 #if defined(USE_X11) |
| 87 // How long to wait for the File thread to complete during EndSession, on | 92 // How long to wait for the File thread to complete during EndSession, on |
| 88 // Linux. We have a timeout here because we're unable to run the UI messageloop | 93 // Linux. We have a timeout here because we're unable to run the UI messageloop |
| 89 // and there's some deadlock risk. Our only option is to exit anyway. | 94 // and there's some deadlock risk. Our only option is to exit anyway. |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 if (!created_sidebar_manager_) | 436 if (!created_sidebar_manager_) |
| 432 CreateSidebarManager(); | 437 CreateSidebarManager(); |
| 433 return sidebar_manager_.get(); | 438 return sidebar_manager_.get(); |
| 434 } | 439 } |
| 435 | 440 |
| 436 ui::Clipboard* BrowserProcessImpl::clipboard() { | 441 ui::Clipboard* BrowserProcessImpl::clipboard() { |
| 437 DCHECK(CalledOnValidThread()); | 442 DCHECK(CalledOnValidThread()); |
| 438 return clipboard_.get(); | 443 return clipboard_.get(); |
| 439 } | 444 } |
| 440 | 445 |
| 446 URLRequestContextGetter* BrowserProcessImpl::system_request_context() { |
| 447 DCHECK(CalledOnValidThread()); |
| 448 return io_thread()->system_url_request_context_getter(); |
| 449 } |
| 450 |
| 451 #if defined(OS_CHROMEOS) |
| 452 chromeos::ProxyConfigServiceImpl* |
| 453 BrowserProcessImpl::chromeos_proxy_config_service_impl() { |
| 454 DCHECK(CalledOnValidThread()); |
| 455 if (!chromeos_proxy_config_service_impl_) { |
| 456 chromeos_proxy_config_service_impl_ = |
| 457 new chromeos::ProxyConfigServiceImpl(); |
| 458 } |
| 459 return chromeos_proxy_config_service_impl_; |
| 460 } |
| 461 #endif // defined(OS_CHROMEOS) |
| 462 |
| 441 ExtensionEventRouterForwarder* | 463 ExtensionEventRouterForwarder* |
| 442 BrowserProcessImpl::extension_event_router_forwarder() { | 464 BrowserProcessImpl::extension_event_router_forwarder() { |
| 443 return extension_event_router_forwarder_.get(); | 465 return extension_event_router_forwarder_.get(); |
| 444 } | 466 } |
| 445 | 467 |
| 446 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() { | 468 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() { |
| 447 DCHECK(CalledOnValidThread()); | 469 DCHECK(CalledOnValidThread()); |
| 448 if (!created_notification_ui_manager_) | 470 if (!created_notification_ui_manager_) |
| 449 CreateNotificationUIManager(); | 471 CreateNotificationUIManager(); |
| 450 return notification_ui_manager_.get(); | 472 return notification_ui_manager_.get(); |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 } | 1015 } |
| 994 | 1016 |
| 995 void BrowserProcessImpl::OnAutoupdateTimer() { | 1017 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 996 if (CanAutorestartForUpdate()) { | 1018 if (CanAutorestartForUpdate()) { |
| 997 DLOG(WARNING) << "Detected update. Restarting browser."; | 1019 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 998 RestartPersistentInstance(); | 1020 RestartPersistentInstance(); |
| 999 } | 1021 } |
| 1000 } | 1022 } |
| 1001 | 1023 |
| 1002 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1024 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |