diff options
author | glen@google.com <glen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 22:44:50 +0000 |
---|---|---|
committer | glen@google.com <glen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 22:44:50 +0000 |
commit | 019d835068b6fa120e0039bba8c5c089dfba7a88 (patch) | |
tree | 0e33dc9df604566a6fa1f547385963b9f7743df2 /chrome | |
parent | fc9656edd36841cfb69c10539209b59872042513 (diff) | |
download | chromium_src-019d835068b6fa120e0039bba8c5c089dfba7a88.zip chromium_src-019d835068b6fa120e0039bba8c5c089dfba7a88.tar.gz chromium_src-019d835068b6fa120e0039bba8c5c089dfba7a88.tar.bz2 |
Make the download arrow show and hide correctly in response to shelf visibility. This was caused by both the shelf_visible_ bool not being set by the download shelf correctly, and the tab renderer not being aware of the new state.
BUG=1300997
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser.cc | 2 | ||||
-rw-r--r-- | chrome/browser/browser.h | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents.cc | 5 | ||||
-rw-r--r-- | chrome/browser/tab_contents_delegate.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/download_shelf_view.cc | 4 |
5 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index be59357..5e4af3c 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -919,7 +919,7 @@ bool Browser::IsApplication() const { return type_ == BrowserType::APPLICATION; } -void Browser::CrashedStateChanged(TabContents* source) { +void Browser::ContentsStateChanged(TabContents* source) { int index = tabstrip_model_.GetIndexOfTabContents(source); if (index != TabStripModel::kNoTab) tabstrip_model_.UpdateTabContentsStateAt(index); diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index fc84974..807ed07 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -325,7 +325,7 @@ class Browser : public TabStripModelDelegate, virtual void ContentsZoomChange(bool zoom_in); virtual bool IsApplication() const; virtual void ConvertContentsToApplication(TabContents* source); - virtual void CrashedStateChanged(TabContents* source); + virtual void ContentsStateChanged(TabContents* source); virtual bool ShouldDisplayURLField(); // Return this browser type. diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc index 4706809..364ef91 100644 --- a/chrome/browser/tab_contents.cc +++ b/chrome/browser/tab_contents.cc @@ -529,6 +529,9 @@ void TabContents::SetDownloadShelfVisible(bool visible) { } shelf_visible_ = visible; + if (delegate_) + delegate_->ContentsStateChanged(this); + // SetShelfVisible can force-close the shelf, so make sure we lay out // everything correctly, as if the animation had finished. This doesn't // matter for showing the shelf, as the show animation will do it. @@ -550,7 +553,7 @@ void TabContents::SetIsCrashed(bool state) { is_crashed_ = state; if (delegate_) - delegate_->CrashedStateChanged(this); + delegate_->ContentsStateChanged(this); } bool TabContents::IsCrashed() const { diff --git a/chrome/browser/tab_contents_delegate.h b/chrome/browser/tab_contents_delegate.h index d658b71..fc2a8c2 100644 --- a/chrome/browser/tab_contents_delegate.h +++ b/chrome/browser/tab_contents_delegate.h @@ -160,9 +160,9 @@ class TabContentsDelegate : public PageNavigator { virtual void DidNavigate(NavigationType nav_type, int relative_navigation_offset) { return; } - // Informs the TabContentsDelegate that the |IsCrashed| state has changed for - // this tab. - virtual void CrashedStateChanged(TabContents* source) {} + // Informs the TabContentsDelegate that some of our state has changed + // for this tab. + virtual void ContentsStateChanged(TabContents* source) {} // Return whether this tab contents should have a URL bar. Only web contents // opened with a minimal chrome and their popups can be displayed without a diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc index 49f7f67..e18f3b0 100644 --- a/chrome/browser/views/download_shelf_view.cc +++ b/chrome/browser/views/download_shelf_view.cc @@ -223,9 +223,7 @@ void DownloadShelfView::AnimationProgressed(const Animation *animation) { void DownloadShelfView::AnimationEnded(const Animation *animation) { if (animation == shelf_animation_.get()) { - if (shelf_animation_->IsShowing() == false) - tab_contents_->SetDownloadShelfVisible(false); - tab_contents_->ToolbarSizeChanged(false); + tab_contents_->SetDownloadShelfVisible(shelf_animation_->IsShowing()); } } |