| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 #if !defined(OS_IOS) | 310 #if !defined(OS_IOS) |
| 311 bookmark_prompt_controller_.reset(controller); | 311 bookmark_prompt_controller_.reset(controller); |
| 312 #endif | 312 #endif |
| 313 } | 313 } |
| 314 | 314 |
| 315 void TestingBrowserProcess::SetSystemRequestContext( | 315 void TestingBrowserProcess::SetSystemRequestContext( |
| 316 net::URLRequestContextGetter* context_getter) { | 316 net::URLRequestContextGetter* context_getter) { |
| 317 system_request_context_ = context_getter; | 317 system_request_context_ = context_getter; |
| 318 } | 318 } |
| 319 | 319 |
| 320 void TestingBrowserProcess::SetLocalState(PrefService* local_state) { | 320 void TestingBrowserProcess::SetLocalState(PrefServiceSimple* local_state) { |
| 321 if (!local_state) { | 321 if (!local_state) { |
| 322 // The local_state_ PrefService is owned outside of TestingBrowserProcess, | 322 // The local_state_ PrefService is owned outside of TestingBrowserProcess, |
| 323 // but some of the members of TestingBrowserProcess hold references to it | 323 // but some of the members of TestingBrowserProcess hold references to it |
| 324 // (for example, via PrefNotifier members). But given our test | 324 // (for example, via PrefNotifier members). But given our test |
| 325 // infrastructure which tears down individual tests before freeing the | 325 // infrastructure which tears down individual tests before freeing the |
| 326 // TestingBrowserProcess, there's not a good way to make local_state outlive | 326 // TestingBrowserProcess, there's not a good way to make local_state outlive |
| 327 // these dependencies. As a workaround, whenever local_state_ is cleared | 327 // these dependencies. As a workaround, whenever local_state_ is cleared |
| 328 // (assumedly as part of exiting the test and freeing TestingBrowserProcess) | 328 // (assumedly as part of exiting the test and freeing TestingBrowserProcess) |
| 329 // any components owned by TestingBrowserProcess that depend on local_state | 329 // any components owned by TestingBrowserProcess that depend on local_state |
| 330 // are also freed. | 330 // are also freed. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 353 #endif | 353 #endif |
| 354 } | 354 } |
| 355 | 355 |
| 356 void TestingBrowserProcess::SetSafeBrowsingService( | 356 void TestingBrowserProcess::SetSafeBrowsingService( |
| 357 SafeBrowsingService* sb_service) { | 357 SafeBrowsingService* sb_service) { |
| 358 #if !defined(OS_IOS) | 358 #if !defined(OS_IOS) |
| 359 NOTIMPLEMENTED(); | 359 NOTIMPLEMENTED(); |
| 360 sb_service_ = sb_service; | 360 sb_service_ = sb_service; |
| 361 #endif | 361 #endif |
| 362 } | 362 } |
| OLD | NEW |