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" | |
11 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
12 #include "ios/public/provider/chrome/browser/distribution/test_app_distribution_ provider.h" | 11 #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" | 12 #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 " | 13 #include "ios/public/provider/chrome/browser/omaha/test_omaha_service_provider.h " |
15 #include "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service .h" | 14 #include "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service .h" |
16 #include "ios/public/provider/chrome/browser/signin/test_signin_resources_provid er.h" | 15 #include "ios/public/provider/chrome/browser/signin/test_signin_resources_provid er.h" |
17 #import "ios/public/provider/chrome/browser/spotlight/test_spotlight_provider.h" | 16 #import "ios/public/provider/chrome/browser/spotlight/test_spotlight_provider.h" |
18 #import "ios/public/provider/chrome/browser/ui/test_styled_text_field.h" | 17 #import "ios/public/provider/chrome/browser/ui/test_styled_text_field.h" |
19 #import "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_pro vider.h" | 18 #import "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_pro vider.h" |
20 #import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h" | 19 #import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h" |
21 #import "ios/public/provider/chrome/browser/voice/voice_search_language.h" | 20 #import "ios/public/provider/chrome/browser/voice/voice_search_language.h" |
22 | 21 |
22 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
23 #error "This file requires ARC support." | |
24 #endif | |
25 | |
23 namespace ios { | 26 namespace ios { |
24 | 27 |
25 TestChromeBrowserProvider::TestChromeBrowserProvider() | 28 TestChromeBrowserProvider::TestChromeBrowserProvider() |
26 : app_distribution_provider_( | 29 : app_distribution_provider_( |
27 base::MakeUnique<TestAppDistributionProvider>()), | 30 base::MakeUnique<TestAppDistributionProvider>()), |
28 branded_image_provider_(base::MakeUnique<TestBrandedImageProvider>()), | 31 branded_image_provider_(base::MakeUnique<TestBrandedImageProvider>()), |
29 omaha_service_provider_(base::MakeUnique<TestOmahaServiceProvider>()), | 32 omaha_service_provider_(base::MakeUnique<TestOmahaServiceProvider>()), |
30 signin_resources_provider_( | 33 signin_resources_provider_( |
31 base::MakeUnique<TestSigninResourcesProvider>()), | 34 base::MakeUnique<TestSigninResourcesProvider>()), |
32 voice_search_provider_(base::MakeUnique<TestVoiceSearchProvider>()), | 35 voice_search_provider_(base::MakeUnique<TestVoiceSearchProvider>()), |
(...skipping 19 matching lines...) Expand all Loading... | |
52 chrome_identity_service_.swap(service); | 55 chrome_identity_service_.swap(service); |
53 } | 56 } |
54 | 57 |
55 ChromeIdentityService* TestChromeBrowserProvider::GetChromeIdentityService() { | 58 ChromeIdentityService* TestChromeBrowserProvider::GetChromeIdentityService() { |
56 if (!chrome_identity_service_) { | 59 if (!chrome_identity_service_) { |
57 chrome_identity_service_.reset(new FakeChromeIdentityService()); | 60 chrome_identity_service_.reset(new FakeChromeIdentityService()); |
58 } | 61 } |
59 return chrome_identity_service_.get(); | 62 return chrome_identity_service_.get(); |
60 } | 63 } |
61 | 64 |
62 UITextField<TextFieldStyling>* TestChromeBrowserProvider::CreateStyledTextField( | 65 UITextField<TextFieldStyling>* TestChromeBrowserProvider::CreateStyledTextField( |
rohitrao (ping after 24h)
2017/05/30 15:10:16
@stk how does ARC handle a C++ method that returns
stkhapugin
2017/05/30 15:29:19
In this case, the returned object must have a reta
| |
63 CGRect frame) const { | 66 CGRect frame) const { |
64 return [[TestStyledTextField alloc] initWithFrame:frame]; | 67 return [[TestStyledTextField alloc] initWithFrame:frame]; |
65 } | 68 } |
66 | 69 |
67 VoiceSearchProvider* TestChromeBrowserProvider::GetVoiceSearchProvider() const { | 70 VoiceSearchProvider* TestChromeBrowserProvider::GetVoiceSearchProvider() const { |
68 return voice_search_provider_.get(); | 71 return voice_search_provider_.get(); |
69 } | 72 } |
70 | 73 |
71 AppDistributionProvider* TestChromeBrowserProvider::GetAppDistributionProvider() | 74 AppDistributionProvider* TestChromeBrowserProvider::GetAppDistributionProvider() |
72 const { | 75 const { |
(...skipping 18 matching lines...) Expand all Loading... | |
91 const { | 94 const { |
92 return branded_image_provider_.get(); | 95 return branded_image_provider_.get(); |
93 } | 96 } |
94 | 97 |
95 id<NativeAppWhitelistManager> | 98 id<NativeAppWhitelistManager> |
96 TestChromeBrowserProvider::GetNativeAppWhitelistManager() const { | 99 TestChromeBrowserProvider::GetNativeAppWhitelistManager() const { |
97 return nil; | 100 return nil; |
98 } | 101 } |
99 | 102 |
100 } // namespace ios | 103 } // namespace ios |
OLD | NEW |