Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(806)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 8585040: Fix DownloadTests and change cros/aura to use shelf (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 #include "ui/base/win/shell.h" 177 #include "ui/base/win/shell.h"
178 #endif // OS_WIN 178 #endif // OS_WIN
179 179
180 #if defined(OS_MACOSX) 180 #if defined(OS_MACOSX)
181 #include "content/browser/find_pasteboard.h" 181 #include "content/browser/find_pasteboard.h"
182 #endif 182 #endif
183 183
184 #if defined(OS_CHROMEOS) 184 #if defined(OS_CHROMEOS)
185 #include "chrome/browser/chromeos/boot_times_loader.h" 185 #include "chrome/browser/chromeos/boot_times_loader.h"
186 #include "chrome/browser/ui/webui/active_downloads_ui.h" 186 #include "chrome/browser/ui/webui/active_downloads_ui.h"
187 #else 187 #endif
188 #include "chrome/browser/download/download_shelf.h" 188
189 #if !defined(OS_CHROMEOS) || defined(USE_AURA)
190 #include "chrome/browser/ui/views/download/download_shelf_view.h"
Ben Goodger (Google) 2011/11/17 22:28:37 We can't include views code here, it's a layering
DaveMoore 2011/11/18 18:17:35 It was a copy / paste mistake. On 2011/11/17 22:2
189 #endif 191 #endif
190 192
191 #if defined(FILE_MANAGER_EXTENSION) 193 #if defined(FILE_MANAGER_EXTENSION)
192 #include "chrome/browser/extensions/file_manager_util.h" 194 #include "chrome/browser/extensions/file_manager_util.h"
193 #endif 195 #endif
194 196
195 using base::TimeDelta; 197 using base::TimeDelta;
196 198
197 /////////////////////////////////////////////////////////////////////////////// 199 ///////////////////////////////////////////////////////////////////////////////
198 200
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 // On Mac, fullscreen mode has most normal things (in a slide-down panel). On 1432 // On Mac, fullscreen mode has most normal things (in a slide-down panel). On
1431 // other platforms, we hide some controls when in fullscreen mode. 1433 // other platforms, we hide some controls when in fullscreen mode.
1432 bool hide_ui_for_fullscreen = false; 1434 bool hide_ui_for_fullscreen = false;
1433 #if !defined(OS_MACOSX) 1435 #if !defined(OS_MACOSX)
1434 hide_ui_for_fullscreen = check_fullscreen && window_ && 1436 hide_ui_for_fullscreen = check_fullscreen && window_ &&
1435 window_->IsFullscreen(); 1437 window_->IsFullscreen();
1436 #endif 1438 #endif
1437 1439
1438 unsigned int features = FEATURE_INFOBAR | FEATURE_SIDEBAR; 1440 unsigned int features = FEATURE_INFOBAR | FEATURE_SIDEBAR;
1439 1441
1440 #if !defined(OS_CHROMEOS) 1442 #if !defined(OS_CHROMEOS) || defined(USE_AURA)
1441 // Chrome OS opens a FileBrowse pop up instead of using download shelf. 1443 // Chrome OS opens a FileBrowse pop up instead of using download shelf.
1442 // So FEATURE_DOWNLOADSHELF is only added for non-chromeos platforms. 1444 // So FEATURE_DOWNLOADSHELF is only added for non-chromeos platforms.
1443 features |= FEATURE_DOWNLOADSHELF; 1445 features |= FEATURE_DOWNLOADSHELF;
1444 #endif // !defined(OS_CHROMEOS) 1446 #endif // !defined(OS_CHROMEOS)
1445 1447
1446 if (is_type_tabbed()) 1448 if (is_type_tabbed())
1447 features |= FEATURE_BOOKMARKBAR; 1449 features |= FEATURE_BOOKMARKBAR;
1448 1450
1449 if (!hide_ui_for_fullscreen) { 1451 if (!hide_ui_for_fullscreen) {
1450 if (!is_type_tabbed()) 1452 if (!is_type_tabbed())
(...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after
3709 // Download in a constrained popup is shown in the tab that opened it. 3711 // Download in a constrained popup is shown in the tab that opened it.
3710 TabContents* constrained_tab = constrained->tab_contents(); 3712 TabContents* constrained_tab = constrained->tab_contents();
3711 constrained_tab->delegate()->OnStartDownload(constrained_tab, download); 3713 constrained_tab->delegate()->OnStartDownload(constrained_tab, download);
3712 return; 3714 return;
3713 } 3715 }
3714 3716
3715 if (!window()) 3717 if (!window())
3716 return; 3718 return;
3717 3719
3718 if (DisplayOldDownloadsUI()) { 3720 if (DisplayOldDownloadsUI()) {
3719 #if defined(OS_CHROMEOS) 3721 #if defined(OS_CHROMEOS) && !defined(USE_AURA)
3720 // Don't show content browser for extension/theme downloads from gallery. 3722 // Don't show content browser for extension/theme downloads from gallery.
3721 ExtensionService* service = profile_->GetExtensionService(); 3723 ExtensionService* service = profile_->GetExtensionService();
3722 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || 3724 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) ||
3723 (service == NULL) || 3725 (service == NULL) ||
3724 !service->IsDownloadFromGallery(download->GetURL(), 3726 !service->IsDownloadFromGallery(download->GetURL(),
3725 download->referrer_url())) { 3727 download->referrer_url())) {
3726 // Open the Active Downloads ui for chromeos. 3728 // Open the Active Downloads ui for chromeos.
3727 ActiveDownloadsUI::OpenPopup(profile_); 3729 ActiveDownloadsUI::OpenPopup(profile_);
3728 } 3730 }
3729 #elif !defined(USE_AURA) 3731 #else
3730 // GetDownloadShelf creates the download shelf if it was not yet created. 3732 // GetDownloadShelf creates the download shelf if it was not yet created.
3731 DownloadShelf* shelf = window()->GetDownloadShelf(); 3733 DownloadShelf* shelf = window()->GetDownloadShelf();
3732 shelf->AddDownload(new DownloadItemModel(download)); 3734 shelf->AddDownload(new DownloadItemModel(download));
3733 // Don't show the animation for "Save file" downloads. 3735 // Don't show the animation for "Save file" downloads.
3734 // For non-theme extensions, we don't show the download animation. 3736 // For non-theme extensions, we don't show the download animation.
3735 // Show animation in same window as the download shelf. Download shelf 3737 // Show animation in same window as the download shelf. Download shelf
3736 // may not be in the same window that initiated the download, e.g. 3738 // may not be in the same window that initiated the download, e.g.
3737 // Panels. 3739 // Panels.
3738 // Don't show the animation if the selected tab is not visible (i.e. the 3740 // Don't show the animation if the selected tab is not visible (i.e. the
3739 // window is minimized, we're in a unit test, etc.). 3741 // window is minimized, we're in a unit test, etc.).
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
5514 } 5516 }
5515 5517
5516 void Browser::UpdateFullscreenExitBubbleContent() { 5518 void Browser::UpdateFullscreenExitBubbleContent() {
5517 GURL url; 5519 GURL url;
5518 if (fullscreened_tab_) 5520 if (fullscreened_tab_)
5519 url = fullscreened_tab_->tab_contents()->GetURL(); 5521 url = fullscreened_tab_->tab_contents()->GetURL();
5520 5522
5521 window_->UpdateFullscreenExitBubbleContent( 5523 window_->UpdateFullscreenExitBubbleContent(
5522 url, GetFullscreenExitBubbleType()); 5524 url, GetFullscreenExitBubbleType());
5523 } 5525 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698