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

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: Some cleanup. 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/cloud_policy_cache_base.h"
13 #include "chrome/browser/policy/cloud_policy_provider.h"
12 #include "chrome/browser/policy/configuration_policy_pref_store.h" 14 #include "chrome/browser/policy/configuration_policy_pref_store.h"
13 #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/prerender/prerender_tracker.h" 17 #include "chrome/browser/prerender/prerender_tracker.h"
17 #include "chrome/browser/printing/background_printing_manager.h" 18 #include "chrome/browser/printing/background_printing_manager.h"
18 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
19 #include "net/url_request/url_request_context_getter.h" 20 #include "net/url_request/url_request_context_getter.h"
20 #include "ui/base/clipboard/clipboard.h" 21 #include "ui/base/clipboard/clipboard.h"
21 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
22 23
23 TestingBrowserProcess::TestingBrowserProcess() 24 TestingBrowserProcess::TestingBrowserProcess()
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 89
89 policy::BrowserPolicyConnector* 90 policy::BrowserPolicyConnector*
90 TestingBrowserProcess::browser_policy_connector() { 91 TestingBrowserProcess::browser_policy_connector() {
91 if (!browser_policy_connector_.get()) { 92 if (!browser_policy_connector_.get()) {
92 const policy::ConfigurationPolicyProvider::PolicyDefinitionList* 93 const policy::ConfigurationPolicyProvider::PolicyDefinitionList*
93 policy_list = policy::ConfigurationPolicyPrefStore:: 94 policy_list = policy::ConfigurationPolicyPrefStore::
94 GetChromePolicyDefinitionList(); 95 GetChromePolicyDefinitionList();
95 browser_policy_connector_.reset( 96 browser_policy_connector_.reset(
96 new policy::BrowserPolicyConnector( 97 new policy::BrowserPolicyConnector(
97 new policy::DummyConfigurationPolicyProvider(policy_list), 98 new policy::DummyConfigurationPolicyProvider(policy_list),
98 new policy::DummyConfigurationPolicyProvider(policy_list))); 99 new policy::DummyConfigurationPolicyProvider(policy_list),
100 new policy::CloudPolicyProvider(policy_list,
101 policy::CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY),
102 new policy::CloudPolicyProvider(policy_list,
103 policy::CloudPolicyCacheBase::POLICY_LEVEL_RECOMMENDED)));
104
99 } 105 }
100 return browser_policy_connector_.get(); 106 return browser_policy_connector_.get();
101 } 107 }
102 108
103 IconManager* TestingBrowserProcess::icon_manager() { 109 IconManager* TestingBrowserProcess::icon_manager() {
104 return NULL; 110 return NULL;
105 } 111 }
106 112
107 ThumbnailGenerator* TestingBrowserProcess::GetThumbnailGenerator() { 113 ThumbnailGenerator* TestingBrowserProcess::GetThumbnailGenerator() {
108 return NULL; 114 return NULL;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 277
272 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { 278 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() {
273 DCHECK_EQ(browser_process_.get(), g_browser_process); 279 DCHECK_EQ(browser_process_.get(), g_browser_process);
274 280
275 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. 281 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062.
276 // After the transition is over, we should just 282 // After the transition is over, we should just
277 // reset |g_browser_process| to NULL. 283 // reset |g_browser_process| to NULL.
278 browser_process_.reset(); 284 browser_process_.reset();
279 g_browser_process = new TestingBrowserProcess(); 285 g_browser_process = new TestingBrowserProcess();
280 } 286 }
OLDNEW
« chrome/browser/policy/profile_policy_connector.h ('K') | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698