diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 00:40:23 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 00:40:23 +0000 |
commit | 7435b830a7b6d2a43f94afbcca57bbc102db2ef3 (patch) | |
tree | 2d1ad9b433280e617d94436db715e4dd313f7bf9 /chrome/browser | |
parent | 71be2a6333fa5c30b2156556740946d298765a32 (diff) | |
download | chromium_src-7435b830a7b6d2a43f94afbcca57bbc102db2ef3.zip chromium_src-7435b830a7b6d2a43f94afbcca57bbc102db2ef3.tar.gz chromium_src-7435b830a7b6d2a43f94afbcca57bbc102db2ef3.tar.bz2 |
Make fullscreen exit bubble link work by preventing the bubble from ever being activated. Not sure why this worked in the first place and then regressed.
BUG=8318
Review URL: http://codereview.chromium.org/43107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/fullscreen_exit_bubble.cc | 23 | ||||
-rw-r--r-- | chrome/browser/views/fullscreen_exit_bubble.h | 7 |
2 files changed, 25 insertions, 5 deletions
diff --git a/chrome/browser/views/fullscreen_exit_bubble.cc b/chrome/browser/views/fullscreen_exit_bubble.cc index efc600a..5686602 100644 --- a/chrome/browser/views/fullscreen_exit_bubble.cc +++ b/chrome/browser/views/fullscreen_exit_bubble.cc @@ -94,6 +94,25 @@ void FullscreenExitBubble::FullscreenExitView::Paint(ChromeCanvas* canvas) { } +// FullscreenExitPopup --------------------------------------------------------- + +class FullscreenExitBubble::FullscreenExitPopup : public views::WidgetWin { + public: + FullscreenExitPopup() : views::WidgetWin() { } + virtual ~FullscreenExitPopup() { } + + // views::WidgetWin: + virtual LRESULT OnMouseActivate(HWND window, + UINT hittest_code, + UINT message) { + // Prevent the popup from being activated, so it won't steal focus from the + // rest of the browser, and doesn't cause problems with the FocusManager's + // "RestoreFocusedView()" functionality. + return MA_NOACTIVATE; + } +}; + + // FullscreenExitBubble -------------------------------------------------------- const double FullscreenExitBubble::kOpacity = 0.7; @@ -108,7 +127,7 @@ FullscreenExitBubble::FullscreenExitBubble( CommandUpdater::CommandUpdaterDelegate* delegate) : root_view_(frame->GetRootView()), delegate_(delegate), - popup_(new views::WidgetWin()), + popup_(new FullscreenExitPopup()), size_animation_(new SlideAnimation(this)) { size_animation_->Reset(1); @@ -126,7 +145,7 @@ FullscreenExitBubble::FullscreenExitBubble( popup_->SetLayeredAlpha(static_cast<int>(0xff * kOpacity)); popup_->Init(frame->GetHWND(), GetPopupRect(false), false); popup_->SetContentsView(view_); - popup_->Show(); + popup_->Show(); // This does not activate the popup. // Start the initial delay timer. initial_delay_.Start(base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, diff --git a/chrome/browser/views/fullscreen_exit_bubble.h b/chrome/browser/views/fullscreen_exit_bubble.h index ff855be..3c950de 100644 --- a/chrome/browser/views/fullscreen_exit_bubble.h +++ b/chrome/browser/views/fullscreen_exit_bubble.h @@ -25,6 +25,7 @@ class FullscreenExitBubble : public views::LinkController, private: class FullscreenExitView; + class FullscreenExitPopup; static const double kOpacity; // Opacity of the bubble, 0.0 - 1.0 static const int kInitialDelayMs; // Initial time bubble remains onscreen @@ -60,9 +61,9 @@ class FullscreenExitBubble : public views::LinkController, // it. CommandUpdater::CommandUpdaterDelegate* delegate_; - // We use an HWND for the popup so that it may float above any plugins in the - // page. - views::WidgetWin* popup_; + // The popup itself, which is a slightly modified WidgetWin. We need to use + // a WidgetWin (and thus an HWND) to make the popup float over other HWNDs. + FullscreenExitPopup* popup_; // The contents of the popup. FullscreenExitView* view_; |