diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 20:41:30 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 20:41:30 +0000 |
commit | 99899426e812755c21398a6de8b1fe3e5fc01e90 (patch) | |
tree | 3704a4def9fed0583b802b2c97ac09fd9c25ba00 | |
parent | b77486b336c817a56486851cb69b17496b673fb5 (diff) | |
download | chromium_src-99899426e812755c21398a6de8b1fe3e5fc01e90.zip chromium_src-99899426e812755c21398a6de8b1fe3e5fc01e90.tar.gz chromium_src-99899426e812755c21398a6de8b1fe3e5fc01e90.tar.bz2 |
Update animations in fullscreen mode to prevent stuck throbbers.
Also makes SUpportsWindowFeature() private since no one outside the class was using it.
BUG=8031
Review URL: http://codereview.chromium.org/28129
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10372 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 45 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 8 |
2 files changed, 28 insertions, 25 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 3f43533..898a147 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -406,22 +406,6 @@ void BrowserView::PrepareToRunSystemMenu(HMENU menu) { } } -bool BrowserView::SupportsWindowFeature(WindowFeature feature) const { - const Browser::Type type = browser_->type(); - unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF; - if (type == Browser::TYPE_NORMAL) - features |= FEATURE_BOOKMARKBAR; - if (!fullscreen_) { - if (type == Browser::TYPE_NORMAL) - features |= FEATURE_TABSTRIP | FEATURE_TOOLBAR; - else - features |= FEATURE_TITLEBAR; - if (type != Browser::TYPE_APP) - features |= FEATURE_LOCATIONBAR; - } - return !!(features & feature); -} - // static void BrowserView::RegisterBrowserViewPrefs(PrefService* prefs) { prefs->RegisterIntegerPref(prefs::kPluginMessageResponseTimeout, @@ -623,7 +607,7 @@ void BrowserView::SetFullscreen(bool fullscreen) { HWND hwnd = widget->GetHWND(); if (fullscreen_) { // Save current window information. We force the window into restored mode - // before going fuillscreen because Windows doesn't seem to hide the + // before going fullscreen because Windows doesn't seem to hide the // taskbar if the window is in the maximized state. saved_window_info_.maximized = IsMaximized(); if (saved_window_info_.maximized) @@ -1026,8 +1010,7 @@ bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { // - the size of the content area (inner size). // We need to use these values to determine the appropriate size and // position of the resulting window. - if (SupportsWindowFeature(FEATURE_TOOLBAR) || - SupportsWindowFeature(FEATURE_LOCATIONBAR)) { + if (IsToolbarVisible()) { // If we're showing the toolbar, we need to adjust |*bounds| to include // its desired height, since the toolbar is considered part of the // window's client area as far as GetWindowBoundsForClientBounds is @@ -1289,6 +1272,22 @@ void BrowserView::InitSystemMenu() { } } +bool BrowserView::SupportsWindowFeature(WindowFeature feature) const { + const Browser::Type type = browser_->type(); + unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF; + if (type == Browser::TYPE_NORMAL) + features |= FEATURE_BOOKMARKBAR; + if (!fullscreen_) { + if (type == Browser::TYPE_NORMAL) + features |= FEATURE_TABSTRIP | FEATURE_TOOLBAR; + else + features |= FEATURE_TITLEBAR; + if (type != Browser::TYPE_APP) + features |= FEATURE_LOCATIONBAR; + } + return !!(features & feature); +} + bool BrowserView::ShouldForwardToTabStrip( const views::DropTargetEvent& event) { if (!tabstrip_->IsVisible()) @@ -1609,8 +1608,12 @@ int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const { } void BrowserView::LoadingAnimationCallback() { - if (SupportsWindowFeature(FEATURE_TABSTRIP)) { - // Loading animations are shown in the tab for tabbed windows. + if (browser_->type() == Browser::TYPE_NORMAL) { + // Loading animations are shown in the tab for tabbed windows. We check the + // browser type instead of calling IsTabStripVisible() because the latter + // will return false for fullscreen windows, but we still need to update + // their animations (so that when they come out of fullscreen mode they'll + // be correct). tabstrip_->UpdateLoadingAnimations(); } else if (ShouldShowWindowIcon()) { // ... or in the window icon area for popups and app windows. diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 381024d..c2af520 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -159,10 +159,6 @@ class BrowserView : public BrowserWindow, FEATURE_DOWNLOADSHELF = 64 }; - // Returns true if the Browser object associated with this BrowserView - // supports the specified feature. - bool SupportsWindowFeature(WindowFeature feature) const; - // Register preferences specific to this view. static void RegisterBrowserViewPrefs(PrefService* prefs); @@ -290,6 +286,10 @@ class BrowserView : public BrowserWindow, // Creates the system menu. void InitSystemMenu(); + // Returns true if the Browser object associated with this BrowserView + // supports the specified feature. + bool SupportsWindowFeature(WindowFeature feature) const; + // Returns true if the event should be forwarded to the TabStrip. This // returns true if y coordinate is less than the bottom of the tab strip, and // is not over another child view. |