diff options
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 24 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.h | 11 |
2 files changed, 32 insertions, 3 deletions
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index 04cf44b..cd053ff 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -379,6 +379,30 @@ void TabContents::SetIsCrashed(bool state) { delegate_->ContentsStateChanged(this); } +void TabContents::SetDownloadShelfVisible(bool visible) { + if (shelf_visible_ != visible) { + if (visible) { + // Invoke GetDownloadShelf to force the shelf to be created. + GetDownloadShelf(); + } + 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. + ToolbarSizeChanged(false); +} + +void TabContents::ToolbarSizeChanged(bool is_animating) { + TabContentsDelegate* d = delegate(); + if (d) + d->ToolbarSizeChanged(this, is_animating); +} + //-------------------------------------------------------------------------- void RLZTracker::CleanupRlz() { diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 9d22924..c360c63 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -63,6 +63,7 @@ class CPCommandInterface; class DOMUIHost; class DownloadItem; class DownloadManager; +class DownloadShelf; class HistoryService; class LoginHandler; class MetricsService; @@ -416,8 +417,8 @@ class TabContents : public PageNavigator, public NotificationObserver { }; TabContents(TabContentsType type) : type_(type), is_crashed_(false), is_active_(true), is_loading_(false), - is_being_destroyed_(false), waiting_for_response_(false), controller_(), - delegate_(), max_page_id_(-1) { } + is_being_destroyed_(false), waiting_for_response_(false), + shelf_visible_(false), controller_(), delegate_(), max_page_id_(-1) { } virtual ~TabContents() { } NavigationController* controller() const { return controller_; } void set_controller(NavigationController* c) { controller_ = c; } @@ -449,7 +450,8 @@ class TabContents : public PageNavigator, public NotificationObserver { const NotificationSource& source, const NotificationDetails& details) { NOTIMPLEMENTED(); } virtual void DidBecomeSelected() { NOTIMPLEMENTED(); } - virtual void SetDownloadShelfVisible(bool) { NOTIMPLEMENTED(); } + virtual void SetDownloadShelfVisible(bool visible); + bool IsDownloadShelfVisible() { return shelf_visible_; } virtual void Destroy(); virtual void SetIsLoading(bool, LoadNotificationDetails*); bool is_crashed() const { return is_crashed_; } @@ -496,6 +498,8 @@ class TabContents : public PageNavigator, public NotificationObserver { void OnStartDownload(DownloadItem* download) { NOTIMPLEMENTED(); } void RemoveInfoBar(InfoBarDelegate* delegate) { NOTIMPLEMENTED(); } virtual bool ShouldDisplayURL() { return true; } + void ToolbarSizeChanged(bool is_animating); + DownloadShelf* GetDownloadShelf() { NOTIMPLEMENTED(); return NULL; } protected: typedef std::vector<ConstrainedWindow*> ConstrainedWindowList; ConstrainedWindowList child_windows_; @@ -508,6 +512,7 @@ class TabContents : public PageNavigator, public NotificationObserver { bool is_loading_; bool is_being_destroyed_; bool waiting_for_response_; + bool shelf_visible_; GURL url_; std::wstring title_; NavigationController* controller_; |