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/test/fake_search_provider.h" | |
9 #include "ios/public/test/fake_string_provider.h" | 8 #include "ios/public/test/fake_string_provider.h" |
10 | 9 |
11 namespace { | 10 namespace { |
12 const char kUIScheme[] = "uischeme"; | 11 const char kUIScheme[] = "uischeme"; |
13 } | 12 } |
14 | 13 |
15 namespace ios { | 14 namespace ios { |
16 | 15 |
17 TestChromeBrowserProvider::TestChromeBrowserProvider() | 16 TestChromeBrowserProvider::TestChromeBrowserProvider() |
18 : string_provider_(new FakeStringProvider), | 17 : string_provider_(new FakeStringProvider) { |
19 search_provider_(new FakeSearchProvider) { | |
20 } | 18 } |
21 | 19 |
22 TestChromeBrowserProvider::~TestChromeBrowserProvider() { | 20 TestChromeBrowserProvider::~TestChromeBrowserProvider() { |
23 } | 21 } |
24 | 22 |
25 // static | 23 // static |
26 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() { | 24 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() { |
27 ChromeBrowserProvider* provider = GetChromeBrowserProvider(); | 25 ChromeBrowserProvider* provider = GetChromeBrowserProvider(); |
28 DCHECK(provider); | 26 DCHECK(provider); |
29 return static_cast<TestChromeBrowserProvider*>(provider); | 27 return static_cast<TestChromeBrowserProvider*>(provider); |
30 } | 28 } |
31 | 29 |
32 StringProvider* TestChromeBrowserProvider::GetStringProvider() { | 30 StringProvider* TestChromeBrowserProvider::GetStringProvider() { |
33 return string_provider_.get(); | 31 return string_provider_.get(); |
34 } | 32 } |
35 | 33 |
36 const char* TestChromeBrowserProvider::GetChromeUIScheme() { | 34 const char* TestChromeBrowserProvider::GetChromeUIScheme() { |
37 return kUIScheme; | 35 return kUIScheme; |
38 } | 36 } |
39 | 37 |
40 SearchProvider* TestChromeBrowserProvider::GetSearchProvider() { | |
41 return search_provider_.get(); | |
42 } | |
43 | |
44 } // namespace ios | 38 } // namespace ios |
OLD | NEW |