| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "ios/chrome/browser/providers/chromium_browser_provider.h" | 5 #import "ios/chrome/browser/providers/chromium_browser_provider.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #import "ios/chrome/browser/providers/chromium_logo_controller.h" | 8 #import "ios/chrome/browser/providers/chromium_logo_controller.h" |
| 9 #import "ios/chrome/browser/providers/chromium_voice_search_provider.h" | 9 #import "ios/chrome/browser/providers/chromium_voice_search_provider.h" |
| 10 #import "ios/chrome/browser/providers/images/chromium_branded_image_provider.h" |
| 10 #include "ios/public/provider/chrome/browser/provider_flags.h" | 11 #include "ios/public/provider/chrome/browser/provider_flags.h" |
| 11 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" | 12 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" |
| 12 #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" | 13 #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" |
| 13 #include "ios/public/provider/chrome/browser/signin/signin_resources_provider.h" | 14 #include "ios/public/provider/chrome/browser/signin/signin_resources_provider.h" |
| 14 | 15 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) | 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." | 17 #error "This file requires ARC support." |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 #if !BUILDFLAG(USE_IOS_INTERNAL_PROVIDER) | 20 #if !BUILDFLAG(USE_IOS_INTERNAL_PROVIDER) |
| 20 namespace ios { | 21 namespace ios { |
| 21 std::unique_ptr<ChromeBrowserProvider> CreateChromeBrowserProvider() { | 22 std::unique_ptr<ChromeBrowserProvider> CreateChromeBrowserProvider() { |
| 22 return base::MakeUnique<ChromiumBrowserProvider>(); | 23 return base::MakeUnique<ChromiumBrowserProvider>(); |
| 23 } | 24 } |
| 24 } // namespace ios | 25 } // namespace ios |
| 25 #endif | 26 #endif |
| 26 | 27 |
| 27 ChromiumBrowserProvider::ChromiumBrowserProvider() | 28 ChromiumBrowserProvider::ChromiumBrowserProvider() |
| 28 : signin_error_provider_(base::MakeUnique<ios::SigninErrorProvider>()), | 29 : branded_image_provider_(base::MakeUnique<ChromiumBrandedImageProvider>()), |
| 30 signin_error_provider_(base::MakeUnique<ios::SigninErrorProvider>()), |
| 29 signin_resources_provider_( | 31 signin_resources_provider_( |
| 30 base::MakeUnique<ios::SigninResourcesProvider>()), | 32 base::MakeUnique<ios::SigninResourcesProvider>()), |
| 31 voice_search_provider_(base::MakeUnique<ChromiumVoiceSearchProvider>()) {} | 33 voice_search_provider_(base::MakeUnique<ChromiumVoiceSearchProvider>()) {} |
| 32 | 34 |
| 33 ChromiumBrowserProvider::~ChromiumBrowserProvider() {} | 35 ChromiumBrowserProvider::~ChromiumBrowserProvider() {} |
| 34 | 36 |
| 35 ios::SigninErrorProvider* ChromiumBrowserProvider::GetSigninErrorProvider() { | 37 ios::SigninErrorProvider* ChromiumBrowserProvider::GetSigninErrorProvider() { |
| 36 return signin_error_provider_.get(); | 38 return signin_error_provider_.get(); |
| 37 } | 39 } |
| 38 | 40 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 | 63 |
| 62 VoiceSearchProvider* ChromiumBrowserProvider::GetVoiceSearchProvider() const { | 64 VoiceSearchProvider* ChromiumBrowserProvider::GetVoiceSearchProvider() const { |
| 63 return voice_search_provider_.get(); | 65 return voice_search_provider_.get(); |
| 64 } | 66 } |
| 65 | 67 |
| 66 id<LogoVendor> ChromiumBrowserProvider::CreateLogoVendor( | 68 id<LogoVendor> ChromiumBrowserProvider::CreateLogoVendor( |
| 67 ios::ChromeBrowserState* browser_state, | 69 ios::ChromeBrowserState* browser_state, |
| 68 id<UrlLoader> loader) const { | 70 id<UrlLoader> loader) const { |
| 69 return [[ChromiumLogoController alloc] init]; | 71 return [[ChromiumLogoController alloc] init]; |
| 70 } | 72 } |
| 73 |
| 74 BrandedImageProvider* ChromiumBrowserProvider::GetBrandedImageProvider() const { |
| 75 return branded_image_provider_.get(); |
| 76 } |
| OLD | NEW |