| 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/test/testing_browser_process.h" | 5 #include "chrome/test/testing_browser_process.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "chrome/browser/google/google_url_tracker.h" | 9 #include "chrome/browser/google/google_url_tracker.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 11 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
| 12 #include "chrome/browser/policy/configuration_policy_provider.h" | 12 #include "chrome/browser/policy/configuration_policy_provider.h" |
| 13 #include "chrome/browser/policy/configuration_policy_provider_keeper.h" | 13 #include "chrome/browser/policy/configuration_policy_provider_keeper.h" |
| 14 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" | 14 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" |
| 15 #include "ui/base/clipboard/clipboard.h" | 15 #include "ui/base/clipboard/clipboard.h" |
| 16 | 16 |
| 17 TestingBrowserProcess::TestingBrowserProcess() | 17 TestingBrowserProcess::TestingBrowserProcess() |
| 18 : shutdown_event_(new base::WaitableEvent(true, false)), | 18 : shutdown_event_(new base::WaitableEvent(true, false)), |
| 19 module_ref_count_(0), | 19 module_ref_count_(0), |
| 20 app_locale_("en"), | 20 app_locale_("en"), |
| 21 pref_service_(NULL), | 21 pref_service_(NULL), |
| 22 created_configuration_policy_provider_keeper_(false) { | 22 created_configuration_policy_provider_keeper_(false) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 TestingBrowserProcess::~TestingBrowserProcess() { | 25 TestingBrowserProcess::~TestingBrowserProcess() { |
| 26 pref_proxy_config_tracker_ = NULL; |
| 26 } | 27 } |
| 27 | 28 |
| 28 void TestingBrowserProcess::EndSession() { | 29 void TestingBrowserProcess::EndSession() { |
| 29 } | 30 } |
| 30 | 31 |
| 31 ResourceDispatcherHost* TestingBrowserProcess::resource_dispatcher_host() { | 32 ResourceDispatcherHost* TestingBrowserProcess::resource_dispatcher_host() { |
| 32 return NULL; | 33 return NULL; |
| 33 } | 34 } |
| 34 | 35 |
| 35 MetricsService* TestingBrowserProcess::metrics_service() { | 36 MetricsService* TestingBrowserProcess::metrics_service() { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 102 |
| 102 TabCloseableStateWatcher* TestingBrowserProcess::tab_closeable_state_watcher() { | 103 TabCloseableStateWatcher* TestingBrowserProcess::tab_closeable_state_watcher() { |
| 103 return NULL; | 104 return NULL; |
| 104 } | 105 } |
| 105 | 106 |
| 106 safe_browsing::ClientSideDetectionService* | 107 safe_browsing::ClientSideDetectionService* |
| 107 TestingBrowserProcess::safe_browsing_detection_service() { | 108 TestingBrowserProcess::safe_browsing_detection_service() { |
| 108 return NULL; | 109 return NULL; |
| 109 } | 110 } |
| 110 | 111 |
| 112 PrefProxyConfigTracker* TestingBrowserProcess::pref_proxy_config_tracker() { |
| 113 if (!pref_proxy_config_tracker_.get()) { |
| 114 pref_proxy_config_tracker_ = |
| 115 new PrefProxyConfigTracker(local_state()); |
| 116 } |
| 117 return pref_proxy_config_tracker_.get(); |
| 118 } |
| 119 |
| 120 URLRequestContextGetter* TestingBrowserProcess::system_request_context() { |
| 121 return NULL; |
| 122 } |
| 123 |
| 111 ui::Clipboard* TestingBrowserProcess::clipboard() { | 124 ui::Clipboard* TestingBrowserProcess::clipboard() { |
| 112 if (!clipboard_.get()) { | 125 if (!clipboard_.get()) { |
| 113 // Note that we need a MessageLoop for the next call to work. | 126 // Note that we need a MessageLoop for the next call to work. |
| 114 clipboard_.reset(new ui::Clipboard); | 127 clipboard_.reset(new ui::Clipboard); |
| 115 } | 128 } |
| 116 return clipboard_.get(); | 129 return clipboard_.get(); |
| 117 } | 130 } |
| 118 | 131 |
| 119 NotificationUIManager* TestingBrowserProcess::notification_ui_manager() { | 132 NotificationUIManager* TestingBrowserProcess::notification_ui_manager() { |
| 120 return NULL; | 133 return NULL; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 198 } |
| 186 | 199 |
| 187 void TestingBrowserProcess::SetPrefService(PrefService* pref_service) { | 200 void TestingBrowserProcess::SetPrefService(PrefService* pref_service) { |
| 188 pref_service_ = pref_service; | 201 pref_service_ = pref_service; |
| 189 } | 202 } |
| 190 | 203 |
| 191 void TestingBrowserProcess::SetGoogleURLTracker( | 204 void TestingBrowserProcess::SetGoogleURLTracker( |
| 192 GoogleURLTracker* google_url_tracker) { | 205 GoogleURLTracker* google_url_tracker) { |
| 193 google_url_tracker_.reset(google_url_tracker); | 206 google_url_tracker_.reset(google_url_tracker); |
| 194 } | 207 } |
| OLD | NEW |