| 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 3713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3724 | 3724 |
| 3725 if (DisplayOldDownloadsUI()) { | 3725 if (DisplayOldDownloadsUI()) { |
| 3726 #if defined(USE_AURA) | 3726 #if defined(USE_AURA) |
| 3727 // TODO(saintlou): There is no implementation for Aura. | 3727 // TODO(saintlou): There is no implementation for Aura. |
| 3728 #elif defined(OS_CHROMEOS) | 3728 #elif defined(OS_CHROMEOS) |
| 3729 // Don't show content browser for extension/theme downloads from gallery. | 3729 // Don't show content browser for extension/theme downloads from gallery. |
| 3730 ExtensionService* service = profile_->GetExtensionService(); | 3730 ExtensionService* service = profile_->GetExtensionService(); |
| 3731 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || | 3731 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || |
| 3732 (service == NULL) || | 3732 (service == NULL) || |
| 3733 !service->IsDownloadFromGallery(download->GetURL(), | 3733 !service->IsDownloadFromGallery(download->GetURL(), |
| 3734 download->referrer_url())) { | 3734 download->GetReferrerUrl())) { |
| 3735 // Open the Active Downloads ui for chromeos. | 3735 // Open the Active Downloads ui for chromeos. |
| 3736 ActiveDownloadsUI::OpenPopup(profile_); | 3736 ActiveDownloadsUI::OpenPopup(profile_); |
| 3737 } | 3737 } |
| 3738 #else | 3738 #else |
| 3739 // GetDownloadShelf creates the download shelf if it was not yet created. | 3739 // GetDownloadShelf creates the download shelf if it was not yet created. |
| 3740 DownloadShelf* shelf = window()->GetDownloadShelf(); | 3740 DownloadShelf* shelf = window()->GetDownloadShelf(); |
| 3741 shelf->AddDownload(new DownloadItemModel(download)); | 3741 shelf->AddDownload(new DownloadItemModel(download)); |
| 3742 // Don't show the animation for "Save file" downloads. | 3742 // Don't show the animation for "Save file" downloads. |
| 3743 // For non-theme extensions, we don't show the download animation. | 3743 // For non-theme extensions, we don't show the download animation. |
| 3744 // Show animation in same window as the download shelf. Download shelf | 3744 // Show animation in same window as the download shelf. Download shelf |
| 3745 // may not be in the same window that initiated the download, e.g. | 3745 // may not be in the same window that initiated the download, e.g. |
| 3746 // Panels. | 3746 // Panels. |
| 3747 // Don't show the animation if the selected tab is not visible (i.e. the | 3747 // Don't show the animation if the selected tab is not visible (i.e. the |
| 3748 // window is minimized, we're in a unit test, etc.). | 3748 // window is minimized, we're in a unit test, etc.). |
| 3749 TabContents* shelf_tab = shelf->browser()->GetSelectedTabContents(); | 3749 TabContents* shelf_tab = shelf->browser()->GetSelectedTabContents(); |
| 3750 if ((download->total_bytes() > 0) && | 3750 if ((download->GetTotalBytes() > 0) && |
| 3751 !ChromeDownloadManagerDelegate::IsExtensionDownload(download) && | 3751 !ChromeDownloadManagerDelegate::IsExtensionDownload(download) && |
| 3752 platform_util::IsVisible(shelf_tab->GetNativeView()) && | 3752 platform_util::IsVisible(shelf_tab->GetNativeView()) && |
| 3753 ui::Animation::ShouldRenderRichAnimation()) { | 3753 ui::Animation::ShouldRenderRichAnimation()) { |
| 3754 DownloadStartedAnimation::Show(shelf_tab); | 3754 DownloadStartedAnimation::Show(shelf_tab); |
| 3755 } | 3755 } |
| 3756 #endif | 3756 #endif |
| 3757 } | 3757 } |
| 3758 | 3758 |
| 3759 // If the download occurs in a new tab, close it. | 3759 // If the download occurs in a new tab, close it. |
| 3760 if (source->controller().IsInitialNavigation() && tab_count() > 1) | 3760 if (source->controller().IsInitialNavigation() && tab_count() > 1) |
| (...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5509 } | 5509 } |
| 5510 | 5510 |
| 5511 void Browser::UpdateFullscreenExitBubbleContent() { | 5511 void Browser::UpdateFullscreenExitBubbleContent() { |
| 5512 GURL url; | 5512 GURL url; |
| 5513 if (fullscreened_tab_) | 5513 if (fullscreened_tab_) |
| 5514 url = fullscreened_tab_->tab_contents()->GetURL(); | 5514 url = fullscreened_tab_->tab_contents()->GetURL(); |
| 5515 | 5515 |
| 5516 window_->UpdateFullscreenExitBubbleContent( | 5516 window_->UpdateFullscreenExitBubbleContent( |
| 5517 url, GetFullscreenExitBubbleType()); | 5517 url, GetFullscreenExitBubbleType()); |
| 5518 } | 5518 } |
| OLD | NEW |