| 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" | 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" | 16 #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" | 17 #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" | 18 #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" | 19 #import "ios/public/provider/chrome/browser/spotlight/test_spotlight_provider.h" |
| 20 #import "ios/public/provider/chrome/browser/ui/test_infobar_view.h" | |
| 21 #import "ios/public/provider/chrome/browser/ui/test_styled_text_field.h" | 20 #import "ios/public/provider/chrome/browser/ui/test_styled_text_field.h" |
| 22 #import "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_pro
vider.h" | 21 #import "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_pro
vider.h" |
| 23 #import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h" | 22 #import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h" |
| 24 #import "ios/public/provider/chrome/browser/voice/voice_search_language.h" | 23 #import "ios/public/provider/chrome/browser/voice/voice_search_language.h" |
| 25 | 24 |
| 26 namespace ios { | 25 namespace ios { |
| 27 | 26 |
| 28 TestChromeBrowserProvider::TestChromeBrowserProvider() | 27 TestChromeBrowserProvider::TestChromeBrowserProvider() |
| 29 : app_distribution_provider_( | 28 : app_distribution_provider_( |
| 30 base::MakeUnique<TestAppDistributionProvider>()), | 29 base::MakeUnique<TestAppDistributionProvider>()), |
| 31 branded_image_provider_(base::MakeUnique<TestBrandedImageProvider>()), | 30 branded_image_provider_(base::MakeUnique<TestBrandedImageProvider>()), |
| 32 live_tab_context_provider_( | 31 live_tab_context_provider_( |
| 33 base::MakeUnique<TestLiveTabContextProvider>()), | 32 base::MakeUnique<TestLiveTabContextProvider>()), |
| 34 omaha_service_provider_(base::MakeUnique<TestOmahaServiceProvider>()), | 33 omaha_service_provider_(base::MakeUnique<TestOmahaServiceProvider>()), |
| 35 signin_resources_provider_( | 34 signin_resources_provider_( |
| 36 base::MakeUnique<TestSigninResourcesProvider>()), | 35 base::MakeUnique<TestSigninResourcesProvider>()), |
| 37 voice_search_provider_(base::MakeUnique<TestVoiceSearchProvider>()), | 36 voice_search_provider_(base::MakeUnique<TestVoiceSearchProvider>()), |
| 38 user_feedback_provider_(base::MakeUnique<TestUserFeedbackProvider>()), | 37 user_feedback_provider_(base::MakeUnique<TestUserFeedbackProvider>()), |
| 39 spotlight_provider_(base::MakeUnique<TestSpotlightProvider>()) {} | 38 spotlight_provider_(base::MakeUnique<TestSpotlightProvider>()) {} |
| 40 | 39 |
| 41 TestChromeBrowserProvider::~TestChromeBrowserProvider() {} | 40 TestChromeBrowserProvider::~TestChromeBrowserProvider() {} |
| 42 | 41 |
| 43 // static | 42 // static |
| 44 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() { | 43 TestChromeBrowserProvider* TestChromeBrowserProvider::GetTestProvider() { |
| 45 ChromeBrowserProvider* provider = GetChromeBrowserProvider(); | 44 ChromeBrowserProvider* provider = GetChromeBrowserProvider(); |
| 46 DCHECK(provider); | 45 DCHECK(provider); |
| 47 return static_cast<TestChromeBrowserProvider*>(provider); | 46 return static_cast<TestChromeBrowserProvider*>(provider); |
| 48 } | 47 } |
| 49 | 48 |
| 50 InfoBarViewPlaceholder TestChromeBrowserProvider::CreateInfoBarView( | |
| 51 CGRect frame, | |
| 52 InfoBarViewDelegate* delegate) { | |
| 53 return [[TestInfoBarView alloc] init]; | |
| 54 } | |
| 55 | |
| 56 SigninResourcesProvider* | 49 SigninResourcesProvider* |
| 57 TestChromeBrowserProvider::GetSigninResourcesProvider() { | 50 TestChromeBrowserProvider::GetSigninResourcesProvider() { |
| 58 return signin_resources_provider_.get(); | 51 return signin_resources_provider_.get(); |
| 59 } | 52 } |
| 60 | 53 |
| 61 void TestChromeBrowserProvider::SetChromeIdentityServiceForTesting( | 54 void TestChromeBrowserProvider::SetChromeIdentityServiceForTesting( |
| 62 std::unique_ptr<ChromeIdentityService> service) { | 55 std::unique_ptr<ChromeIdentityService> service) { |
| 63 chrome_identity_service_.swap(service); | 56 chrome_identity_service_.swap(service); |
| 64 } | 57 } |
| 65 | 58 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const { | 105 const { |
| 113 return branded_image_provider_.get(); | 106 return branded_image_provider_.get(); |
| 114 } | 107 } |
| 115 | 108 |
| 116 id<NativeAppWhitelistManager> | 109 id<NativeAppWhitelistManager> |
| 117 TestChromeBrowserProvider::GetNativeAppWhitelistManager() const { | 110 TestChromeBrowserProvider::GetNativeAppWhitelistManager() const { |
| 118 return nil; | 111 return nil; |
| 119 } | 112 } |
| 120 | 113 |
| 121 } // namespace ios | 114 } // namespace ios |
| OLD | NEW |