diff options
-rw-r--r-- | chrome/browser/browser.h | 7 | ||||
-rw-r--r-- | chrome/browser/browser.vcproj | 8 | ||||
-rw-r--r-- | chrome/browser/download/download_item_model.cc | 6 | ||||
-rw-r--r-- | chrome/browser/download/download_item_model.h | 14 | ||||
-rw-r--r-- | chrome/browser/download/download_shelf.cc | 29 | ||||
-rw-r--r-- | chrome/browser/download/download_shelf.h | 51 | ||||
-rw-r--r-- | chrome/browser/download/save_package.cc | 17 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 39 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 18 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 5 | ||||
-rw-r--r-- | chrome/browser/views/download_shelf_view.cc | 28 | ||||
-rw-r--r-- | chrome/browser/views/download_shelf_view.h | 58 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 4 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.h | 2 |
15 files changed, 176 insertions, 112 deletions
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index f897eb4..6415023 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -252,7 +252,13 @@ class Browser : public TabStripModelDelegate, void BookmarkCurrentPage(); void SavePage(); void ViewSource(); + + // Show various bits of UI. + void ShowDownloadsTab(); + +// TODO(port): port these, and re-merge the two function declaration lists. #if defined(OS_WIN) + // Page-related commands. void ClosePopups(); void Print(); void ToggleEncodingAutoDetect(); @@ -291,7 +297,6 @@ class Browser : public TabStripModelDelegate, void ToggleBookmarkBar(); void ShowHistoryTab(); void OpenBookmarkManager(); - void ShowDownloadsTab(); void OpenClearBrowsingDataDialog(); void OpenImportSettingsDialog(); void OpenOptionsDialog(); diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index 6f1a886..0015e0a 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -1834,6 +1834,14 @@ > </File> <File + RelativePath=".\download\download_shelf.cc" + > + </File> + <File + RelativePath=".\download\download_shelf.h" + > + </File> + <File RelativePath=".\download\download_util.cc" > </File> diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc index f90ec6b..9b7f764 100644 --- a/chrome/browser/download/download_item_model.cc +++ b/chrome/browser/download/download_item_model.cc @@ -17,7 +17,7 @@ using base::TimeDelta; // DownloadItemModel DownloadItemModel::DownloadItemModel(DownloadItem* download) - : download_(download) { + : BaseDownloadItemModel(download) { } void DownloadItemModel::CancelTask() { @@ -96,8 +96,8 @@ std::wstring DownloadItemModel::GetStatusText() { // SavePageModel SavePageModel::SavePageModel(SavePackage* save, DownloadItem* download) - : save_(save), - download_(download) { + : BaseDownloadItemModel(download), + save_(save) { } void SavePageModel::CancelTask() { diff --git a/chrome/browser/download/download_item_model.h b/chrome/browser/download/download_item_model.h index 8c7fe83..2638ccd 100644 --- a/chrome/browser/download/download_item_model.h +++ b/chrome/browser/download/download_item_model.h @@ -16,11 +16,19 @@ class SavePackage; // depending on the type of download. class BaseDownloadItemModel { public: + BaseDownloadItemModel(DownloadItem* download) : download_(download) { } + virtual ~BaseDownloadItemModel() { } + // Cancel the task corresponding to the item. virtual void CancelTask() = 0; // Get the status text to display. virtual std::wstring GetStatusText() = 0; + + DownloadItem* download() { return download_; } + + protected: + DownloadItem* download_; }; // This class is a model class for DownloadItemView. It provides functionality @@ -38,9 +46,6 @@ class DownloadItemModel : public BaseDownloadItemModel { virtual std::wstring GetStatusText(); private: - // We query this item for status information. - DownloadItem* download_; - DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); }; @@ -62,9 +67,6 @@ class SavePageModel : public BaseDownloadItemModel { // Saving page management. SavePackage* save_; - // A fake download item for saving page use. - DownloadItem* download_; - DISALLOW_COPY_AND_ASSIGN(SavePageModel); }; diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc new file mode 100644 index 0000000..7cce198 --- /dev/null +++ b/chrome/browser/download/download_shelf.cc @@ -0,0 +1,29 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/download/download_shelf.h" + +#include "chrome/browser/dom_ui/downloads_ui.h" +#include "chrome/browser/metrics/user_metrics.h" + +#if defined(OS_WIN) +#include "chrome/browser/tab_contents/tab_contents.h" +#elif defined(OS_POSIX) +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + +void DownloadShelf::ShowAllDownloads() { + Profile* profile = tab_contents_->profile(); + if (profile) + UserMetrics::RecordAction(L"ShowDownloads", profile); + GURL url = DownloadsUI::GetBaseURL(); + tab_contents_->OpenURL(url, GURL(), NEW_FOREGROUND_TAB, + PageTransition::AUTO_BOOKMARK); +} + +void DownloadShelf::ChangeTabContents(TabContents* old_contents, + TabContents* new_contents) { + DCHECK(old_contents == tab_contents_); + tab_contents_ = new_contents; +} diff --git a/chrome/browser/download/download_shelf.h b/chrome/browser/download/download_shelf.h new file mode 100644 index 0000000..d3b83a1 --- /dev/null +++ b/chrome/browser/download/download_shelf.h @@ -0,0 +1,51 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ +#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ + +#include "base/basictypes.h" + +class BaseDownloadItemModel; +class TabContents; + +// DownloadShelf is an interface for platform-specific download shelves to +// implement. It also contains some shared logic. This class should not be +// instantiated directly, but rather created via a call to Create(). +class DownloadShelf { + public: + explicit DownloadShelf(TabContents* tab_contents) + : tab_contents_(tab_contents) { } + + virtual ~DownloadShelf() { } + + // Creates a platform-specific DownloadShelf, passing ownership to the caller. + static DownloadShelf* Create(TabContents* tab_contents); + + // A new download has started, so add it to our shelf. This object will + // take ownership of |download_model|. + virtual void AddDownload(BaseDownloadItemModel* download_model) = 0; + + // Invoked when the user clicks the 'show all downloads' link button. + void ShowAllDownloads(); + + // Invoked when the download shelf is migrated from one tab contents to a new + // one. + void ChangeTabContents(TabContents* old_contents, TabContents* new_contents); + + // The browser view needs to know when we are going away to properly return + // the resize corner size to WebKit so that we don't draw on top of it. + // This returns the showing state of our animation which is set to false at + // the beginning Show and true at the beginning of a Hide. + virtual bool IsShowing() const = 0; + + protected: + TabContents* tab_contents_; + + private: + DISALLOW_COPY_AND_ASSIGN(DownloadShelf); +}; + +#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ + diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index 1bccaa9..6af6c05 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -14,6 +14,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_item_model.h" #include "chrome/browser/download/download_manager.h" +#include "chrome/browser/download/download_shelf.h" #include "chrome/browser/download/save_file.h" #include "chrome/browser/download/save_file_manager.h" #include "chrome/browser/profile.h" @@ -41,14 +42,6 @@ #include "chrome/common/win_util.h" #endif -#if defined(OS_WIN) -// TODO(port): port these headers. -#include "chrome/browser/views/download_item_view.h" -#include "chrome/browser/views/download_shelf_view.h" -#elif defined(OS_POSIX) -#include "chrome/common/temp_scaffolding_stubs.h" -#endif - using base::Time; namespace { @@ -272,13 +265,11 @@ bool SavePackage::Init() { FilePath(), Time::Now(), 0, -1, -1, false); download_->set_manager(web_contents_->profile()->GetDownloadManager()); #if defined(OS_WIN) - // TODO(port): We need to do something like this on posix, but avoid - // using DownloadShelfView, which probably should not be ported directly. - DownloadShelfView* shelf = web_contents_->GetDownloadShelfView(); - shelf->AddDownloadView(new DownloadItemView( - download_, shelf, new SavePageModel(this, download_))); + DownloadShelf* shelf = web_contents_->GetDownloadShelf(); + shelf->AddDownload(new SavePageModel(this, download_)); web_contents_->SetDownloadShelfVisible(true); #elif defined(OS_POSIX) + // TODO(port): Create a download shelf for linux and mac. NOTIMPLEMENTED(); #endif diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index def6c34..e8ae41f 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -932,7 +932,7 @@ void NavigationController::DiscardNonCommittedEntries() { // If we are transitioning from two types of WebContents, we need to migrate // the download shelf if it is visible. The download shelf may have been // created before the error that caused us to discard the entry. - TabContents::MigrateShelfView(from_contents, active_contents_); + TabContents::MigrateShelf(from_contents, active_contents_); if (from_contents->delegate()) { from_contents->delegate()->ReplaceContents(from_contents, diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 4b008dd..39ea878 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -9,6 +9,8 @@ #endif #include "chrome/browser/cert_store.h" +#include "chrome/browser/download/download_item_model.h" +#include "chrome/browser/download/download_shelf.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/browser/tab_contents/web_contents.h" @@ -21,7 +23,6 @@ #if defined(OS_WIN) // TODO(port): some of these headers should be ported. #include "chrome/browser/tab_contents/infobar_delegate.h" -#include "chrome/browser/views/download_shelf_view.h" #include "chrome/browser/views/download_started_animation.h" #include "chrome/browser/views/blocked_popup_container.h" #include "chrome/views/native_scroll_bar.h" @@ -467,8 +468,8 @@ void TabContents::RemoveInfoBar(InfoBarDelegate* delegate) { void TabContents::SetDownloadShelfVisible(bool visible) { if (shelf_visible_ != visible) { if (visible) { - // Invoke GetDownloadShelfView to force the shelf to be created. - GetDownloadShelfView(); + // Invoke GetDownloadShelf to force the shelf to be created. + GetDownloadShelf(); } shelf_visible_ = visible; @@ -497,8 +498,9 @@ void TabContents::OnStartDownload(DownloadItem* download) { if (constraining_tab) tab_contents = constraining_tab; - // GetDownloadShelfView creates the download shelf if it was not yet created. - tab_contents->GetDownloadShelfView()->AddDownload(download); + // GetDownloadShelf creates the download shelf if it was not yet created. + tab_contents->GetDownloadShelf()->AddDownload( + new DownloadItemModel(download)); tab_contents->SetDownloadShelfVisible(true); // This animation will delete itself when it finishes, or if we become hidden @@ -509,19 +511,16 @@ void TabContents::OnStartDownload(DownloadItem* download) { } } -DownloadShelfView* TabContents::GetDownloadShelfView() { - if (!download_shelf_view_.get()) { - download_shelf_view_.reset(new DownloadShelfView(this)); - // The TabContents owns the download-shelf. - download_shelf_view_->SetParentOwned(false); - } - return download_shelf_view_.get(); +DownloadShelf* TabContents::GetDownloadShelf() { + if (!download_shelf_.get()) + download_shelf_.reset(DownloadShelf::Create(this)); + return download_shelf_.get(); } -void TabContents::MigrateShelfViewFrom(TabContents* tab_contents) { - download_shelf_view_.reset(tab_contents->GetDownloadShelfView()); - download_shelf_view_->ChangeTabContents(tab_contents, this); - tab_contents->ReleaseDownloadShelfView(); +void TabContents::MigrateShelfFrom(TabContents* tab_contents) { + download_shelf_.reset(tab_contents->GetDownloadShelf()); + download_shelf_->ChangeTabContents(tab_contents, this); + tab_contents->ReleaseDownloadShelf(); } void TabContents::WillClose(ConstrainedWindow* window) { @@ -557,10 +556,10 @@ void TabContents::Observe(NotificationType type, } // static -void TabContents::MigrateShelfView(TabContents* from, TabContents* to) { +void TabContents::MigrateShelf(TabContents* from, TabContents* to) { bool was_shelf_visible = from->IsDownloadShelfVisible(); if (was_shelf_visible) - to->MigrateShelfViewFrom(from); + to->MigrateShelfFrom(from); to->SetDownloadShelfVisible(was_shelf_visible); } @@ -605,8 +604,8 @@ void TabContents::RepositionSupressedPopupsToFit(const gfx::Size& new_size) { blocked_popups_->RepositionConstrainedWindowTo(anchor_position); } -void TabContents::ReleaseDownloadShelfView() { - download_shelf_view_.release(); +void TabContents::ReleaseDownloadShelf() { + download_shelf_.release(); } bool TabContents::ShowingBlockedPopupNotification() const { diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index bfd4310..41b47bf 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -37,7 +37,7 @@ class WindowDelegate; class BlockedPopupContainer; class DOMUIHost; class DownloadItem; -class DownloadShelfView; +class DownloadShelf; class InfoBarView; class LoadNotificationDetails; class Profile; @@ -427,18 +427,18 @@ class TabContents : public PageNavigator, // Displays the download shelf and animation when a download occurs. void OnStartDownload(DownloadItem* download); - // Returns the DownloadShelfView, creating it if necessary. - DownloadShelfView* GetDownloadShelfView(); + // Returns the DownloadShelf, creating it if necessary. + DownloadShelf* GetDownloadShelf(); // Transfer the shelf view from |tab_contents| to the receiving TabContents. // |tab_contents| no longer owns the shelf after this call. The shelf is owned // by the receiving TabContents. - void MigrateShelfViewFrom(TabContents* tab_contents); + void MigrateShelfFrom(TabContents* tab_contents); // Migrate the shelf view between 2 TabContents. This helper function is // currently called by NavigationController::DiscardPendingEntry. We may // want to generalize this if we need to migrate some other state. - static void MigrateShelfView(TabContents* from, TabContents* to); + static void MigrateShelf(TabContents* from, TabContents* to); // Called when a ConstrainedWindow we own is about to be closed. void WillClose(ConstrainedWindow* window); @@ -486,10 +486,10 @@ class TabContents : public PageNavigator, // if necessary. void RepositionSupressedPopupsToFit(const gfx::Size& new_size); - // Releases the download shelf. This method is used by MigrateShelfViewFrom. + // Releases the download shelf. This method is used by MigrateShelfFrom. // Sub-classes should clear any pointer they might keep to the shelf view and - // invoke TabContents::ReleaseDownloadShelfView(). - virtual void ReleaseDownloadShelfView(); + // invoke TabContents::ReleaseDownloadShelf(). + virtual void ReleaseDownloadShelf(); // Called by derived classes to indicate that we're no longer waiting for a // response. This won't actually update the throbber, but it will get picked @@ -534,7 +534,7 @@ class TabContents : public PageNavigator, bool waiting_for_response_; // The download shelf view (view at the bottom of the page). - scoped_ptr<DownloadShelfView> download_shelf_view_; + scoped_ptr<DownloadShelf> download_shelf_; // Whether the shelf view is visible. bool shelf_visible_; diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index 6a76c15..a55f0e0 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -17,8 +17,9 @@ class HtmlDialogContentsDelegate; // TabContents and to provide necessary functionality. class TabContentsDelegate : public PageNavigator { public: - // Opens a new URL inside the passed in TabContents, if source is 0 open - // in the current front-most tab. + // Opens a new URL inside the passed in TabContents (if source is 0 open + // in the current front-most tab), unless |disposition| indicates the url + // should be opened in a new tab or window. virtual void OpenURLFromTab(TabContents* source, const GURL& url, const GURL& referrer, WindowOpenDisposition disposition, diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc index ffcb3cd..59f8b6f 100644 --- a/chrome/browser/views/download_shelf_view.cc +++ b/chrome/browser/views/download_shelf_view.cc @@ -7,7 +7,6 @@ #include <algorithm> #include "base/logging.h" -#include "chrome/browser/browser.h" #include "chrome/browser/download/download_item_model.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/tab_contents/navigation_entry.h" @@ -74,8 +73,13 @@ int CenterPosition(int size, int target_size) { } // namespace +// static +DownloadShelf* DownloadShelf::Create(TabContents* tab_contents) { + return new DownloadShelfView(tab_contents); +} + DownloadShelfView::DownloadShelfView(TabContents* tab_contents) - : tab_contents_(tab_contents) { + : DownloadShelf(tab_contents) { Init(); } @@ -107,6 +111,9 @@ void DownloadShelfView::Init() { shelf_animation_.reset(new SlideAnimation(this)); shelf_animation_->SetSlideDuration(kShelfAnimationDurationMs); shelf_animation_->Show(); + + // The download shelf view is always owned by its tab contents. + SetParentOwned(false); } void DownloadShelfView::AddDownloadView(View* view) { @@ -122,15 +129,9 @@ void DownloadShelfView::AddDownloadView(View* view) { new_item_animation_->Show(); } -void DownloadShelfView::ChangeTabContents(TabContents* old_contents, - TabContents* new_contents) { - DCHECK(old_contents == tab_contents_); - tab_contents_ = new_contents; -} - -void DownloadShelfView::AddDownload(DownloadItem* download) { +void DownloadShelfView::AddDownload(BaseDownloadItemModel* download_model) { DownloadItemView* view = new DownloadItemView( - download, this, new DownloadItemModel(download)); + download_model->download(), this, download_model); AddDownloadView(view); } @@ -259,13 +260,8 @@ void DownloadShelfView::Layout() { } } -// Open the download page. void DownloadShelfView::LinkActivated(views::Link* source, int event_flags) { - int index; - NavigationController* controller = tab_contents_->controller(); - Browser* browser = Browser::GetBrowserForController(controller, &index); - DCHECK(browser); - browser->ShowDownloadsTab(); + ShowAllDownloads(); } void DownloadShelfView::ButtonPressed(views::BaseButton* button) { diff --git a/chrome/browser/views/download_shelf_view.h b/chrome/browser/views/download_shelf_view.h index 3f157a4..9bf9032 100644 --- a/chrome/browser/views/download_shelf_view.h +++ b/chrome/browser/views/download_shelf_view.h @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H__ -#define CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H__ +#ifndef CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ +#define CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ +#include "chrome/browser/download/download_shelf.h" #include "chrome/common/slide_animation.h" #include "chrome/views/button.h" #include "chrome/views/link.h" @@ -13,7 +14,7 @@ namespace views { class ImageView; } -class DownloadItem; +class BaseDownloadItemModel; class TabContents; class DownloadAnimation; @@ -24,71 +25,52 @@ class DownloadAnimation; // To add a view representing a download to DownloadShelfView, invoke // AddDownloadView. AddDownloadView takes ownership of the passed in View. // DownloadShelfView does not hold an infinite number of download views, rather -// it'll automatically remove views once a certain point is reached. As such, -// the remove method is private. -class DownloadShelfView : public views::View, +// it'll automatically remove views once a certain point is reached. +class DownloadShelfView : public DownloadShelf, + public views::View, public views::BaseButton::ButtonListener, public views::LinkController, public AnimationDelegate { public: explicit DownloadShelfView(TabContents* tab_contents); - // A new download has started, so add it to our shelf. - void AddDownload(DownloadItem* download); - + // Implementation of View. virtual gfx::Size GetPreferredSize(); - virtual void Layout(); - - // Invokes the following methods to do painting: - // PaintBackground, PaintBorder and PaintSeparators. virtual void Paint(ChromeCanvas* canvas); - // AnimationDelegate implementations + // Implementation of AnimationDelegate. virtual void AnimationProgressed(const Animation* animation); virtual void AnimationEnded(const Animation* animation); + // Implementation of LinkController. // Invoked when the user clicks the 'show all downloads' link button. virtual void LinkActivated(views::Link* source, int event_flags); + // Implementation of ButtonListener. // Invoked when the user clicks the close button. Asks the browser to // hide the download shelf. virtual void ButtonPressed(views::BaseButton* button); + // Implementation of DownloadShelf. + virtual void AddDownload(BaseDownloadItemModel* download_model); + virtual bool IsShowing() const; + // Removes a specified download view. The supplied view is deleted after // it's removed. void RemoveDownloadView(views::View* view); + private: + void Init(); + // Adds a View representing a download to this DownloadShelfView. // DownloadShelfView takes ownership of the View, and will delete it as // necessary. void AddDownloadView(views::View* view); - // Invoked when the download shelf is migrated from one tab contents to a new - // one. - void ChangeTabContents(TabContents* old_contents, TabContents* new_contents); - - // The browser view needs to know when we are going away to properly return - // the resize corner size to WebKit so that we don't draw on top of it. - // This returns the showing state of our animation which is set to false at - // the beginning Show and true at the beginning of a Hide. - bool IsShowing() const; - - private: - void Init(); - // Paints the border. void PaintBorder(ChromeCanvas* canvas); - // Paints the separators. This invokes PaintSeparator to paint a particular - // separator. - void PaintSeparators(ChromeCanvas* canvas); - - // Paints the separator between the two views. - void PaintSeparator(ChromeCanvas* canvas, views::View* v1, views::View* v2); - - TabContents* tab_contents_; - // The animation for adding new items to the shelf. scoped_ptr<SlideAnimation> new_item_animation_; @@ -110,8 +92,8 @@ class DownloadShelfView : public views::View, // deleted by View. views::Button* close_button_; - DISALLOW_EVIL_CONSTRUCTORS(DownloadShelfView); + DISALLOW_COPY_AND_ASSIGN(DownloadShelfView); }; -#endif // CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H__ +#endif // CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H_ diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index a8eaa63..e1341f94 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -734,7 +734,7 @@ gfx::Rect BrowserView::GetRootWindowResizerRect() const { // Other tests should be added here if we add more bottom shelves. TabContents* current_tab = browser_->GetSelectedTabContents(); if (current_tab && current_tab->IsDownloadShelfVisible()) { - DownloadShelfView* download_shelf = current_tab->GetDownloadShelfView(); + DownloadShelf* download_shelf = current_tab->GetDownloadShelf(); if (download_shelf && download_shelf->IsShowing()) return gfx::Rect(); } @@ -1462,7 +1462,7 @@ bool BrowserView::MaybeShowInfoBar(TabContents* contents) { bool BrowserView::MaybeShowDownloadShelf(TabContents* contents) { views::View* new_shelf = NULL; if (contents && contents->IsDownloadShelfVisible()) { - new_shelf = contents->GetDownloadShelfView(); + new_shelf = static_cast<DownloadShelfView*>(contents->GetDownloadShelf()); if (new_shelf != active_download_shelf_) new_shelf->AddChildView(new ResizeCorner(this)); } diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 1c84127..e0a6565 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -493,7 +493,7 @@ class TabContents : public PageNavigator, public NotificationObserver { static void RegisterUserPrefs(PrefService* prefs) { prefs->RegisterBooleanPref(prefs::kBlockPopups, false); } - static void MigrateShelfView(TabContents* from, TabContents* to) { + static void MigrateShelf(TabContents* from, TabContents* to) { NOTIMPLEMENTED(); } virtual void CreateView() {} |