| 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/browser_policy_connector.h" |
| 11 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 12 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
| 12 #include "chrome/browser/policy/configuration_policy_provider.h" | 13 #include "chrome/browser/policy/configuration_policy_provider.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) { | |
| 23 } | 22 } |
| 24 | 23 |
| 25 TestingBrowserProcess::~TestingBrowserProcess() { | 24 TestingBrowserProcess::~TestingBrowserProcess() { |
| 26 } | 25 } |
| 27 | 26 |
| 28 void TestingBrowserProcess::EndSession() { | 27 void TestingBrowserProcess::EndSession() { |
| 29 } | 28 } |
| 30 | 29 |
| 31 ResourceDispatcherHost* TestingBrowserProcess::resource_dispatcher_host() { | 30 ResourceDispatcherHost* TestingBrowserProcess::resource_dispatcher_host() { |
| 32 return NULL; | 31 return NULL; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 59 } | 58 } |
| 60 | 59 |
| 61 ProfileManager* TestingBrowserProcess::profile_manager() { | 60 ProfileManager* TestingBrowserProcess::profile_manager() { |
| 62 return NULL; | 61 return NULL; |
| 63 } | 62 } |
| 64 | 63 |
| 65 PrefService* TestingBrowserProcess::local_state() { | 64 PrefService* TestingBrowserProcess::local_state() { |
| 66 return pref_service_; | 65 return pref_service_; |
| 67 } | 66 } |
| 68 | 67 |
| 69 policy::ConfigurationPolicyProviderKeeper* | 68 policy::BrowserPolicyConnector* |
| 70 TestingBrowserProcess::configuration_policy_provider_keeper() { | 69 TestingBrowserProcess::browser_policy_connector() { |
| 71 if (!created_configuration_policy_provider_keeper_) { | 70 if (!browser_policy_connector_.get()) { |
| 72 DCHECK(configuration_policy_provider_keeper_.get() == NULL); | |
| 73 created_configuration_policy_provider_keeper_ = true; | |
| 74 const policy::ConfigurationPolicyProvider::PolicyDefinitionList* | 71 const policy::ConfigurationPolicyProvider::PolicyDefinitionList* |
| 75 policy_list = policy::ConfigurationPolicyPrefStore:: | 72 policy_list = policy::ConfigurationPolicyPrefStore:: |
| 76 GetChromePolicyDefinitionList(); | 73 GetChromePolicyDefinitionList(); |
| 77 configuration_policy_provider_keeper_.reset( | 74 browser_policy_connector_.reset( |
| 78 new policy::ConfigurationPolicyProviderKeeper( | 75 new policy::BrowserPolicyConnector( |
| 79 new policy::DummyConfigurationPolicyProvider(policy_list), | |
| 80 new policy::DummyConfigurationPolicyProvider(policy_list), | 76 new policy::DummyConfigurationPolicyProvider(policy_list), |
| 81 new policy::DummyConfigurationPolicyProvider(policy_list))); | 77 new policy::DummyConfigurationPolicyProvider(policy_list))); |
| 82 } | 78 } |
| 83 return configuration_policy_provider_keeper_.get(); | 79 return browser_policy_connector_.get(); |
| 84 } | 80 } |
| 85 | 81 |
| 86 IconManager* TestingBrowserProcess::icon_manager() { | 82 IconManager* TestingBrowserProcess::icon_manager() { |
| 87 return NULL; | 83 return NULL; |
| 88 } | 84 } |
| 89 | 85 |
| 90 ThumbnailGenerator* TestingBrowserProcess::GetThumbnailGenerator() { | 86 ThumbnailGenerator* TestingBrowserProcess::GetThumbnailGenerator() { |
| 91 return NULL; | 87 return NULL; |
| 92 } | 88 } |
| 93 | 89 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 181 } |
| 186 | 182 |
| 187 void TestingBrowserProcess::SetPrefService(PrefService* pref_service) { | 183 void TestingBrowserProcess::SetPrefService(PrefService* pref_service) { |
| 188 pref_service_ = pref_service; | 184 pref_service_ = pref_service; |
| 189 } | 185 } |
| 190 | 186 |
| 191 void TestingBrowserProcess::SetGoogleURLTracker( | 187 void TestingBrowserProcess::SetGoogleURLTracker( |
| 192 GoogleURLTracker* google_url_tracker) { | 188 GoogleURLTracker* google_url_tracker) { |
| 193 google_url_tracker_.reset(google_url_tracker); | 189 google_url_tracker_.reset(google_url_tracker); |
| 194 } | 190 } |
| OLD | NEW |