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

Side by Side Diff: chrome/browser/autofill/android/personal_data_manager_android.cc

Issue 2606473003: Use AutofillDriver* in ContentAutofillDriverFactory when possible (Closed)
Patch Set: Fix Android compilation Created 3 years, 12 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
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/autofill/android/personal_data_manager_android.h" 5 #include "chrome/browser/autofill/android/personal_data_manager_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return; 228 return;
229 } 229 }
230 230
231 ContentAutofillDriverFactory* factory = 231 ContentAutofillDriverFactory* factory =
232 ContentAutofillDriverFactory::FromWebContents(contents); 232 ContentAutofillDriverFactory::FromWebContents(contents);
233 if (!factory) { 233 if (!factory) {
234 OnFullCardRequestFailed(); 234 OnFullCardRequestFailed();
235 return; 235 return;
236 } 236 }
237 237
238 ContentAutofillDriver* driver = 238 ContentAutofillDriver* driver = static_cast<ContentAutofillDriver*>(
239 factory->DriverForFrame(contents->GetMainFrame()); 239 factory->DriverForFrame(contents->GetMainFrame()));
240 if (!driver) { 240 if (!driver) {
241 OnFullCardRequestFailed(); 241 OnFullCardRequestFailed();
242 return; 242 return;
243 } 243 }
244 244
245 driver->autofill_manager()->GetOrCreateFullCardRequest()->GetFullCard( 245 driver->autofill_manager()->GetOrCreateFullCardRequest()->GetFullCard(
246 *card_, AutofillClient::UNMASK_FOR_PAYMENT_REQUEST, AsWeakPtr()); 246 *card_, AutofillClient::UNMASK_FOR_PAYMENT_REQUEST, AsWeakPtr());
247 } 247 }
248 248
249 private: 249 private:
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 base::android::ConvertJavaStringToUTF16(env, jcountry_name))); 927 base::android::ConvertJavaStringToUTF16(env, jcountry_name)));
928 } 928 }
929 929
930 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 930 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
931 PersonalDataManagerAndroid* personal_data_manager_android = 931 PersonalDataManagerAndroid* personal_data_manager_android =
932 new PersonalDataManagerAndroid(env, obj); 932 new PersonalDataManagerAndroid(env, obj);
933 return reinterpret_cast<intptr_t>(personal_data_manager_android); 933 return reinterpret_cast<intptr_t>(personal_data_manager_android);
934 } 934 }
935 935
936 } // namespace autofill 936 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698