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

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

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 // An implementation of BrowserProcess for unit tests that fails for most 5 // An implementation of BrowserProcess for unit tests that fails for most
6 // services. By preventing creation of services, we reduce dependencies and 6 // services. By preventing creation of services, we reduce dependencies and
7 // keep the profile clean. Clients of this class must handle the NULL return 7 // keep the profile clean. Clients of this class must handle the NULL return
8 // value, however. 8 // value, however.
9 9
10 #ifndef CHROME_TEST_TESTING_BROWSER_PROCESS_H_ 10 #ifndef CHROME_TEST_TESTING_BROWSER_PROCESS_H_
(...skipping 12 matching lines...) Expand all
23 class NotificationUIManager; 23 class NotificationUIManager;
24 class PrefService; 24 class PrefService;
25 class WatchDogThread; 25 class WatchDogThread;
26 26
27 namespace base { 27 namespace base {
28 class WaitableEvent; 28 class WaitableEvent;
29 } 29 }
30 30
31 namespace policy { 31 namespace policy {
32 class BrowserPolicyConnector; 32 class BrowserPolicyConnector;
33 class UserPolicyConnector;
34 class ConfigurationPolicyProvider;
33 } 35 }
34 36
35 namespace ui { 37 namespace ui {
36 class Clipboard; 38 class Clipboard;
37 } 39 }
38 40
39 class TestingBrowserProcess : public BrowserProcess { 41 class TestingBrowserProcess : public BrowserProcess {
40 public: 42 public:
41 TestingBrowserProcess(); 43 TestingBrowserProcess();
42 virtual ~TestingBrowserProcess(); 44 virtual ~TestingBrowserProcess();
(...skipping 23 matching lines...) Expand all
66 #if defined(OS_CHROMEOS) 68 #if defined(OS_CHROMEOS)
67 virtual base::Thread* web_socket_proxy_thread(); 69 virtual base::Thread* web_socket_proxy_thread();
68 #endif 70 #endif
69 71
70 virtual ProfileManager* profile_manager(); 72 virtual ProfileManager* profile_manager();
71 73
72 virtual PrefService* local_state(); 74 virtual PrefService* local_state();
73 75
74 virtual policy::BrowserPolicyConnector* browser_policy_connector(); 76 virtual policy::BrowserPolicyConnector* browser_policy_connector();
75 77
78 virtual policy::UserPolicyConnector* user_policy_connector();
79
80 virtual policy::ConfigurationPolicyProvider* managed_cloud_policy_provider();
81
82 virtual policy::ConfigurationPolicyProvider*
83 recommended_cloud_policy_provider();
84
76 virtual IconManager* icon_manager(); 85 virtual IconManager* icon_manager();
77 86
78 virtual ThumbnailGenerator* GetThumbnailGenerator(); 87 virtual ThumbnailGenerator* GetThumbnailGenerator();
79 88
80 virtual DevToolsManager* devtools_manager(); 89 virtual DevToolsManager* devtools_manager();
81 90
82 virtual SidebarManager* sidebar_manager(); 91 virtual SidebarManager* sidebar_manager();
83 92
84 virtual TabCloseableStateWatcher* tab_closeable_state_watcher(); 93 virtual TabCloseableStateWatcher* tab_closeable_state_watcher();
85 94
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 private: 163 private:
155 NotificationService notification_service_; 164 NotificationService notification_service_;
156 scoped_ptr<base::WaitableEvent> shutdown_event_; 165 scoped_ptr<base::WaitableEvent> shutdown_event_;
157 unsigned int module_ref_count_; 166 unsigned int module_ref_count_;
158 scoped_ptr<ui::Clipboard> clipboard_; 167 scoped_ptr<ui::Clipboard> clipboard_;
159 std::string app_locale_; 168 std::string app_locale_;
160 169
161 // Weak pointer. 170 // Weak pointer.
162 PrefService* local_state_; 171 PrefService* local_state_;
163 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; 172 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_;
173 scoped_ptr<policy::UserPolicyConnector> user_policy_connector_;
174 scoped_ptr<policy::ConfigurationPolicyProvider>
175 managed_cloud_policy_provider_;
Joao da Silva 2011/05/31 14:50:23 Nit: indent?
sfeuz 2011/06/03 08:30:35 Obsolete.
176 scoped_ptr<policy::ConfigurationPolicyProvider>
177 recommended_cloud_policy_provider_;
164 scoped_ptr<GoogleURLTracker> google_url_tracker_; 178 scoped_ptr<GoogleURLTracker> google_url_tracker_;
165 scoped_ptr<ProfileManager> profile_manager_; 179 scoped_ptr<ProfileManager> profile_manager_;
166 scoped_ptr<NotificationUIManager> notification_ui_manager_; 180 scoped_ptr<NotificationUIManager> notification_ui_manager_;
167 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; 181 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_;
168 182
169 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); 183 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess);
170 }; 184 };
171 185
172 // Scoper to put a TestingBrowserProcess in |g_browser_process|. 186 // Scoper to put a TestingBrowserProcess in |g_browser_process|.
173 class ScopedTestingBrowserProcess { 187 class ScopedTestingBrowserProcess {
174 public: 188 public:
175 ScopedTestingBrowserProcess(); 189 ScopedTestingBrowserProcess();
176 ~ScopedTestingBrowserProcess(); 190 ~ScopedTestingBrowserProcess();
177 191
178 TestingBrowserProcess* get() { 192 TestingBrowserProcess* get() {
179 return browser_process_.get(); 193 return browser_process_.get();
180 } 194 }
181 195
182 private: 196 private:
183 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. 197 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062.
184 // After the transition is over, we should just stack-allocate it. 198 // After the transition is over, we should just stack-allocate it.
185 scoped_ptr<TestingBrowserProcess> browser_process_; 199 scoped_ptr<TestingBrowserProcess> browser_process_;
186 200
187 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); 201 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess);
188 }; 202 };
189 203
190 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ 204 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698