| Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| index d17edbddf0ff030cd29a621589be0fa5508a9fed..6b952efbf99a7d7ad644b2440348d3d69e234bf7 100644
|
| --- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| +++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
|
| @@ -20,7 +20,6 @@
|
| #include "content/public/browser/notification_source.h"
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/web_contents.h"
|
| -#include "ui/aura/window.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| #include "ui/views/controls/button/blue_button.h"
|
| @@ -32,6 +31,7 @@
|
| #include "ui/views/controls/separator.h"
|
| #include "ui/views/controls/styled_label.h"
|
| #include "ui/views/controls/styled_label_listener.h"
|
| +#include "ui/views/event_monitor.h"
|
| #include "ui/views/layout/fill_layout.h"
|
| #include "ui/views/layout/grid_layout.h"
|
| #include "ui/views/layout/layout_constants.h"
|
| @@ -815,15 +815,13 @@ class ManagePasswordsBubbleView::WebContentMouseHandler
|
| : public ui::EventHandler {
|
| public:
|
| explicit WebContentMouseHandler(ManagePasswordsBubbleView* bubble);
|
| - ~WebContentMouseHandler() override;
|
|
|
| void OnKeyEvent(ui::KeyEvent* event) override;
|
| void OnMouseEvent(ui::MouseEvent* event) override;
|
|
|
| private:
|
| - aura::Window* GetWebContentsWindow();
|
| -
|
| ManagePasswordsBubbleView* bubble_;
|
| + scoped_ptr<views::EventMonitor> event_monitor_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(WebContentMouseHandler);
|
| };
|
| @@ -831,17 +829,17 @@ class ManagePasswordsBubbleView::WebContentMouseHandler
|
| ManagePasswordsBubbleView::WebContentMouseHandler::WebContentMouseHandler(
|
| ManagePasswordsBubbleView* bubble)
|
| : bubble_(bubble) {
|
| - GetWebContentsWindow()->AddPreTargetHandler(this);
|
| -}
|
| -
|
| -ManagePasswordsBubbleView::WebContentMouseHandler::~WebContentMouseHandler() {
|
| - if (aura::Window* window = GetWebContentsWindow())
|
| - window->RemovePreTargetHandler(this);
|
| + content::WebContents* web_contents = bubble_->web_contents();
|
| + if (web_contents) {
|
| + gfx::NativeWindow target_window = web_contents->GetTopLevelNativeWindow();
|
| + event_monitor_ =
|
| + views::EventMonitor::CreateWindowMonitor(this, target_window);
|
| + }
|
| }
|
|
|
| void ManagePasswordsBubbleView::WebContentMouseHandler::OnKeyEvent(
|
| ui::KeyEvent* event) {
|
| - content::WebContents* web_contents = bubble_->model()->web_contents();
|
| + content::WebContents* web_contents = bubble_->web_contents();
|
| content::RenderViewHost* rvh = web_contents->GetRenderViewHost();
|
| if (rvh->IsFocusedElementEditable() &&
|
| event->type() == ui::ET_KEY_PRESSED)
|
| @@ -854,12 +852,6 @@ void ManagePasswordsBubbleView::WebContentMouseHandler::OnMouseEvent(
|
| bubble_->Close();
|
| }
|
|
|
| -aura::Window*
|
| -ManagePasswordsBubbleView::WebContentMouseHandler::GetWebContentsWindow() {
|
| - content::WebContents* web_contents = bubble_->model()->web_contents();
|
| - return web_contents ? web_contents->GetNativeView() : NULL;
|
| -}
|
| -
|
| // ManagePasswordsBubbleView --------------------------------------------------
|
|
|
| // static
|
| @@ -886,10 +878,8 @@ void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents,
|
| manage_passwords_bubble_ = new ManagePasswordsBubbleView(
|
| web_contents, anchor_view, reason);
|
|
|
| - if (is_fullscreen) {
|
| - manage_passwords_bubble_->set_parent_window(
|
| - web_contents->GetTopLevelNativeWindow());
|
| - }
|
| + if (is_fullscreen)
|
| + manage_passwords_bubble_->set_parent_window(web_contents->GetNativeView());
|
|
|
| views::BubbleDelegateView::CreateBubble(manage_passwords_bubble_);
|
|
|
|
|