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" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 return NULL; | 230 return NULL; |
231 } | 231 } |
232 | 232 |
233 prerender::PrerenderTracker* TestingBrowserProcess::prerender_tracker() { | 233 prerender::PrerenderTracker* TestingBrowserProcess::prerender_tracker() { |
234 if (!prerender_tracker_.get()) | 234 if (!prerender_tracker_.get()) |
235 prerender_tracker_.reset(new prerender::PrerenderTracker()); | 235 prerender_tracker_.reset(new prerender::PrerenderTracker()); |
236 return prerender_tracker_.get(); | 236 return prerender_tracker_.get(); |
237 } | 237 } |
238 | 238 |
239 void TestingBrowserProcess::SetLocalState(PrefService* local_state) { | 239 void TestingBrowserProcess::SetLocalState(PrefService* local_state) { |
240 if (!local_state && notification_ui_manager_.get()) | |
241 notification_ui_manager_.reset(); // Used local_state_. | |
Scott Hess - ex-Googler
2011/06/08 16:43:43
Wouldn't this (potentially) apply in any case wher
jam
2011/06/08 16:48:27
I thought about trying to add fancier checks initi
| |
240 local_state_ = local_state; | 242 local_state_ = local_state; |
241 } | 243 } |
242 | 244 |
243 void TestingBrowserProcess::SetGoogleURLTracker( | 245 void TestingBrowserProcess::SetGoogleURLTracker( |
244 GoogleURLTracker* google_url_tracker) { | 246 GoogleURLTracker* google_url_tracker) { |
245 google_url_tracker_.reset(google_url_tracker); | 247 google_url_tracker_.reset(google_url_tracker); |
246 } | 248 } |
247 | 249 |
248 ScopedTestingBrowserProcess::ScopedTestingBrowserProcess() { | 250 ScopedTestingBrowserProcess::ScopedTestingBrowserProcess() { |
249 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 251 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
(...skipping 10 matching lines...) Expand all Loading... | |
260 | 262 |
261 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { | 263 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { |
262 DCHECK_EQ(browser_process_.get(), g_browser_process); | 264 DCHECK_EQ(browser_process_.get(), g_browser_process); |
263 | 265 |
264 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 266 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
265 // After the transition is over, we should just | 267 // After the transition is over, we should just |
266 // reset |g_browser_process| to NULL. | 268 // reset |g_browser_process| to NULL. |
267 browser_process_.reset(); | 269 browser_process_.reset(); |
268 g_browser_process = new TestingBrowserProcess(); | 270 g_browser_process = new TestingBrowserProcess(); |
269 } | 271 } |
OLD | NEW |