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

Unified Diff: chrome/browser/ui/views/autofill/autofill_popup_base_view.cc

Issue 870833002: [android] Autofill popup behavior fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update expectations of old test and add a new test. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
index 0630b482ae47ce709a9e6538511f6915337cd2c7..2c73a69060a54a7c8fd0566853b7be93189b3b70 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
@@ -9,6 +9,7 @@
#include "base/message_loop/message_loop.h"
#include "chrome/browser/ui/autofill/popup_constants.h"
#include "ui/views/border.h"
+#include "ui/views/focus/focus_manager.h"
#include "ui/views/widget/widget.h"
namespace autofill {
@@ -28,9 +29,9 @@ const SkColor AutofillPopupBaseView::kWarningTextColor =
AutofillPopupBaseView::AutofillPopupBaseView(
AutofillPopupViewDelegate* delegate,
- views::Widget* observing_widget)
+ views::FocusManager* focus_manager)
: delegate_(delegate),
- observing_widget_(observing_widget),
+ focus_manager_(focus_manager),
weak_ptr_factory_(this) {}
AutofillPopupBaseView::~AutofillPopupBaseView() {
@@ -44,14 +45,11 @@ AutofillPopupBaseView::~AutofillPopupBaseView() {
void AutofillPopupBaseView::DoShow() {
const bool initialize_widget = !GetWidget();
if (initialize_widget) {
- observing_widget_->AddObserver(this);
-
- views::FocusManager* focus_manager = observing_widget_->GetFocusManager();
- focus_manager->RegisterAccelerator(
+ focus_manager_->RegisterAccelerator(
ui::Accelerator(ui::VKEY_RETURN, ui::EF_NONE),
ui::AcceleratorManager::kNormalPriority,
this);
- focus_manager->RegisterAccelerator(
+ focus_manager_->RegisterAccelerator(
ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE),
ui::AcceleratorManager::kNormalPriority,
this);
@@ -100,8 +98,7 @@ void AutofillPopupBaseView::DoHide() {
}
void AutofillPopupBaseView::RemoveObserver() {
- observing_widget_->GetFocusManager()->UnregisterAccelerators(this);
- observing_widget_->RemoveObserver(this);
+ focus_manager_->UnregisterAccelerators(this);
views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
}
@@ -117,12 +114,6 @@ void AutofillPopupBaseView::OnNativeFocusChange(
HideController();
}
-void AutofillPopupBaseView::OnWidgetBoundsChanged(views::Widget* widget,
- const gfx::Rect& new_bounds) {
- DCHECK_EQ(widget, observing_widget_);
- HideController();
-}
-
void AutofillPopupBaseView::OnMouseCaptureLost() {
ClearSelection();
}

Powered by Google App Engine
This is Rietveld 408576698