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 3763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3774 shelf->AddDownload(new DownloadItemModel(download)); | 3774 shelf->AddDownload(new DownloadItemModel(download)); |
3775 // Don't show the animation for "Save file" downloads. | 3775 // Don't show the animation for "Save file" downloads. |
3776 // For non-theme extensions, we don't show the download animation. | 3776 // For non-theme extensions, we don't show the download animation. |
3777 // Show animation in same window as the download shelf. Download shelf | 3777 // Show animation in same window as the download shelf. Download shelf |
3778 // may not be in the same window that initiated the download, e.g. | 3778 // may not be in the same window that initiated the download, e.g. |
3779 // Panels. | 3779 // Panels. |
3780 // Don't show the animation if the selected tab is not visible (i.e. the | 3780 // Don't show the animation if the selected tab is not visible (i.e. the |
3781 // window is minimized, we're in a unit test, etc.). | 3781 // window is minimized, we're in a unit test, etc.). |
3782 TabContents* shelf_tab = shelf->browser()->GetSelectedTabContents(); | 3782 TabContents* shelf_tab = shelf->browser()->GetSelectedTabContents(); |
3783 if ((download->total_bytes() > 0) && | 3783 if ((download->total_bytes() > 0) && |
3784 (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || | 3784 !ChromeDownloadManagerDelegate::IsExtensionDownload(download) && |
3785 ExtensionService::IsDownloadFromMiniGallery(download->GetURL())) && | |
3786 platform_util::IsVisible(shelf_tab->GetNativeView()) && | 3785 platform_util::IsVisible(shelf_tab->GetNativeView()) && |
3787 ui::Animation::ShouldRenderRichAnimation()) { | 3786 ui::Animation::ShouldRenderRichAnimation()) { |
3788 DownloadStartedAnimation::Show(shelf_tab); | 3787 DownloadStartedAnimation::Show(shelf_tab); |
3789 } | 3788 } |
3790 #endif | 3789 #endif |
3791 } | 3790 } |
3792 | 3791 |
3793 // If the download occurs in a new tab, close it. | 3792 // If the download occurs in a new tab, close it. |
3794 if (source->controller().IsInitialNavigation() && tab_count() > 1) | 3793 if (source->controller().IsInitialNavigation() && tab_count() > 1) |
3795 CloseContents(source); | 3794 CloseContents(source); |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4296 // makes it possible for us to end up here before window creation has | 4295 // makes it possible for us to end up here before window creation has |
4297 // completed,at which point window_ is NULL. See 94752 for details. | 4296 // completed,at which point window_ is NULL. See 94752 for details. |
4298 if (window() && window()->GetLocationBar()) | 4297 if (window() && window()->GetLocationBar()) |
4299 window()->GetLocationBar()->UpdatePageActions(); | 4298 window()->GetLocationBar()->UpdatePageActions(); |
4300 break; | 4299 break; |
4301 | 4300 |
4302 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: | 4301 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: |
4303 window()->UserChangedTheme(); | 4302 window()->UserChangedTheme(); |
4304 break; | 4303 break; |
4305 | 4304 |
4306 case chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL: { | 4305 case chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL: { |
Mihai Parparita -not on Chrome
2011/10/26 21:59:55
Seems like this whole case statement (as well as t
Yoyo Zhou
2011/10/26 22:22:46
Good catch; in fact, we can remove this notificati
| |
4307 Profile* profile = content::Source<Profile>(source).ptr(); | 4306 Profile* profile = content::Source<Profile>(source).ptr(); |
4308 if (profile_->IsSameProfile(profile)) { | 4307 if (profile_->IsSameProfile(profile)) { |
4309 // Handle EXTENSION_READY_FOR_INSTALL for last active tabbed browser. | 4308 // Handle EXTENSION_READY_FOR_INSTALL for last active tabbed browser. |
4310 if (BrowserList::FindTabbedBrowser(profile, true) == this) { | 4309 if (BrowserList::FindTabbedBrowser(profile, true) == this) { |
4311 // We only want to show the loading dialog for themes, but we don't | 4310 // We only want to show the loading dialog for themes, but we don't |
4312 // want to wait until unpack to find out an extension is a theme, so | 4311 // want to wait until unpack to find out an extension is a theme, so |
4313 // we test the download_url GURL instead. This means that themes in | 4312 // we test the download_url GURL instead. This means that themes in |
4314 // the extensions gallery won't get the loading dialog. | 4313 // the extensions gallery won't get the loading dialog. |
4315 GURL download_url = *(content::Details<GURL>(details).ptr()); | 4314 GURL download_url = *(content::Details<GURL>(details).ptr()); |
4316 if (ExtensionService::IsDownloadFromMiniGallery(download_url)) | |
4317 window()->ShowThemeInstallBubble(); | |
4318 } | 4315 } |
4319 } | 4316 } |
4320 break; | 4317 break; |
4321 } | 4318 } |
4322 | 4319 |
4323 case chrome::NOTIFICATION_PREF_CHANGED: { | 4320 case chrome::NOTIFICATION_PREF_CHANGED: { |
4324 const std::string& pref_name = | 4321 const std::string& pref_name = |
4325 *content::Details<std::string>(details).ptr(); | 4322 *content::Details<std::string>(details).ptr(); |
4326 if (pref_name == prefs::kPrintingEnabled) { | 4323 if (pref_name == prefs::kPrintingEnabled) { |
4327 UpdatePrintingState(GetContentRestrictionsForSelectedTab()); | 4324 UpdatePrintingState(GetContentRestrictionsForSelectedTab()); |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5515 } | 5512 } |
5516 | 5513 |
5517 void Browser::UpdateFullscreenExitBubbleContent() { | 5514 void Browser::UpdateFullscreenExitBubbleContent() { |
5518 GURL url; | 5515 GURL url; |
5519 if (fullscreened_tab_) | 5516 if (fullscreened_tab_) |
5520 url = fullscreened_tab_->tab_contents()->GetURL(); | 5517 url = fullscreened_tab_->tab_contents()->GetURL(); |
5521 | 5518 |
5522 window_->UpdateFullscreenExitBubbleContent( | 5519 window_->UpdateFullscreenExitBubbleContent( |
5523 url, GetFullscreenExitBubbleType()); | 5520 url, GetFullscreenExitBubbleType()); |
5524 } | 5521 } |
OLD | NEW |