OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/testing_browser_process.h" | 5 #include "chrome/test/base/testing_browser_process.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return profile_manager_.get(); | 75 return profile_manager_.get(); |
76 #endif | 76 #endif |
77 } | 77 } |
78 | 78 |
79 void TestingBrowserProcess::SetProfileManager(ProfileManager* profile_manager) { | 79 void TestingBrowserProcess::SetProfileManager(ProfileManager* profile_manager) { |
80 #if !defined(OS_IOS) | 80 #if !defined(OS_IOS) |
81 profile_manager_.reset(profile_manager); | 81 profile_manager_.reset(profile_manager); |
82 #endif | 82 #endif |
83 } | 83 } |
84 | 84 |
85 PrefService* TestingBrowserProcess::local_state() { | 85 PrefServiceSimple* TestingBrowserProcess::local_state() { |
86 return local_state_; | 86 return local_state_; |
87 } | 87 } |
88 | 88 |
89 chrome_variations::VariationsService* | 89 chrome_variations::VariationsService* |
90 TestingBrowserProcess::variations_service() { | 90 TestingBrowserProcess::variations_service() { |
91 return NULL; | 91 return NULL; |
92 } | 92 } |
93 | 93 |
94 policy::BrowserPolicyConnector* | 94 policy::BrowserPolicyConnector* |
95 TestingBrowserProcess::browser_policy_connector() { | 95 TestingBrowserProcess::browser_policy_connector() { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 #if !defined(OS_IOS) | 311 #if !defined(OS_IOS) |
312 bookmark_prompt_controller_.reset(controller); | 312 bookmark_prompt_controller_.reset(controller); |
313 #endif | 313 #endif |
314 } | 314 } |
315 | 315 |
316 void TestingBrowserProcess::SetSystemRequestContext( | 316 void TestingBrowserProcess::SetSystemRequestContext( |
317 net::URLRequestContextGetter* context_getter) { | 317 net::URLRequestContextGetter* context_getter) { |
318 system_request_context_ = context_getter; | 318 system_request_context_ = context_getter; |
319 } | 319 } |
320 | 320 |
321 void TestingBrowserProcess::SetLocalState(PrefService* local_state) { | 321 void TestingBrowserProcess::SetLocalState(PrefServiceSimple* local_state) { |
322 if (!local_state) { | 322 if (!local_state) { |
323 // The local_state_ PrefService is owned outside of TestingBrowserProcess, | 323 // The local_state_ PrefService is owned outside of TestingBrowserProcess, |
324 // but some of the members of TestingBrowserProcess hold references to it | 324 // but some of the members of TestingBrowserProcess hold references to it |
325 // (for example, via PrefNotifier members). But given our test | 325 // (for example, via PrefNotifier members). But given our test |
326 // infrastructure which tears down individual tests before freeing the | 326 // infrastructure which tears down individual tests before freeing the |
327 // TestingBrowserProcess, there's not a good way to make local_state outlive | 327 // TestingBrowserProcess, there's not a good way to make local_state outlive |
328 // these dependencies. As a workaround, whenever local_state_ is cleared | 328 // these dependencies. As a workaround, whenever local_state_ is cleared |
329 // (assumedly as part of exiting the test and freeing TestingBrowserProcess) | 329 // (assumedly as part of exiting the test and freeing TestingBrowserProcess) |
330 // any components owned by TestingBrowserProcess that depend on local_state | 330 // any components owned by TestingBrowserProcess that depend on local_state |
331 // are also freed. | 331 // are also freed. |
(...skipping 22 matching lines...) Expand all Loading... |
354 #endif | 354 #endif |
355 } | 355 } |
356 | 356 |
357 void TestingBrowserProcess::SetSafeBrowsingService( | 357 void TestingBrowserProcess::SetSafeBrowsingService( |
358 SafeBrowsingService* sb_service) { | 358 SafeBrowsingService* sb_service) { |
359 #if !defined(OS_IOS) | 359 #if !defined(OS_IOS) |
360 NOTIMPLEMENTED(); | 360 NOTIMPLEMENTED(); |
361 sb_service_ = sb_service; | 361 sb_service_ = sb_service; |
362 #endif | 362 #endif |
363 } | 363 } |
OLD | NEW |