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" | |
58 #include "chrome/common/notification_service.h" | |
57 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
58 #include "chrome/common/switch_utils.h" | 60 #include "chrome/common/switch_utils.h" |
59 #include "chrome/common/url_constants.h" | 61 #include "chrome/common/url_constants.h" |
60 #include "chrome/installer/util/google_update_constants.h" | 62 #include "chrome/installer/util/google_update_constants.h" |
61 #include "content/browser/browser_child_process_host.h" | 63 #include "content/browser/browser_child_process_host.h" |
62 #include "content/browser/browser_thread.h" | 64 #include "content/browser/browser_thread.h" |
63 #include "content/browser/plugin_service.h" | 65 #include "content/browser/plugin_service.h" |
64 #include "content/browser/renderer_host/render_process_host.h" | 66 #include "content/browser/renderer_host/render_process_host.h" |
65 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 67 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
66 #include "content/common/notification_service.h" | 68 #include "content/common/notification_service.h" |
67 #include "ipc/ipc_logging.h" | 69 #include "ipc/ipc_logging.h" |
68 #include "ui/base/clipboard/clipboard.h" | 70 #include "ui/base/clipboard/clipboard.h" |
69 #include "ui/base/l10n/l10n_util.h" | 71 #include "ui/base/l10n/l10n_util.h" |
70 #include "webkit/database/database_tracker.h" | 72 #include "webkit/database/database_tracker.h" |
71 | 73 |
72 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
73 #include "views/focus/view_storage.h" | 75 #include "views/focus/view_storage.h" |
74 #endif | 76 #endif |
75 | 77 |
76 #if defined(IPC_MESSAGE_LOG_ENABLED) | 78 #if defined(IPC_MESSAGE_LOG_ENABLED) |
77 #include "content/common/child_process_messages.h" | 79 #include "content/common/child_process_messages.h" |
78 #endif | 80 #endif |
79 | 81 |
82 #if defined(OS_CHROMEOS) | |
83 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | |
84 #endif // defined(OS_CHROMEOS) | |
85 | |
80 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 86 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
81 // How often to check if the persistent instance of Chrome needs to restart | 87 // How often to check if the persistent instance of Chrome needs to restart |
82 // to install an update. | 88 // to install an update. |
83 static const int kUpdateCheckIntervalHours = 6; | 89 static const int kUpdateCheckIntervalHours = 6; |
84 #endif | 90 #endif |
85 | 91 |
86 #if defined(USE_X11) | 92 #if defined(USE_X11) |
87 // How long to wait for the File thread to complete during EndSession, on | 93 // 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 | 94 // 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. | 95 // 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_) | 437 if (!created_sidebar_manager_) |
432 CreateSidebarManager(); | 438 CreateSidebarManager(); |
433 return sidebar_manager_.get(); | 439 return sidebar_manager_.get(); |
434 } | 440 } |
435 | 441 |
436 ui::Clipboard* BrowserProcessImpl::clipboard() { | 442 ui::Clipboard* BrowserProcessImpl::clipboard() { |
437 DCHECK(CalledOnValidThread()); | 443 DCHECK(CalledOnValidThread()); |
438 return clipboard_.get(); | 444 return clipboard_.get(); |
439 } | 445 } |
440 | 446 |
447 URLRequestContextGetter* BrowserProcessImpl::system_request_context() { | |
448 DCHECK(CalledOnValidThread()); | |
449 return io_thread()->system_url_request_context_getter(); | |
450 } | |
451 | |
452 #if defined(OS_CHROMEOS) | |
453 chromeos::ProxyConfigServiceImpl* | |
454 BrowserProcessImpl::chromeos_proxy_config_service_impl() { | |
willchan no longer on Chromium
2011/03/10 00:40:02
DCHECK(CalledOnValidThread())
Perhaps you should
battre
2011/03/10 16:11:57
I have added the DCHECK. I think there is no need
| |
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 |