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 | |
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
9 files changed, 32 insertions, 82 deletions
diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index a269b64d..213e79d 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -232,11 +232,9 @@ class AutofillTest : public InProcessBrowserTest { AutofillDriverImpl* autofill_driver = AutofillDriverImpl::FromWebContents(web_contents); AutofillManager* autofill_manager = autofill_driver->autofill_manager(); - if (autofill_manager->IsNativeUiEnabled()) { - scoped_ptr<AutofillExternalDelegate> external_delegate( - new TestAutofillExternalDelegate(web_contents, autofill_manager)); - autofill_driver->SetAutofillExternalDelegate(external_delegate.Pass()); - } + scoped_ptr<AutofillExternalDelegate> external_delegate( + new TestAutofillExternalDelegate(web_contents, autofill_manager)); + autofill_driver->SetAutofillExternalDelegate(external_delegate.Pass()); autofill_manager->SetTestDelegate(&test_delegate_); } @@ -471,14 +469,6 @@ class AutofillTest : public InProcessBrowserTest { } void SendKeyToPopupAndWait(ui::KeyboardCode key) { - // TODO(isherman): Remove this condition once the WebKit popup UI code is - // removed. - if (!external_delegate()) { - // When testing the WebKit-based UI, route all keys to the page. - SendKeyToPageAndWait(key); - return; - } - // When testing the native UI, route popup-targeted key presses via the // external delegate. content::NativeWebKeyboardEvent event; diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc index 50bfb1f..c040136 100644 --- a/chrome/browser/autofill/autofill_interactive_uitest.cc +++ b/chrome/browser/autofill/autofill_interactive_uitest.cc @@ -210,11 +210,9 @@ class AutofillInteractiveTest : public InProcessBrowserTest { AutofillDriverImpl* autofill_driver = AutofillDriverImpl::FromWebContents(web_contents); AutofillManager* autofill_manager = autofill_driver->autofill_manager(); - if (autofill_manager->IsNativeUiEnabled()) { - scoped_ptr<AutofillExternalDelegate> external_delegate( - new TestAutofillExternalDelegate(web_contents, autofill_manager)); - autofill_driver->SetAutofillExternalDelegate(external_delegate.Pass()); - } + scoped_ptr<AutofillExternalDelegate> external_delegate( + new TestAutofillExternalDelegate(web_contents, autofill_manager)); + autofill_driver->SetAutofillExternalDelegate(external_delegate.Pass()); autofill_manager->SetTestDelegate(&test_delegate_); } diff --git a/chrome/browser/password_manager/password_manager_delegate_impl.cc b/chrome/browser/password_manager/password_manager_delegate_impl.cc index eeb9943..1df2755 100644 --- a/chrome/browser/password_manager/password_manager_delegate_impl.cc +++ b/chrome/browser/password_manager/password_manager_delegate_impl.cc @@ -167,16 +167,10 @@ PasswordManagerDelegateImpl::~PasswordManagerDelegateImpl() { void PasswordManagerDelegateImpl::FillPasswordForm( const autofill::PasswordFormFillData& form_data) { - autofill::AutofillDriverImpl* autofill_driver = - autofill::AutofillDriverImpl::FromWebContents(web_contents_); - // Browser process will own popup UI, so renderer should not show the popup. - bool disable_popup = autofill_driver->autofill_manager()->IsNativeUiEnabled(); - web_contents_->GetRenderViewHost()->Send( new AutofillMsg_FillPasswordForm( web_contents_->GetRenderViewHost()->GetRoutingID(), - form_data, - disable_popup)); + form_data)); } void PasswordManagerDelegateImpl::AddSavePasswordInfoBarIfPermitted( diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index 5b03d59..dcc3574 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc @@ -65,7 +65,7 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest { // protected. void SimulateOnFillPasswordForm( const PasswordFormFillData& fill_data) { - AutofillMsg_FillPasswordForm msg(0, fill_data, false); + AutofillMsg_FillPasswordForm msg(0, fill_data); password_autofill_->OnMessageReceived(msg); } 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( |