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

Side by Side Diff: android_webview/native/aw_autofill_manager_delegate.cc

Issue 72613006: Eliminate AutofillWebDataService::FromBrowserContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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 "android_webview/native/aw_autofill_manager_delegate.h" 5 #include "android_webview/native/aw_autofill_manager_delegate.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_content_browser_client.h" 8 #include "android_webview/browser/aw_content_browser_client.h"
9 #include "android_webview/browser/aw_form_database_service.h"
9 #include "android_webview/browser/aw_pref_store.h" 10 #include "android_webview/browser/aw_pref_store.h"
10 #include "android_webview/native/aw_contents.h" 11 #include "android_webview/native/aw_contents.h"
11 #include "base/android/jni_android.h" 12 #include "base/android/jni_android.h"
12 #include "base/android/jni_string.h" 13 #include "base/android/jni_string.h"
13 #include "base/android/scoped_java_ref.h" 14 #include "base/android/scoped_java_ref.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/prefs/pref_registry_simple.h" 16 #include "base/prefs/pref_registry_simple.h"
16 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
17 #include "base/prefs/pref_service_builder.h" 18 #include "base/prefs/pref_service_builder.h"
18 #include "components/autofill/core/browser/autofill_popup_delegate.h" 19 #include "components/autofill/core/browser/autofill_popup_delegate.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 AwContentBrowserClient::GetAwBrowserContext()); 67 AwContentBrowserClient::GetAwBrowserContext());
67 } 68 }
68 69
69 autofill::PersonalDataManager* 70 autofill::PersonalDataManager*
70 AwAutofillManagerDelegate::GetPersonalDataManager() { 71 AwAutofillManagerDelegate::GetPersonalDataManager() {
71 return NULL; 72 return NULL;
72 } 73 }
73 74
74 scoped_refptr<autofill::AutofillWebDataService> 75 scoped_refptr<autofill::AutofillWebDataService>
75 AwAutofillManagerDelegate::GetDatabase() { 76 AwAutofillManagerDelegate::GetDatabase() {
76 return autofill::AutofillWebDataService::FromBrowserContext( 77 android_webview::AwFormDatabaseService* service =
77 web_contents_->GetBrowserContext()); 78 static_cast<android_webview::AwBrowserContext*>(
79 web_contents_->GetBrowserContext())->GetFormDatabaseService();
80 DCHECK(service);
Ilya Sherman 2013/11/14 23:54:33 nit: This is redundant with just making a method c
blundell 2013/11/19 14:05:37 Done.
81 return service->get_autofill_webdata_service();
78 } 82 }
79 83
80 void AwAutofillManagerDelegate::ShowAutofillPopup( 84 void AwAutofillManagerDelegate::ShowAutofillPopup(
81 const gfx::RectF& element_bounds, 85 const gfx::RectF& element_bounds,
82 base::i18n::TextDirection text_direction, 86 base::i18n::TextDirection text_direction,
83 const std::vector<string16>& values, 87 const std::vector<string16>& values,
84 const std::vector<string16>& labels, 88 const std::vector<string16>& labels,
85 const std::vector<string16>& icons, 89 const std::vector<string16>& icons,
86 const std::vector<int>& identifiers, 90 const std::vector<int>& identifiers,
87 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) { 91 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 const GURL& source_url, 193 const GURL& source_url,
190 const base::Callback<void(const autofill::FormStructure*)>& callback) { 194 const base::Callback<void(const autofill::FormStructure*)>& callback) {
191 NOTIMPLEMENTED(); 195 NOTIMPLEMENTED();
192 } 196 }
193 197
194 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) { 198 bool RegisterAwAutofillManagerDelegate(JNIEnv* env) {
195 return RegisterNativesImpl(env) >= 0; 199 return RegisterNativesImpl(env) >= 0;
196 } 200 }
197 201
198 } // namespace android_webview 202 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698