summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 17:22:19 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 17:22:19 +0000
commite3d8359a971fb5632ca597296836d5cad559ace7 (patch)
tree8e1b2ef07d348d2175753e009d92d933e75cb941 /chrome
parentbab79fb983a25f696726f0dcf53ac0c5ac9e6844 (diff)
downloadchromium_src-e3d8359a971fb5632ca597296836d5cad559ace7.zip
chromium_src-e3d8359a971fb5632ca597296836d5cad559ace7.tar.gz
chromium_src-e3d8359a971fb5632ca597296836d5cad559ace7.tar.bz2
Stub in the download shelf a little further.
Review URL: http://codereview.chromium.org/39021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/temp_scaffolding_stubs.cc24
-rw-r--r--chrome/common/temp_scaffolding_stubs.h11
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_;