diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 02:59:12 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 02:59:12 +0000 |
commit | 7d5925a7da14d0add8409dec09dc31b3f6d756e3 (patch) | |
tree | 3ab31cb6053a9c8402703858f4075528985dcc4e | |
parent | f46c39462c7a3263d1a6ddab09eb9d60a8eb0610 (diff) | |
download | chromium_src-7d5925a7da14d0add8409dec09dc31b3f6d756e3.zip chromium_src-7d5925a7da14d0add8409dec09dc31b3f6d756e3.tar.gz chromium_src-7d5925a7da14d0add8409dec09dc31b3f6d756e3.tar.bz2 |
Make it so that dropdown selects don't deactivate the main frame when opened http://crbug.com/8247
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10777 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/browser.h | 1 | ||||
-rw-r--r-- | chrome/browser/browser_window.h | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 5 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents_view_win.cc | 1 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 1 | ||||
-rw-r--r-- | chrome/views/window.cc | 3 |
8 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 9c6dc3d..65ad221 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -1860,6 +1860,9 @@ void Browser::SetFocusToLocationBar() { window_->SetFocusToLocationBar(); } +void Browser::RenderWidgetShowing() { + window_->DisableInactiveFrame(); +} /////////////////////////////////////////////////////////////////////////////// // Browser, SelectFileDialog::Listener implementation: diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 6415023..1be5d90 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -398,6 +398,7 @@ class Browser : public TabStripModelDelegate, virtual void ShowHtmlDialog(HtmlDialogContentsDelegate* delegate, void* parent_window); virtual void SetFocusToLocationBar(); + virtual void RenderWidgetShowing(); // Overridden from SelectFileDialog::Listener: virtual void FileSelected(const std::wstring& path, void* params); diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index 3df4a23..5bf3748 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -124,6 +124,12 @@ class BrowserWindow { // where we take care of it ourselves at the browser level). virtual gfx::Rect GetRootWindowResizerRect() const = 0; + // Tells the frame not to render as inactive until the next activation change. + // This is required on Windows when dropdown selects are shown to prevent the + // select from deactivating the browser frame. A stub implementation is + // provided here since the functionality is Windows-specific. + virtual void DisableInactiveFrame() {} + // Shows or hides the bookmark bar depending on its current visibility. virtual void ToggleBookmarkBar() = 0; diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index a55f0e0..f97a6dc50 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -147,6 +147,11 @@ class TabContentsDelegate : public PageNavigator { // This is called when the tab wants to encourage user input, like for the // new tab page. virtual void SetFocusToLocationBar() {} + + // Called when a popup select is about to be displayed. The delegate can use + // this to disable inactive rendering for the frame in the window the select + // is opened within if necessary. + virtual void RenderWidgetShowing() {} }; #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ diff --git a/chrome/browser/tab_contents/web_contents_view_win.cc b/chrome/browser/tab_contents/web_contents_view_win.cc index 73602d7..bdbf89c 100644 --- a/chrome/browser/tab_contents/web_contents_view_win.cc +++ b/chrome/browser/tab_contents/web_contents_view_win.cc @@ -402,6 +402,7 @@ void WebContentsViewWin::ShowCreatedWidgetInternal( widget_host_view_win->MoveWindow(initial_pos.x(), initial_pos.y(), initial_pos.width(), initial_pos.height(), TRUE); + web_contents_->delegate()->RenderWidgetShowing(); widget_host_view_win->ShowWindow(widget_host_view_win->activatable() ? SW_SHOW : SW_SHOWNA); widget_host->Init(); diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 72e8e8f..de73484 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -736,6 +736,10 @@ gfx::Rect BrowserView::GetRootWindowResizerRect() const { resize_corner_size.width(), resize_corner_size.height()); } +void BrowserView::DisableInactiveFrame() { + frame_->DisableInactiveRendering(); +} + void BrowserView::ToggleBookmarkBar() { BookmarkBarView::ToggleWhenVisible(browser_->profile()); } diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 0de9e20..06dc8da 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -204,6 +204,7 @@ class BrowserView : public BrowserWindow, virtual void DestroyBrowser(); virtual bool IsBookmarkBarVisible() const; virtual gfx::Rect GetRootWindowResizerRect() const; + virtual void DisableInactiveFrame(); virtual void ToggleBookmarkBar(); virtual void ShowFindBar(); virtual void ShowAboutChromeDialog(); diff --git a/chrome/views/window.cc b/chrome/views/window.cc index a879a99..5024b0c 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -407,6 +407,9 @@ void Window::OnActivateApp(BOOL active, DWORD thread_id) { // disables inactive rendering now. disable_inactive_rendering_ = false; non_client_view_->DisableInactiveRendering(false); + // Update the native frame too, since it could be rendering the non-client + // area. + CallDefaultNCActivateHandler(FALSE); } } |