Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: components/autofill/core/browser/test_autofill_client.h

Issue 1859453002: components/autofill: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_
7 7
8 #include <memory>
8 #include <utility> 9 #include <utility>
9 10
10 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
11 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "components/autofill/core/browser/autofill_client.h" 14 #include "components/autofill/core/browser/autofill_client.h"
15 #include "components/prefs/pref_service.h" 15 #include "components/prefs/pref_service.h"
16 #include "components/rappor/test_rappor_service.h" 16 #include "components/rappor/test_rappor_service.h"
17 #include "google_apis/gaia/fake_identity_provider.h" 17 #include "google_apis/gaia/fake_identity_provider.h"
18 #include "google_apis/gaia/fake_oauth2_token_service.h" 18 #include "google_apis/gaia/fake_oauth2_token_service.h"
19 19
20 namespace autofill { 20 namespace autofill {
21 21
22 // This class is for easier writing of tests. 22 // This class is for easier writing of tests.
23 class TestAutofillClient : public AutofillClient { 23 class TestAutofillClient : public AutofillClient {
(...skipping 10 matching lines...) Expand all
34 rappor::RapporService* GetRapporService() override; 34 rappor::RapporService* GetRapporService() override;
35 void HideRequestAutocompleteDialog() override; 35 void HideRequestAutocompleteDialog() override;
36 void ShowAutofillSettings() override; 36 void ShowAutofillSettings() override;
37 void ShowUnmaskPrompt(const CreditCard& card, 37 void ShowUnmaskPrompt(const CreditCard& card,
38 base::WeakPtr<CardUnmaskDelegate> delegate) override; 38 base::WeakPtr<CardUnmaskDelegate> delegate) override;
39 void OnUnmaskVerificationResult(PaymentsRpcResult result) override; 39 void OnUnmaskVerificationResult(PaymentsRpcResult result) override;
40 void ConfirmSaveCreditCardLocally(const CreditCard& card, 40 void ConfirmSaveCreditCardLocally(const CreditCard& card,
41 const base::Closure& callback) override; 41 const base::Closure& callback) override;
42 void ConfirmSaveCreditCardToCloud( 42 void ConfirmSaveCreditCardToCloud(
43 const CreditCard& card, 43 const CreditCard& card,
44 scoped_ptr<base::DictionaryValue> legal_message, 44 std::unique_ptr<base::DictionaryValue> legal_message,
45 const base::Closure& callback) override; 45 const base::Closure& callback) override;
46 void LoadRiskData( 46 void LoadRiskData(
47 const base::Callback<void(const std::string&)>& callback) override; 47 const base::Callback<void(const std::string&)>& callback) override;
48 bool HasCreditCardScanFeature() override; 48 bool HasCreditCardScanFeature() override;
49 void ScanCreditCard(const CreditCardScanCallback& callback) override; 49 void ScanCreditCard(const CreditCardScanCallback& callback) override;
50 void ShowRequestAutocompleteDialog(const FormData& form, 50 void ShowRequestAutocompleteDialog(const FormData& form,
51 content::RenderFrameHost* rfh, 51 content::RenderFrameHost* rfh,
52 const ResultCallback& callback) override; 52 const ResultCallback& callback) override;
53 void ShowAutofillPopup( 53 void ShowAutofillPopup(
54 const gfx::RectF& element_bounds, 54 const gfx::RectF& element_bounds,
(...skipping 10 matching lines...) Expand all
65 const std::vector<autofill::FormStructure*>& forms) override; 65 const std::vector<autofill::FormStructure*>& forms) override;
66 void DidFillOrPreviewField(const base::string16& autofilled_value, 66 void DidFillOrPreviewField(const base::string16& autofilled_value,
67 const base::string16& profile_full_name) override; 67 const base::string16& profile_full_name) override;
68 void OnFirstUserGestureObserved() override; 68 void OnFirstUserGestureObserved() override;
69 bool IsContextSecure(const GURL& form_origin) override; 69 bool IsContextSecure(const GURL& form_origin) override;
70 70
71 void set_is_context_secure(bool is_context_secure) { 71 void set_is_context_secure(bool is_context_secure) {
72 is_context_secure_ = is_context_secure; 72 is_context_secure_ = is_context_secure;
73 }; 73 };
74 74
75 void SetPrefs(scoped_ptr<PrefService> prefs) { prefs_ = std::move(prefs); } 75 void SetPrefs(std::unique_ptr<PrefService> prefs) {
76 prefs_ = std::move(prefs);
77 }
76 78
77 rappor::TestRapporService* test_rappor_service() { 79 rappor::TestRapporService* test_rappor_service() {
78 return rappor_service_.get(); 80 return rappor_service_.get();
79 } 81 }
80 82
81 private: 83 private:
82 // NULL by default. 84 // NULL by default.
83 scoped_ptr<PrefService> prefs_; 85 std::unique_ptr<PrefService> prefs_;
84 scoped_ptr<FakeOAuth2TokenService> token_service_; 86 std::unique_ptr<FakeOAuth2TokenService> token_service_;
85 scoped_ptr<FakeIdentityProvider> identity_provider_; 87 std::unique_ptr<FakeIdentityProvider> identity_provider_;
86 scoped_ptr<rappor::TestRapporService> rappor_service_; 88 std::unique_ptr<rappor::TestRapporService> rappor_service_;
87 89
88 bool is_context_secure_; 90 bool is_context_secure_;
89 91
90 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient); 92 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient);
91 }; 93 };
92 94
93 } // namespace autofill 95 } // namespace autofill
94 96
95 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ 97 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/phone_number_i18n.cc ('k') | components/autofill/core/browser/test_autofill_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698