Fix DownloadTests and change cros/aura to use shelf

BUG=103488
TEST=DownloadTests.* browser tests

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110765

Review URL: http://codereview.chromium.org/8585040

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110770 0039d316-1c4b-4281-b951-d872f2087c98
parent 21910131
...@@ -579,7 +579,7 @@ class DownloadTest : public InProcessBrowserTest { ...@@ -579,7 +579,7 @@ class DownloadTest : public InProcessBrowserTest {
// is present in the UI (currently only on chromeos). // is present in the UI (currently only on chromeos).
void CheckDownloadUI(Browser* browser, bool expected_non_cros, void CheckDownloadUI(Browser* browser, bool expected_non_cros,
bool expected_cros, const FilePath& filename) { bool expected_cros, const FilePath& filename) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) && !defined(USE_AURA)
#if defined(TOUCH_UI) #if defined(TOUCH_UI)
TabContents* download_contents = ActiveDownloadsUI::GetPopup(NULL); TabContents* download_contents = ActiveDownloadsUI::GetPopup(NULL);
EXPECT_EQ(expected_cros, download_contents != NULL); EXPECT_EQ(expected_cros, download_contents != NULL);
...@@ -618,7 +618,7 @@ class DownloadTest : public InProcessBrowserTest { ...@@ -618,7 +618,7 @@ class DownloadTest : public InProcessBrowserTest {
#endif #endif
} }
static void ExpectWindowCountAfterDownload(size_t expected) { static void ExpectWindowCountAfterDownload(size_t expected) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) && !defined(USE_AURA)
// On ChromeOS, a download panel is created to display // On ChromeOS, a download panel is created to display
// download information, and this counts as a window. // download information, and this counts as a window.
expected++; expected++;
...@@ -784,7 +784,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, ContentDisposition) { ...@@ -784,7 +784,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, ContentDisposition) {
CheckDownloadUI(browser(), true, true, download_file); CheckDownloadUI(browser(), true, true, download_file);
} }
#if !defined(OS_CHROMEOS) // Download shelf is not per-window on ChromeOS. #if !defined(OS_CHROMEOS) || defined(USE_AURA)
// Download shelf is not per-window on ChromeOS.
// Test that the download shelf is per-window by starting a download in one // Test that the download shelf is per-window by starting a download in one
// tab, opening a second tab, closing the shelf, going back to the first tab, // tab, opening a second tab, closing the shelf, going back to the first tab,
// and checking that the shelf is closed. // and checking that the shelf is closed.
...@@ -851,7 +852,6 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, KnownSize) { ...@@ -851,7 +852,6 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, KnownSize) {
// Incognito window. // Incognito window.
IN_PROC_BROWSER_TEST_F(DownloadTest, IncognitoDownload) { IN_PROC_BROWSER_TEST_F(DownloadTest, IncognitoDownload) {
ASSERT_TRUE(InitialSetup(false)); ASSERT_TRUE(InitialSetup(false));
// Open an Incognito window. // Open an Incognito window.
Browser* incognito = CreateIncognitoBrowser(); // Waits. Browser* incognito = CreateIncognitoBrowser(); // Waits.
ASSERT_TRUE(incognito); ASSERT_TRUE(incognito);
......
...@@ -519,8 +519,7 @@ void UpdateAppIconDownloadProgress(int download_count, ...@@ -519,8 +519,7 @@ void UpdateAppIconDownloadProgress(int download_count,
bool progress_known, bool progress_known,
float progress) { float progress) {
#if defined(USE_AURA) #if defined(USE_AURA)
// TODO(beng): // TODO(davemoore) Implement once UX for download is decided <104742>
NOTIMPLEMENTED();
#elif defined(OS_WIN) #elif defined(OS_WIN)
// Taskbar progress bar is only supported on Win7. // Taskbar progress bar is only supported on Win7.
if (base::win::GetVersion() < base::win::VERSION_WIN7) if (base::win::GetVersion() < base::win::VERSION_WIN7)
......
...@@ -184,7 +184,9 @@ ...@@ -184,7 +184,9 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/ui/webui/active_downloads_ui.h" #include "chrome/browser/ui/webui/active_downloads_ui.h"
#else #endif
#if !defined(OS_CHROMEOS) || defined(USE_AURA)
#include "chrome/browser/download/download_shelf.h" #include "chrome/browser/download/download_shelf.h"
#endif #endif
...@@ -1437,11 +1439,11 @@ bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, ...@@ -1437,11 +1439,11 @@ bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
unsigned int features = FEATURE_INFOBAR | FEATURE_SIDEBAR; unsigned int features = FEATURE_INFOBAR | FEATURE_SIDEBAR;
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) || defined(USE_AURA)
// Chrome OS opens a FileBrowse pop up instead of using download shelf. // Chrome OS opens a FileBrowse pop up instead of using download shelf.
// So FEATURE_DOWNLOADSHELF is only added for non-chromeos platforms. // So FEATURE_DOWNLOADSHELF is only added for non-chromeos platforms.
features |= FEATURE_DOWNLOADSHELF; features |= FEATURE_DOWNLOADSHELF;
#endif // !defined(OS_CHROMEOS) #endif // !defined(OS_CHROMEOS) || defined(USE_AURA)
if (is_type_tabbed()) if (is_type_tabbed())
features |= FEATURE_BOOKMARKBAR; features |= FEATURE_BOOKMARKBAR;
...@@ -3724,7 +3726,7 @@ void Browser::OnStartDownload(TabContents* source, DownloadItem* download) { ...@@ -3724,7 +3726,7 @@ void Browser::OnStartDownload(TabContents* source, DownloadItem* download) {
return; return;
if (DisplayOldDownloadsUI()) { if (DisplayOldDownloadsUI()) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) && !defined(USE_AURA)
// Don't show content browser for extension/theme downloads from gallery. // Don't show content browser for extension/theme downloads from gallery.
ExtensionService* service = profile_->GetExtensionService(); ExtensionService* service = profile_->GetExtensionService();
if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) ||
...@@ -3734,7 +3736,7 @@ void Browser::OnStartDownload(TabContents* source, DownloadItem* download) { ...@@ -3734,7 +3736,7 @@ void Browser::OnStartDownload(TabContents* source, DownloadItem* download) {
// Open the Active Downloads ui for chromeos. // Open the Active Downloads ui for chromeos.
ActiveDownloadsUI::OpenPopup(profile_); ActiveDownloadsUI::OpenPopup(profile_);
} }
#elif !defined(USE_AURA) #else
// GetDownloadShelf creates the download shelf if it was not yet created. // GetDownloadShelf creates the download shelf if it was not yet created.
DownloadShelf* shelf = window()->GetDownloadShelf(); DownloadShelf* shelf = window()->GetDownloadShelf();
shelf->AddDownload(new DownloadItemModel(download)); shelf->AddDownload(new DownloadItemModel(download));
......
...@@ -128,7 +128,9 @@ ...@@ -128,7 +128,9 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h"
#include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
#else #endif
#if !defined(OS_CHROMEOS) || defined(USE_AURA)
#include "chrome/browser/ui/views/download/download_shelf_view.h" #include "chrome/browser/ui/views/download/download_shelf_view.h"
#endif #endif
...@@ -357,7 +359,7 @@ BrowserView::~BrowserView() { ...@@ -357,7 +359,7 @@ BrowserView::~BrowserView() {
} }
#endif #endif
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) || defined(USE_AURA)
// We destroy the download shelf before |browser_| to remove its child // We destroy the download shelf before |browser_| to remove its child
// download views from the set of download observers (since the observed // download views from the set of download observers (since the observed
// downloads can be destroyed along with |browser_| and the observer // downloads can be destroyed along with |browser_| and the observer
...@@ -1086,7 +1088,7 @@ void BrowserView::SetDownloadShelfVisible(bool visible) { ...@@ -1086,7 +1088,7 @@ void BrowserView::SetDownloadShelfVisible(bool visible) {
} }
bool BrowserView::IsDownloadShelfVisible() const { bool BrowserView::IsDownloadShelfVisible() const {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) && !defined(USE_AURA)
return false; return false;
#else #else
return download_shelf_.get() && download_shelf_->IsShowing(); return download_shelf_.get() && download_shelf_->IsShowing();
...@@ -1094,7 +1096,7 @@ bool BrowserView::IsDownloadShelfVisible() const { ...@@ -1094,7 +1096,7 @@ bool BrowserView::IsDownloadShelfVisible() const {
} }
DownloadShelf* BrowserView::GetDownloadShelf() { DownloadShelf* BrowserView::GetDownloadShelf() {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) && !defined(USE_AURA)
NOTREACHED(); NOTREACHED();
return NULL; return NULL;
#else #else
...@@ -1742,7 +1744,7 @@ void BrowserView::GetAccessiblePanes( ...@@ -1742,7 +1744,7 @@ void BrowserView::GetAccessiblePanes(
panes->push_back(bookmark_bar_view_.get()); panes->push_back(bookmark_bar_view_.get());
if (infobar_container_) if (infobar_container_)
panes->push_back(infobar_container_); panes->push_back(infobar_container_);
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) || defined(USE_AURA)
if (download_shelf_.get()) if (download_shelf_.get())
panes->push_back(download_shelf_.get()); panes->push_back(download_shelf_.get());
#endif #endif
......
...@@ -629,7 +629,7 @@ class BrowserView : public BrowserBubbleHost, ...@@ -629,7 +629,7 @@ class BrowserView : public BrowserBubbleHost,
// The Bookmark Bar View for this window. Lazily created. // The Bookmark Bar View for this window. Lazily created.
scoped_ptr<BookmarkBarView> bookmark_bar_view_; scoped_ptr<BookmarkBarView> bookmark_bar_view_;
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) || defined(USE_AURA)
// The download shelf view (view at the bottom of the page). ChromiumOS // The download shelf view (view at the bottom of the page). ChromiumOS
// uses ActiveDownloadsUI instead. // uses ActiveDownloadsUI instead.
scoped_ptr<DownloadShelfView> download_shelf_; scoped_ptr<DownloadShelfView> download_shelf_;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "ui/gfx/size.h" #include "ui/gfx/size.h"
#include "views/controls/single_split_view.h" #include "views/controls/single_split_view.h"
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) || defined(USE_AURA)
#include "chrome/browser/ui/views/download/download_shelf_view.h" #include "chrome/browser/ui/views/download/download_shelf_view.h"
#endif #endif
...@@ -231,7 +231,7 @@ void BrowserViewLayout::ViewAdded(views::View* host, views::View* view) { ...@@ -231,7 +231,7 @@ void BrowserViewLayout::ViewAdded(views::View* host, views::View* view) {
infobar_container_ = view; infobar_container_ = view;
break; break;
case VIEW_ID_DOWNLOAD_SHELF: case VIEW_ID_DOWNLOAD_SHELF:
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) || defined(USE_AURA)
download_shelf_ = static_cast<DownloadShelfView*>(view); download_shelf_ = static_cast<DownloadShelfView*>(view);
#else #else
NOTREACHED(); NOTREACHED();
...@@ -514,7 +514,7 @@ int BrowserViewLayout::GetTopMarginForActiveContent() { ...@@ -514,7 +514,7 @@ int BrowserViewLayout::GetTopMarginForActiveContent() {
} }
int BrowserViewLayout::LayoutDownloadShelf(int bottom) { int BrowserViewLayout::LayoutDownloadShelf(int bottom) {
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS) || defined(USE_AURA)
// Re-layout the shelf either if it is visible or if it's close animation // Re-layout the shelf either if it is visible or if it's close animation
// is currently running. ChromiumOS uses ActiveDownloadsUI instead of // is currently running. ChromiumOS uses ActiveDownloadsUI instead of
// DownloadShelf. // DownloadShelf.
......
...@@ -3343,7 +3343,7 @@ ...@@ -3343,7 +3343,7 @@
'browser/ui/views/download/download_shelf_context_menu_view.h', 'browser/ui/views/download/download_shelf_context_menu_view.h',
'browser/ui/views/download/download_shelf_view.cc', 'browser/ui/views/download/download_shelf_view.cc',
'browser/ui/views/download/download_shelf_view.h', 'browser/ui/views/download/download_shelf_view.h',
'browser/ui/views/download/download_started_animation_win.cc', 'browser/ui/views/download/download_started_animation_views.cc',
'browser/ui/views/dropdown_bar_host.cc', 'browser/ui/views/dropdown_bar_host.cc',
'browser/ui/views/dropdown_bar_host.h', 'browser/ui/views/dropdown_bar_host.h',
'browser/ui/views/dropdown_bar_host_aura.cc', 'browser/ui/views/dropdown_bar_host_aura.cc',
...@@ -4750,6 +4750,7 @@ ...@@ -4750,6 +4750,7 @@
['include', '^browser/ui/views/download/download_shelf_context_menu_view.h'], ['include', '^browser/ui/views/download/download_shelf_context_menu_view.h'],
['include', '^browser/ui/views/download/download_shelf_view.cc'], ['include', '^browser/ui/views/download/download_shelf_view.cc'],
['include', '^browser/ui/views/download/download_shelf_view.h'], ['include', '^browser/ui/views/download/download_shelf_view.h'],
['include', '^browser/ui/views/download/download_started_animation_views.cc'],
['include', '^browser/ui/views/dropdown_bar_host.cc'], ['include', '^browser/ui/views/dropdown_bar_host.cc'],
['include', '^browser/ui/views/dropdown_bar_host.h'], ['include', '^browser/ui/views/dropdown_bar_host.h'],
['include', '^browser/ui/views/dropdown_bar_host_gtk.cc'], ['include', '^browser/ui/views/dropdown_bar_host_gtk.cc'],
...@@ -5075,6 +5076,13 @@ ...@@ -5075,6 +5076,13 @@
['exclude', '^browser/notifications/balloon_collection_views.cc'], ['exclude', '^browser/notifications/balloon_collection_views.cc'],
['exclude', '^chromeos/legacy_window_manager/initial_browser_window_observer.cc'], ['exclude', '^chromeos/legacy_window_manager/initial_browser_window_observer.cc'],
['exclude', '^chromeos/legacy_window_manager/initial_browser_window_observer.h'], ['exclude', '^chromeos/legacy_window_manager/initial_browser_window_observer.h'],
['exclude', '^browser/download/download_shelf.h'],
['exclude', '^browser/ui/views/download/download_item_view.cc'],
['exclude', '^browser/ui/views/download/download_item_view.h'],
['exclude', '^browser/ui/views/download/download_shelf_context_menu_view.cc'],
['exclude', '^browser/ui/views/download/download_shelf_context_menu_view.h'],
['exclude', '^browser/ui/views/download/download_shelf_view.cc'],
['exclude', '^browser/ui/views/download/download_shelf_view.h'],
], ],
}], }],
['chromeos==1',{ ['chromeos==1',{
...@@ -5084,17 +5092,8 @@ ...@@ -5084,17 +5092,8 @@
['include', '^browser/ui/gtk/simple_message_box_gtk.cc'], ['include', '^browser/ui/gtk/simple_message_box_gtk.cc'],
['include', '^browser/ui/views/omnibox/omnibox_view_views.cc'], ['include', '^browser/ui/views/omnibox/omnibox_view_views.cc'],
['include', '^browser/ui/views/omnibox/omnibox_view_views.h'], ['include', '^browser/ui/views/omnibox/omnibox_view_views.h'],
['exclude', '^browser/download/download_shelf.h'],
['exclude', '^browser/download/download_shelf_context_menu.cc'],
['exclude', '^browser/download/download_shelf_context_menu.h'],
['exclude', '^browser/extensions/extension_tts_api_linux.cc'], ['exclude', '^browser/extensions/extension_tts_api_linux.cc'],
['exclude', '^browser/notifications/balloon_collection_gtk.cc'], ['exclude', '^browser/notifications/balloon_collection_gtk.cc'],
['exclude', '^browser/ui/views/download/download_item_view.cc'],
['exclude', '^browser/ui/views/download/download_item_view.h'],
['exclude', '^browser/ui/views/download/download_shelf_context_menu_view.cc'],
['exclude', '^browser/ui/views/download/download_shelf_context_menu_view.h'],
['exclude', '^browser/ui/views/download/download_shelf_view.cc'],
['exclude', '^browser/ui/views/download/download_shelf_view.h'],
], ],
'dependencies': [ 'dependencies': [
'../dbus/dbus.gyp:dbus', '../dbus/dbus.gyp:dbus',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment