Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: chrome/test/testing_browser_process.cc

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments by mnissler. Added unittest. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/notifications/notification_ui_manager.h" 10 #include "chrome/browser/notifications/notification_ui_manager.h"
11 #include "chrome/browser/policy/browser_policy_connector.h" 11 #include "chrome/browser/policy/browser_policy_connector.h"
12 #include "chrome/browser/policy/user_policy_connector.h"
Joao da Silva 2011/05/31 14:50:23 Nit: alphabetic order.
sfeuz 2011/06/03 08:30:35 Obsolete.
12 #include "chrome/browser/policy/configuration_policy_pref_store.h" 13 #include "chrome/browser/policy/configuration_policy_pref_store.h"
13 #include "chrome/browser/policy/configuration_policy_provider.h" 14 #include "chrome/browser/policy/configuration_policy_provider.h"
14 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" 15 #include "chrome/browser/policy/dummy_configuration_policy_provider.h"
15 #include "chrome/browser/prefs/pref_service.h" 16 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/printing/background_printing_manager.h" 17 #include "chrome/browser/printing/background_printing_manager.h"
17 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
18 #include "net/url_request/url_request_context_getter.h" 19 #include "net/url_request/url_request_context_getter.h"
19 #include "ui/base/clipboard/clipboard.h" 20 #include "ui/base/clipboard/clipboard.h"
20 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
21 22
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 policy_list = policy::ConfigurationPolicyPrefStore:: 97 policy_list = policy::ConfigurationPolicyPrefStore::
97 GetChromePolicyDefinitionList(); 98 GetChromePolicyDefinitionList();
98 browser_policy_connector_.reset( 99 browser_policy_connector_.reset(
99 new policy::BrowserPolicyConnector( 100 new policy::BrowserPolicyConnector(
100 new policy::DummyConfigurationPolicyProvider(policy_list), 101 new policy::DummyConfigurationPolicyProvider(policy_list),
101 new policy::DummyConfigurationPolicyProvider(policy_list))); 102 new policy::DummyConfigurationPolicyProvider(policy_list)));
102 } 103 }
103 return browser_policy_connector_.get(); 104 return browser_policy_connector_.get();
104 } 105 }
105 106
107 policy::UserPolicyConnector*
108 TestingBrowserProcess::user_policy_connector() {
109 if (!user_policy_connector_.get()) {
110 user_policy_connector_.reset(policy::UserPolicyConnector::Create());
111 }
112 return user_policy_connector_.get();
113 }
114
115 policy::ConfigurationPolicyProvider*
116 TestingBrowserProcess::managed_cloud_policy_provider() {
117 if (!managed_cloud_policy_provider_.get()) {
118 const policy::ConfigurationPolicyProvider::PolicyDefinitionList*
119 policy_list = policy::ConfigurationPolicyPrefStore::
120 GetChromePolicyDefinitionList();
Joao da Silva 2011/05/31 14:50:23 Nit: indent.
sfeuz 2011/06/03 08:30:35 Obsolete.
121 managed_cloud_policy_provider_.reset(
122 new policy::DummyConfigurationPolicyProvider(policy_list));
123 }
124 return managed_cloud_policy_provider_.get();
125 }
126
127 policy::ConfigurationPolicyProvider*
128 TestingBrowserProcess::recommended_cloud_policy_provider() {
129 if (!recommended_cloud_policy_provider_.get()) {
130 const policy::ConfigurationPolicyProvider::PolicyDefinitionList*
131 policy_list = policy::ConfigurationPolicyPrefStore::
132 GetChromePolicyDefinitionList();
Joao da Silva 2011/05/31 14:50:23 Nit: indent.
sfeuz 2011/06/03 08:30:35 Obsolete.
133 recommended_cloud_policy_provider_.reset(
134 new policy::DummyConfigurationPolicyProvider(policy_list));
135 }
136 return recommended_cloud_policy_provider_.get();
137 }
138
106 IconManager* TestingBrowserProcess::icon_manager() { 139 IconManager* TestingBrowserProcess::icon_manager() {
107 return NULL; 140 return NULL;
108 } 141 }
109 142
110 ThumbnailGenerator* TestingBrowserProcess::GetThumbnailGenerator() { 143 ThumbnailGenerator* TestingBrowserProcess::GetThumbnailGenerator() {
111 return NULL; 144 return NULL;
112 } 145 }
113 146
114 DevToolsManager* TestingBrowserProcess::devtools_manager() { 147 DevToolsManager* TestingBrowserProcess::devtools_manager() {
115 return NULL; 148 return NULL;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 293
261 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { 294 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() {
262 DCHECK_EQ(browser_process_.get(), g_browser_process); 295 DCHECK_EQ(browser_process_.get(), g_browser_process);
263 296
264 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. 297 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062.
265 // After the transition is over, we should just 298 // After the transition is over, we should just
266 // reset |g_browser_process| to NULL. 299 // reset |g_browser_process| to NULL.
267 browser_process_.reset(); 300 browser_process_.reset();
268 g_browser_process = new TestingBrowserProcess(); 301 g_browser_process = new TestingBrowserProcess();
269 } 302 }
OLDNEW
« chrome/test/testing_browser_process.h ('K') | « chrome/test/testing_browser_process.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698