| Index: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/autofill/autofill_popup_view_views.cc (revision 170484)
|
| +++ chrome/browser/ui/views/autofill/autofill_popup_view_views.cc (working copy)
|
| @@ -45,11 +45,6 @@
|
| if (GetWidget())
|
| GetWidget()->Close();
|
| web_contents_->GetRenderViewHost()->RemoveKeyboardListener(this);
|
| -
|
| - views::Widget* browser_widget =
|
| - views::Widget::GetTopLevelWidgetForNativeView(
|
| - web_contents_->GetView()->GetTopLevelNativeWindow());
|
| - browser_widget->RemoveObserver(this);
|
| }
|
|
|
| void AutofillPopupViewViews::OnPaint(gfx::Canvas* canvas) {
|
| @@ -66,11 +61,6 @@
|
| }
|
| }
|
|
|
| -void AutofillPopupViewViews::OnWidgetBoundsChanged(views::Widget* widget,
|
| - const gfx::Rect& new_bounds) {
|
| - external_delegate()->HideAutofillPopup();
|
| -}
|
| -
|
| bool AutofillPopupViewViews::HandleKeyPressEvent(ui::KeyEvent* event) {
|
| switch (event->key_code()) {
|
| case ui::VKEY_UP:
|
| @@ -86,7 +76,11 @@
|
| SetSelectedLine(autofill_values().size() - 1);
|
| return true;
|
| case ui::VKEY_ESCAPE:
|
| - external_delegate()->HideAutofillPopup();
|
| + if (external_delegate()) {
|
| + external_delegate()->HideAutofillPopup();
|
| + } else {
|
| + Hide();
|
| + }
|
| return true;
|
| case ui::VKEY_DELETE:
|
| return event->IsShiftDown() && RemoveSelectedLine();
|
| @@ -115,13 +109,6 @@
|
| gfx::Rect client_area;
|
| web_contents_->GetContainerBounds(&client_area);
|
| widget->SetBounds(client_area);
|
| -
|
| - // Setup an observer to check for when the browser moves or changes size,
|
| - // since the popup should always be hidden in those cases.
|
| - views::Widget* browser_widget =
|
| - views::Widget::GetTopLevelWidgetForNativeView(
|
| - web_contents_->GetView()->GetTopLevelNativeWindow());
|
| - browser_widget->AddObserver(this);
|
| }
|
|
|
| set_border(views::Border::CreateSolidBorder(kBorderThickness, kBorderColor));
|
|
|