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/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/configuration_policy_pref_store.h" | 12 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
13 #include "chrome/browser/policy/configuration_policy_provider.h" | 13 #include "chrome/browser/policy/configuration_policy_provider.h" |
14 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" | 14 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" |
15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
| 16 #include "chrome/browser/prerender/prerender_tracker.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 |
22 TestingBrowserProcess::TestingBrowserProcess() | 23 TestingBrowserProcess::TestingBrowserProcess() |
23 : shutdown_event_(new base::WaitableEvent(true, false)), | 24 : shutdown_event_(new base::WaitableEvent(true, false)), |
24 module_ref_count_(0), | 25 module_ref_count_(0), |
25 app_locale_("en"), | 26 app_locale_("en"), |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 230 } |
230 | 231 |
231 bool TestingBrowserProcess::plugin_finder_disabled() const { | 232 bool TestingBrowserProcess::plugin_finder_disabled() const { |
232 return false; | 233 return false; |
233 } | 234 } |
234 | 235 |
235 ChromeNetLog* TestingBrowserProcess::net_log() { | 236 ChromeNetLog* TestingBrowserProcess::net_log() { |
236 return NULL; | 237 return NULL; |
237 } | 238 } |
238 | 239 |
| 240 prerender::PrerenderTracker* TestingBrowserProcess::prerender_tracker() { |
| 241 if (!prerender_tracker_.get()) |
| 242 prerender_tracker_.reset(new prerender::PrerenderTracker()); |
| 243 return prerender_tracker_.get(); |
| 244 } |
| 245 |
239 void TestingBrowserProcess::SetLocalState(PrefService* local_state) { | 246 void TestingBrowserProcess::SetLocalState(PrefService* local_state) { |
240 local_state_ = local_state; | 247 local_state_ = local_state; |
241 } | 248 } |
242 | 249 |
243 void TestingBrowserProcess::SetGoogleURLTracker( | 250 void TestingBrowserProcess::SetGoogleURLTracker( |
244 GoogleURLTracker* google_url_tracker) { | 251 GoogleURLTracker* google_url_tracker) { |
245 google_url_tracker_.reset(google_url_tracker); | 252 google_url_tracker_.reset(google_url_tracker); |
246 } | 253 } |
247 | 254 |
248 ScopedTestingBrowserProcess::ScopedTestingBrowserProcess() { | 255 ScopedTestingBrowserProcess::ScopedTestingBrowserProcess() { |
(...skipping 11 matching lines...) Expand all Loading... |
260 | 267 |
261 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { | 268 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { |
262 DCHECK_EQ(browser_process_.get(), g_browser_process); | 269 DCHECK_EQ(browser_process_.get(), g_browser_process); |
263 | 270 |
264 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 271 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
265 // After the transition is over, we should just | 272 // After the transition is over, we should just |
266 // reset |g_browser_process| to NULL. | 273 // reset |g_browser_process| to NULL. |
267 browser_process_.reset(); | 274 browser_process_.reset(); |
268 g_browser_process = new TestingBrowserProcess(); | 275 g_browser_process = new TestingBrowserProcess(); |
269 } | 276 } |
OLD | NEW |