diff options
author | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-03 15:04:40 +0000 |
---|---|---|
committer | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-03 15:04:40 +0000 |
commit | 6aec8932ddfb5771d227a2103e93b9e67de2170a (patch) | |
tree | 719004e8e0a67a9e13d3815cb5d5eb7886730164 /components/autofill | |
parent | 1f9fd547750a691719ec8ef27ce285c92d4f91e4 (diff) | |
download | chromium_src-6aec8932ddfb5771d227a2103e93b9e67de2170a.zip chromium_src-6aec8932ddfb5771d227a2103e93b9e67de2170a.tar.gz chromium_src-6aec8932ddfb5771d227a2103e93b9e67de2170a.tar.bz2 |
[Autofill] Remove IsNativeUiEnabled
The native UI is now always on and the flag to revert to the old
UI has been removed, so this will now always be true.
TBR=isherman@chromium.org
BUG=255625
Review URL: https://chromiumcodereview.appspot.com/18173006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill')
5 files changed, 24 insertions, 56 deletions
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 87b8fd3..5c45a65 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc @@ -216,7 +216,6 @@ bool DoUsernamesMatch(const base::string16& username1, PasswordAutofillAgent::PasswordAutofillAgent(content::RenderView* render_view) : content::RenderViewObserver(render_view), - disable_popup_(false), usernames_usage_(NOTHING_TO_AUTOFILL), web_view_(render_view->GetWebView()), weak_ptr_factory_(this) { @@ -436,9 +435,7 @@ void PasswordAutofillAgent::FrameWillClose(WebKit::WebFrame* frame) { } void PasswordAutofillAgent::OnFillPasswordForm( - const PasswordFormFillData& form_data, - bool disable_popup) { - disable_popup_ = disable_popup; + const PasswordFormFillData& form_data) { if (usernames_usage_ == NOTHING_TO_AUTOFILL) { if (form_data.other_possible_usernames.size()) usernames_usage_ = OTHER_POSSIBLE_USERNAMES_PRESENT; @@ -539,41 +536,25 @@ bool PasswordAutofillAgent::ShowSuggestionPopup( std::vector<base::string16> realms; GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); - if (disable_popup_) { - FormData form; - FormFieldData field; - FindFormAndFieldForInputElement( - user_input, &form, &field, REQUIRE_NONE); - - WebKit::WebInputElement selected_element = user_input; - gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); - - float scale = web_view_->pageScaleFactor(); - gfx::RectF bounding_box_scaled(bounding_box.x() * scale, - bounding_box.y() * scale, - bounding_box.width() * scale, - bounding_box.height() * scale); - Send(new AutofillHostMsg_ShowPasswordSuggestions(routing_id(), - field, - bounding_box_scaled, - suggestions, - realms)); - return !suggestions.empty(); - } - - - if (suggestions.empty()) { - webview->hidePopups(); - return false; - } - - std::vector<base::string16> labels(suggestions.size()); - std::vector<base::string16> icons(suggestions.size()); - std::vector<int> ids(suggestions.size(), - WebKit::WebAutofillClient::MenuItemIDPasswordEntry); - webview->applyAutofillSuggestions( - user_input, suggestions, labels, icons, ids); - return true; + FormData form; + FormFieldData field; + FindFormAndFieldForInputElement( + user_input, &form, &field, REQUIRE_NONE); + + WebKit::WebInputElement selected_element = user_input; + gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); + + float scale = web_view_->pageScaleFactor(); + gfx::RectF bounding_box_scaled(bounding_box.x() * scale, + bounding_box.y() * scale, + bounding_box.width() * scale, + bounding_box.height() * scale); + Send(new AutofillHostMsg_ShowPasswordSuggestions(routing_id(), + field, + bounding_box_scaled, + suggestions, + realms)); + return !suggestions.empty(); } bool PasswordAutofillAgent::FillUserNameAndPassword( diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h index f34372a..fa69617 100644 --- a/components/autofill/content/renderer/password_autofill_agent.h +++ b/components/autofill/content/renderer/password_autofill_agent.h @@ -80,8 +80,7 @@ class PasswordAutofillAgent : public content::RenderViewObserver { virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; // RenderView IPC handlers: - void OnFillPasswordForm(const PasswordFormFillData& form_data, - bool disable_popup); + void OnFillPasswordForm(const PasswordFormFillData& form_data); // Scans the given frame for password forms and sends them up to the browser. // If |only_visible| is true, only forms visible in the layout are sent. @@ -121,9 +120,6 @@ class PasswordAutofillAgent : public content::RenderViewObserver { // The logins we have filled so far with their associated info. LoginToPasswordInfoMap login_to_password_info_; - // Used to disable and hide the popup. - bool disable_popup_; - // Used for UMA stats. OtherPossibleUsernamesUsage usernames_usage_; diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index 7912bb8..7a1d925 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc @@ -246,10 +246,6 @@ void AutofillManager::SetExternalDelegate(AutofillExternalDelegate* delegate) { autocomplete_history_manager_->SetExternalDelegate(delegate); } -bool AutofillManager::IsNativeUiEnabled() { - return external_delegate_ != NULL; -} - bool AutofillManager::OnFormSubmitted(const FormData& form, const TimeTicks& timestamp) { // Let Autocomplete know as well. @@ -620,8 +616,7 @@ void AutofillManager::OnDidShowAutofillSuggestions(bool is_new_popup) { } void AutofillManager::OnHideAutofillUi() { - if (IsNativeUiEnabled()) - manager_delegate_->HideAutofillPopup(); + manager_delegate_->HideAutofillPopup(); manager_delegate_->HideAutocheckoutBubble(); } diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h index a4f0194..496a2a2 100644 --- a/components/autofill/core/browser/autofill_manager.h +++ b/components/autofill/core/browser/autofill_manager.h @@ -87,9 +87,6 @@ class AutofillManager : public AutofillDownloadManager::Observer { // Sets an external delegate. void SetExternalDelegate(AutofillExternalDelegate* delegate); - // Whether browser process will create and own the Autofill popup UI. - bool IsNativeUiEnabled(); - // Called from our external delegate so they cannot be private. virtual void OnFillAutofillFormData(int query_id, const FormData& form, diff --git a/components/autofill/core/common/autofill_messages.h b/components/autofill/core/common/autofill_messages.h index 2e94713..d504855 100644 --- a/components/autofill/core/common/autofill_messages.h +++ b/components/autofill/core/common/autofill_messages.h @@ -125,9 +125,8 @@ IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled, // Fill a password form and prepare field autocomplete for multiple // matching logins. Lets the renderer know if it should disable the popup // because the browser process will own the popup UI. -IPC_MESSAGE_ROUTED2(AutofillMsg_FillPasswordForm, - autofill::PasswordFormFillData, /* the fill form data*/ - bool /* disable popup */ ) +IPC_MESSAGE_ROUTED1(AutofillMsg_FillPasswordForm, + autofill::PasswordFormFillData /* the fill form data*/) // Send the heuristic and server field type predictions to the renderer. IPC_MESSAGE_ROUTED1( |