| 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 3710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3721 TabContents* constrained_tab = constrained->tab_contents(); | 3721 TabContents* constrained_tab = constrained->tab_contents(); |
| 3722 constrained_tab->delegate()->OnStartDownload(constrained_tab, download); | 3722 constrained_tab->delegate()->OnStartDownload(constrained_tab, download); |
| 3723 return; | 3723 return; |
| 3724 } | 3724 } |
| 3725 | 3725 |
| 3726 if (!window()) | 3726 if (!window()) |
| 3727 return; | 3727 return; |
| 3728 | 3728 |
| 3729 if (DisplayOldDownloadsUI()) { | 3729 if (DisplayOldDownloadsUI()) { |
| 3730 #if defined(OS_CHROMEOS) && !defined(USE_AURA) | 3730 #if defined(OS_CHROMEOS) && !defined(USE_AURA) |
| 3731 // Don't show content browser for extension/theme downloads from gallery. | 3731 if (ActiveDownloadsUI::ShouldShowPopup(profile_, download)) |
| 3732 ExtensionService* service = profile_->GetExtensionService(); | |
| 3733 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || | |
| 3734 service == NULL || | |
| 3735 !service->IsDownloadFromGallery(download->GetURL(), | |
| 3736 download->GetReferrerUrl())) { | |
| 3737 // Open the Active Downloads ui for chromeos. | |
| 3738 ActiveDownloadsUI::OpenPopup(profile_); | 3732 ActiveDownloadsUI::OpenPopup(profile_); |
| 3739 } | |
| 3740 #else | 3733 #else |
| 3741 // GetDownloadShelf creates the download shelf if it was not yet created. | 3734 // GetDownloadShelf creates the download shelf if it was not yet created. |
| 3742 DownloadShelf* shelf = window()->GetDownloadShelf(); | 3735 DownloadShelf* shelf = window()->GetDownloadShelf(); |
| 3743 shelf->AddDownload(new DownloadItemModel(download)); | 3736 shelf->AddDownload(new DownloadItemModel(download)); |
| 3744 // Don't show the animation for "Save file" downloads. | 3737 // Don't show the animation for "Save file" downloads. |
| 3745 // For non-theme extensions, we don't show the download animation. | 3738 // For non-theme extensions, we don't show the download animation. |
| 3746 // Show animation in same window as the download shelf. Download shelf | 3739 // Show animation in same window as the download shelf. Download shelf |
| 3747 // may not be in the same window that initiated the download, e.g. | 3740 // may not be in the same window that initiated the download, e.g. |
| 3748 // Panels. | 3741 // Panels. |
| 3749 // Don't show the animation if the selected tab is not visible (i.e. the | 3742 // Don't show the animation if the selected tab is not visible (i.e. the |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5353 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5346 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
| 5354 } else { | 5347 } else { |
| 5355 GlobalErrorService* service = | 5348 GlobalErrorService* service = |
| 5356 GlobalErrorServiceFactory::GetForProfile(profile()); | 5349 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5357 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5350 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5358 if (error) { | 5351 if (error) { |
| 5359 error->ShowBubbleView(this); | 5352 error->ShowBubbleView(this); |
| 5360 } | 5353 } |
| 5361 } | 5354 } |
| 5362 } | 5355 } |
| OLD | NEW |