OLD | NEW |
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 Loading... |
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 |
| 189 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
188 #include "chrome/browser/download/download_shelf.h" | 190 #include "chrome/browser/download/download_shelf.h" |
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 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) || defined(USE_AURA) |
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()) |
1451 features |= FEATURE_TITLEBAR; | 1453 features |= FEATURE_TITLEBAR; |
1452 | 1454 |
1453 if (is_type_tabbed()) | 1455 if (is_type_tabbed()) |
1454 features |= FEATURE_TABSTRIP; | 1456 features |= FEATURE_TABSTRIP; |
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3717 // Download in a constrained popup is shown in the tab that opened it. | 3719 // Download in a constrained popup is shown in the tab that opened it. |
3718 TabContents* constrained_tab = constrained->tab_contents(); | 3720 TabContents* constrained_tab = constrained->tab_contents(); |
3719 constrained_tab->delegate()->OnStartDownload(constrained_tab, download); | 3721 constrained_tab->delegate()->OnStartDownload(constrained_tab, download); |
3720 return; | 3722 return; |
3721 } | 3723 } |
3722 | 3724 |
3723 if (!window()) | 3725 if (!window()) |
3724 return; | 3726 return; |
3725 | 3727 |
3726 if (DisplayOldDownloadsUI()) { | 3728 if (DisplayOldDownloadsUI()) { |
3727 #if defined(OS_CHROMEOS) | 3729 #if defined(OS_CHROMEOS) && !defined(USE_AURA) |
3728 // Don't show content browser for extension/theme downloads from gallery. | 3730 // Don't show content browser for extension/theme downloads from gallery. |
3729 ExtensionService* service = profile_->GetExtensionService(); | 3731 ExtensionService* service = profile_->GetExtensionService(); |
3730 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || | 3732 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || |
3731 (service == NULL) || | 3733 (service == NULL) || |
3732 !service->IsDownloadFromGallery(download->GetURL(), | 3734 !service->IsDownloadFromGallery(download->GetURL(), |
3733 download->referrer_url())) { | 3735 download->referrer_url())) { |
3734 // Open the Active Downloads ui for chromeos. | 3736 // Open the Active Downloads ui for chromeos. |
3735 ActiveDownloadsUI::OpenPopup(profile_); | 3737 ActiveDownloadsUI::OpenPopup(profile_); |
3736 } | 3738 } |
3737 #elif !defined(USE_AURA) | 3739 #else |
3738 // GetDownloadShelf creates the download shelf if it was not yet created. | 3740 // GetDownloadShelf creates the download shelf if it was not yet created. |
3739 DownloadShelf* shelf = window()->GetDownloadShelf(); | 3741 DownloadShelf* shelf = window()->GetDownloadShelf(); |
3740 shelf->AddDownload(new DownloadItemModel(download)); | 3742 shelf->AddDownload(new DownloadItemModel(download)); |
3741 // Don't show the animation for "Save file" downloads. | 3743 // Don't show the animation for "Save file" downloads. |
3742 // For non-theme extensions, we don't show the download animation. | 3744 // For non-theme extensions, we don't show the download animation. |
3743 // Show animation in same window as the download shelf. Download shelf | 3745 // Show animation in same window as the download shelf. Download shelf |
3744 // may not be in the same window that initiated the download, e.g. | 3746 // may not be in the same window that initiated the download, e.g. |
3745 // Panels. | 3747 // Panels. |
3746 // Don't show the animation if the selected tab is not visible (i.e. the | 3748 // Don't show the animation if the selected tab is not visible (i.e. the |
3747 // window is minimized, we're in a unit test, etc.). | 3749 // window is minimized, we're in a unit test, etc.). |
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5522 } | 5524 } |
5523 | 5525 |
5524 void Browser::UpdateFullscreenExitBubbleContent() { | 5526 void Browser::UpdateFullscreenExitBubbleContent() { |
5525 GURL url; | 5527 GURL url; |
5526 if (fullscreened_tab_) | 5528 if (fullscreened_tab_) |
5527 url = fullscreened_tab_->tab_contents()->GetURL(); | 5529 url = fullscreened_tab_->tab_contents()->GetURL(); |
5528 | 5530 |
5529 window_->UpdateFullscreenExitBubbleContent( | 5531 window_->UpdateFullscreenExitBubbleContent( |
5530 url, GetFullscreenExitBubbleType()); | 5532 url, GetFullscreenExitBubbleType()); |
5531 } | 5533 } |
OLD | NEW |