| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "app/animation.h" | 7 #include "app/animation.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/gfx/point.h" | 10 #include "base/gfx/point.h" |
| (...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 } | 2148 } |
| 2149 | 2149 |
| 2150 void Browser::OnStartDownload(DownloadItem* download) { | 2150 void Browser::OnStartDownload(DownloadItem* download) { |
| 2151 if (!window()) | 2151 if (!window()) |
| 2152 return; | 2152 return; |
| 2153 | 2153 |
| 2154 // GetDownloadShelf creates the download shelf if it was not yet created. | 2154 // GetDownloadShelf creates the download shelf if it was not yet created. |
| 2155 window()->GetDownloadShelf()->AddDownload(new DownloadItemModel(download)); | 2155 window()->GetDownloadShelf()->AddDownload(new DownloadItemModel(download)); |
| 2156 | 2156 |
| 2157 // Don't show the animation for "Save file" downloads. | 2157 // Don't show the animation for "Save file" downloads. |
| 2158 if (download->total_bytes() > 0) { | 2158 if (download->total_bytes() <= 0) |
| 2159 TabContents* current_tab = GetSelectedTabContents(); | 2159 return; |
| 2160 // We make this check for the case of minimized windows, unit tests, etc. | 2160 |
| 2161 if (platform_util::IsVisible(current_tab->GetNativeView()) && | 2161 // For non-theme extensions, we don't show the download animation. |
| 2162 Animation::ShouldRenderRichAnimation()) | 2162 if (DownloadManager::IsExtensionInstall(download) && |
| 2163 DownloadStartedAnimation::Show(current_tab); | 2163 !ExtensionsService::IsDownloadFromMiniGallery(download->url())) |
| 2164 } | 2164 return; |
| 2165 |
| 2166 TabContents* current_tab = GetSelectedTabContents(); |
| 2167 // We make this check for the case of minimized windows, unit tests, etc. |
| 2168 if (platform_util::IsVisible(current_tab->GetNativeView()) && |
| 2169 Animation::ShouldRenderRichAnimation()) |
| 2170 DownloadStartedAnimation::Show(current_tab); |
| 2165 } | 2171 } |
| 2166 | 2172 |
| 2167 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, | 2173 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, |
| 2168 Profile* profile) { | 2174 Profile* profile) { |
| 2169 window()->ConfirmAddSearchProvider(template_url, profile); | 2175 window()->ConfirmAddSearchProvider(template_url, profile); |
| 2170 } | 2176 } |
| 2171 | 2177 |
| 2172 void Browser::ShowPageInfo(Profile* profile, | 2178 void Browser::ShowPageInfo(Profile* profile, |
| 2173 const GURL& url, | 2179 const GURL& url, |
| 2174 const NavigationEntry::SSLStatus& ssl, | 2180 const NavigationEntry::SSLStatus& ssl, |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3037 /////////////////////////////////////////////////////////////////////////////// | 3043 /////////////////////////////////////////////////////////////////////////////// |
| 3038 // BrowserToolbarModel (private): | 3044 // BrowserToolbarModel (private): |
| 3039 | 3045 |
| 3040 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 3046 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 3041 // This |current_tab| can be NULL during the initialization of the | 3047 // This |current_tab| can be NULL during the initialization of the |
| 3042 // toolbar during window creation (i.e. before any tabs have been added | 3048 // toolbar during window creation (i.e. before any tabs have been added |
| 3043 // to the window). | 3049 // to the window). |
| 3044 TabContents* current_tab = browser_->GetSelectedTabContents(); | 3050 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 3045 return current_tab ? ¤t_tab->controller() : NULL; | 3051 return current_tab ? ¤t_tab->controller() : NULL; |
| 3046 } | 3052 } |
| OLD | NEW |