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/provider/chrome/browser/test_chrome_browser_provider.h" | 5 #include "ios/public/provider/chrome/browser/test_chrome_browser_provider.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "ios/public/provider/chrome/browser/distribution/test_app_distribution_
provider.h" | 12 #include "ios/public/provider/chrome/browser/distribution/test_app_distribution_
provider.h" |
13 #include "ios/public/provider/chrome/browser/images/test_branded_image_provider.
h" | 13 #include "ios/public/provider/chrome/browser/images/test_branded_image_provider.
h" |
14 #include "ios/public/provider/chrome/browser/omaha/test_omaha_service_provider.h
" | 14 #include "ios/public/provider/chrome/browser/omaha/test_omaha_service_provider.h
" |
15 #include "ios/public/provider/chrome/browser/sessions/test_live_tab_context_prov
ider.h" | |
16 #include "ios/public/provider/chrome/browser/sessions/test_synced_window_delegat
es_getter.h" | 15 #include "ios/public/provider/chrome/browser/sessions/test_synced_window_delegat
es_getter.h" |
17 #include "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service
.h" | 16 #include "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service
.h" |
18 #include "ios/public/provider/chrome/browser/signin/test_signin_resources_provid
er.h" | 17 #include "ios/public/provider/chrome/browser/signin/test_signin_resources_provid
er.h" |
19 #import "ios/public/provider/chrome/browser/spotlight/test_spotlight_provider.h" | 18 #import "ios/public/provider/chrome/browser/spotlight/test_spotlight_provider.h" |
20 #import "ios/public/provider/chrome/browser/ui/test_styled_text_field.h" | 19 #import "ios/public/provider/chrome/browser/ui/test_styled_text_field.h" |
21 #import "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_pro
vider.h" | 20 #import "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_pro
vider.h" |
22 #import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h" | 21 #import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h" |
23 #import "ios/public/provider/chrome/browser/voice/voice_search_language.h" | 22 #import "ios/public/provider/chrome/browser/voice/voice_search_language.h" |
24 | 23 |
25 namespace ios { | 24 namespace ios { |
26 | 25 |
27 TestChromeBrowserProvider::TestChromeBrowserProvider() | 26 TestChromeBrowserProvider::TestChromeBrowserProvider() |
28 : app_distribution_provider_( | 27 : app_distribution_provider_( |
29 base::MakeUnique<TestAppDistributionProvider>()), | 28 base::MakeUnique<TestAppDistributionProvider>()), |
30 branded_image_provider_(base::MakeUnique<TestBrandedImageProvider>()), | 29 branded_image_provider_(base::MakeUnique<TestBrandedImageProvider>()), |
31 live_tab_context_provider_( | |
32 base::MakeUnique<TestLiveTabContextProvider>()), | |
33 omaha_service_provider_(base::MakeUnique<TestOmahaServiceProvider>()), | 30 omaha_service_provider_(base::MakeUnique<TestOmahaServiceProvider>()), |
34 signin_resources_provider_( | 31 signin_resources_provider_( |
35 base::MakeUnique<TestSigninResourcesProvider>()), | 32 base::MakeUnique<TestSigninResourcesProvider>()), |
36 voice_search_provider_(base::MakeUnique<TestVoiceSearchProvider>()), | 33 voice_search_provider_(base::MakeUnique<TestVoiceSearchProvider>()), |
37 user_feedback_provider_(base::MakeUnique<TestUserFeedbackProvider>()), | 34 user_feedback_provider_(base::MakeUnique<TestUserFeedbackProvider>()), |
38 spotlight_provider_(base::MakeUnique<TestSpotlightProvider>()) {} | 35 spotlight_provider_(base::MakeUnique<TestSpotlightProvider>()) {} |
39 | 36 |
40 TestChromeBrowserProvider::~TestChromeBrowserProvider() {} | 37 TestChromeBrowserProvider::~TestChromeBrowserProvider() {} |
41 | 38 |
42 // static | 39 // static |
(...skipping 13 matching lines...) Expand all Loading... |
56 chrome_identity_service_.swap(service); | 53 chrome_identity_service_.swap(service); |
57 } | 54 } |
58 | 55 |
59 ChromeIdentityService* TestChromeBrowserProvider::GetChromeIdentityService() { | 56 ChromeIdentityService* TestChromeBrowserProvider::GetChromeIdentityService() { |
60 if (!chrome_identity_service_) { | 57 if (!chrome_identity_service_) { |
61 chrome_identity_service_.reset(new FakeChromeIdentityService()); | 58 chrome_identity_service_.reset(new FakeChromeIdentityService()); |
62 } | 59 } |
63 return chrome_identity_service_.get(); | 60 return chrome_identity_service_.get(); |
64 } | 61 } |
65 | 62 |
66 LiveTabContextProvider* TestChromeBrowserProvider::GetLiveTabContextProvider() { | |
67 return live_tab_context_provider_.get(); | |
68 } | |
69 | |
70 UITextField<TextFieldStyling>* TestChromeBrowserProvider::CreateStyledTextField( | 63 UITextField<TextFieldStyling>* TestChromeBrowserProvider::CreateStyledTextField( |
71 CGRect frame) const { | 64 CGRect frame) const { |
72 return [[TestStyledTextField alloc] initWithFrame:frame]; | 65 return [[TestStyledTextField alloc] initWithFrame:frame]; |
73 } | 66 } |
74 | 67 |
75 VoiceSearchProvider* TestChromeBrowserProvider::GetVoiceSearchProvider() const { | 68 VoiceSearchProvider* TestChromeBrowserProvider::GetVoiceSearchProvider() const { |
76 return voice_search_provider_.get(); | 69 return voice_search_provider_.get(); |
77 } | 70 } |
78 | 71 |
79 AppDistributionProvider* TestChromeBrowserProvider::GetAppDistributionProvider() | 72 AppDistributionProvider* TestChromeBrowserProvider::GetAppDistributionProvider() |
(...skipping 25 matching lines...) Expand all Loading... |
105 const { | 98 const { |
106 return branded_image_provider_.get(); | 99 return branded_image_provider_.get(); |
107 } | 100 } |
108 | 101 |
109 id<NativeAppWhitelistManager> | 102 id<NativeAppWhitelistManager> |
110 TestChromeBrowserProvider::GetNativeAppWhitelistManager() const { | 103 TestChromeBrowserProvider::GetNativeAppWhitelistManager() const { |
111 return nil; | 104 return nil; |
112 } | 105 } |
113 | 106 |
114 } // namespace ios | 107 } // namespace ios |
OLD | NEW |