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 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/component_updater/component_updater_service.h" | 27 #include "chrome/browser/component_updater/component_updater_service.h" |
28 #include "chrome/browser/debugger/remote_debugging_server.h" | 28 #include "chrome/browser/debugger/remote_debugging_server.h" |
29 #include "chrome/browser/download/download_request_limiter.h" | 29 #include "chrome/browser/download/download_request_limiter.h" |
30 #include "chrome/browser/download/download_status_updater.h" | 30 #include "chrome/browser/download/download_status_updater.h" |
31 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 31 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
32 #include "chrome/browser/extensions/extension_tab_id_map.h" | 32 #include "chrome/browser/extensions/extension_tab_id_map.h" |
33 #include "chrome/browser/first_run/upgrade_util.h" | 33 #include "chrome/browser/first_run/upgrade_util.h" |
34 #include "chrome/browser/icon_manager.h" | 34 #include "chrome/browser/icon_manager.h" |
35 #include "chrome/browser/intranet_redirect_detector.h" | 35 #include "chrome/browser/intranet_redirect_detector.h" |
36 #include "chrome/browser/io_thread.h" | 36 #include "chrome/browser/io_thread.h" |
| 37 #include "chrome/browser/media_gallery/media_device_manager.h" |
37 #include "chrome/browser/metrics/metrics_service.h" | 38 #include "chrome/browser/metrics/metrics_service.h" |
38 #include "chrome/browser/metrics/thread_watcher.h" | 39 #include "chrome/browser/metrics/thread_watcher.h" |
39 #include "chrome/browser/net/chrome_net_log.h" | 40 #include "chrome/browser/net/chrome_net_log.h" |
40 #include "chrome/browser/net/crl_set_fetcher.h" | 41 #include "chrome/browser/net/crl_set_fetcher.h" |
41 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 42 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
42 #include "chrome/browser/notifications/notification_ui_manager.h" | 43 #include "chrome/browser/notifications/notification_ui_manager.h" |
43 #include "chrome/browser/policy/browser_policy_connector.h" | 44 #include "chrome/browser/policy/browser_policy_connector.h" |
44 #include "chrome/browser/policy/policy_service_impl.h" | 45 #include "chrome/browser/policy/policy_service_impl.h" |
45 #include "chrome/browser/policy/policy_service_stub.h" | 46 #include "chrome/browser/policy/policy_service_stub.h" |
46 #include "chrome/browser/prefs/browser_prefs.h" | 47 #include "chrome/browser/prefs/browser_prefs.h" |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 // either. | 645 // either. |
645 return NULL; | 646 return NULL; |
646 #else | 647 #else |
647 if (!crl_set_fetcher_.get()) { | 648 if (!crl_set_fetcher_.get()) { |
648 crl_set_fetcher_ = new CRLSetFetcher(); | 649 crl_set_fetcher_ = new CRLSetFetcher(); |
649 } | 650 } |
650 return crl_set_fetcher_.get(); | 651 return crl_set_fetcher_.get(); |
651 #endif | 652 #endif |
652 } | 653 } |
653 | 654 |
| 655 chrome::MediaDeviceManager* BrowserProcessImpl::media_device_manager() { |
| 656 return media_device_manager_.get(); |
| 657 } |
| 658 |
654 void BrowserProcessImpl::ResourceDispatcherHostCreated() { | 659 void BrowserProcessImpl::ResourceDispatcherHostCreated() { |
655 resource_dispatcher_host_delegate_.reset( | 660 resource_dispatcher_host_delegate_.reset( |
656 new ChromeResourceDispatcherHostDelegate(prerender_tracker())); | 661 new ChromeResourceDispatcherHostDelegate(prerender_tracker())); |
657 ResourceDispatcherHost::Get()->SetDelegate( | 662 ResourceDispatcherHost::Get()->SetDelegate( |
658 resource_dispatcher_host_delegate_.get()); | 663 resource_dispatcher_host_delegate_.get()); |
659 | 664 |
660 pref_change_registrar_.Add(prefs::kAllowCrossOriginAuthPrompt, this); | 665 pref_change_registrar_.Add(prefs::kAllowCrossOriginAuthPrompt, this); |
661 ApplyAllowCrossOriginAuthPromptPolicy(); | 666 ApplyAllowCrossOriginAuthPromptPolicy(); |
662 } | 667 } |
663 | 668 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 // Also find plugins in a user-specific plugins dir, | 776 // Also find plugins in a user-specific plugins dir, |
772 // e.g. ~/.config/chromium/Plugins. | 777 // e.g. ~/.config/chromium/Plugins. |
773 FilePath user_data_dir; | 778 FilePath user_data_dir; |
774 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 779 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
775 plugin_service->AddExtraPluginDir(user_data_dir.Append("Plugins")); | 780 plugin_service->AddExtraPluginDir(user_data_dir.Append("Plugins")); |
776 } | 781 } |
777 #endif | 782 #endif |
778 | 783 |
779 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) | 784 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) |
780 ApplyDefaultBrowserPolicy(); | 785 ApplyDefaultBrowserPolicy(); |
| 786 |
| 787 media_device_manager_.reset(new chrome::MediaDeviceManager()); |
781 } | 788 } |
782 | 789 |
783 void BrowserProcessImpl::CreateIconManager() { | 790 void BrowserProcessImpl::CreateIconManager() { |
784 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 791 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
785 created_icon_manager_ = true; | 792 created_icon_manager_ = true; |
786 icon_manager_.reset(new IconManager); | 793 icon_manager_.reset(new IconManager); |
787 } | 794 } |
788 | 795 |
789 void BrowserProcessImpl::CreateIntranetRedirectDetector() { | 796 void BrowserProcessImpl::CreateIntranetRedirectDetector() { |
790 DCHECK(intranet_redirect_detector_.get() == NULL); | 797 DCHECK(intranet_redirect_detector_.get() == NULL); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 } | 923 } |
917 | 924 |
918 void BrowserProcessImpl::OnAutoupdateTimer() { | 925 void BrowserProcessImpl::OnAutoupdateTimer() { |
919 if (CanAutorestartForUpdate()) { | 926 if (CanAutorestartForUpdate()) { |
920 DLOG(WARNING) << "Detected update. Restarting browser."; | 927 DLOG(WARNING) << "Detected update. Restarting browser."; |
921 RestartBackgroundInstance(); | 928 RestartBackgroundInstance(); |
922 } | 929 } |
923 } | 930 } |
924 | 931 |
925 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 932 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |