| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ios/public/test/test_chrome_browser_provider.h" | 5 #include "ios/public/test/test_chrome_browser_provider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" | 8 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" |
| 9 #include "ios/public/test/fake_string_provider.h" | 9 #include "ios/public/test/fake_string_provider.h" |
| 10 #import "ios/public/test/test_updatable_resource_provider.h" |
| 10 | 11 |
| 11 namespace ios { | 12 namespace ios { |
| 12 | 13 |
| 13 TestChromeBrowserProvider::TestChromeBrowserProvider() | 14 TestChromeBrowserProvider::TestChromeBrowserProvider() |
| 14 : chrome_identity_service_(new ios::ChromeIdentityService), | 15 : chrome_identity_service_(new ios::ChromeIdentityService), |
| 15 string_provider_(new FakeStringProvider) {} | 16 string_provider_(new FakeStringProvider), |
| 17 test_updatable_resource_provider_(new TestUpdatableResourceProvider) {} |
| 16 | 18 |
| 17 TestChromeBrowserProvider::~TestChromeBrowserProvider() { | 19 TestChromeBrowserProvider::~TestChromeBrowserProvider() { |
| 18 } | 20 } |
| 19 | 21 |
| 20 // static | 22 // static |
| 21 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() { | 23 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() { |
| 22 ChromeBrowserProvider* provider = GetChromeBrowserProvider(); | 24 ChromeBrowserProvider* provider = GetChromeBrowserProvider(); |
| 23 DCHECK(provider); | 25 DCHECK(provider); |
| 24 return static_cast<TestChromeBrowserProvider*>(provider); | 26 return static_cast<TestChromeBrowserProvider*>(provider); |
| 25 } | 27 } |
| 26 | 28 |
| 27 ChromeIdentityService* TestChromeBrowserProvider::GetChromeIdentityService() { | 29 ChromeIdentityService* TestChromeBrowserProvider::GetChromeIdentityService() { |
| 28 return chrome_identity_service_.get(); | 30 return chrome_identity_service_.get(); |
| 29 } | 31 } |
| 30 | 32 |
| 31 StringProvider* TestChromeBrowserProvider::GetStringProvider() { | 33 StringProvider* TestChromeBrowserProvider::GetStringProvider() { |
| 32 return string_provider_.get(); | 34 return string_provider_.get(); |
| 33 } | 35 } |
| 34 | 36 |
| 37 UpdatableResourceProvider* |
| 38 TestChromeBrowserProvider::GetUpdatableResourceProvider() { |
| 39 return test_updatable_resource_provider_.get(); |
| 40 } |
| 41 |
| 35 FakeStringProvider* | 42 FakeStringProvider* |
| 36 TestChromeBrowserProvider::GetStringProviderAsFake() { | 43 TestChromeBrowserProvider::GetStringProviderAsFake() { |
| 37 return string_provider_.get(); | 44 return string_provider_.get(); |
| 38 } | 45 } |
| 39 | 46 |
| 40 } // namespace ios | 47 } // namespace ios |
| OLD | NEW |