Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Side by Side Diff: chrome/browser/browser.cc

Issue 504031: Don't show download arrow animation for extensions (Closed)
Patch Set: Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 } 2233 }
2234 2234
2235 void Browser::OnStartDownload(DownloadItem* download) { 2235 void Browser::OnStartDownload(DownloadItem* download) {
2236 if (!window()) 2236 if (!window())
2237 return; 2237 return;
2238 2238
2239 // GetDownloadShelf creates the download shelf if it was not yet created. 2239 // GetDownloadShelf creates the download shelf if it was not yet created.
2240 window()->GetDownloadShelf()->AddDownload(new DownloadItemModel(download)); 2240 window()->GetDownloadShelf()->AddDownload(new DownloadItemModel(download));
2241 2241
2242 // Don't show the animation for "Save file" downloads. 2242 // Don't show the animation for "Save file" downloads.
2243 if (download->total_bytes() > 0) { 2243 if (download->total_bytes() <= 0)
2244 TabContents* current_tab = GetSelectedTabContents(); 2244 return;
2245 // We make this check for the case of minimized windows, unit tests, etc. 2245
2246 if (platform_util::IsVisible(current_tab->GetNativeView()) && 2246 // For non-theme extensions, we don't show the download animation.
2247 Animation::ShouldRenderRichAnimation()) 2247 if (DownloadManager::IsExtensionInstall(download) &&
2248 DownloadStartedAnimation::Show(current_tab); 2248 !ExtensionsService::IsDownloadFromMiniGallery(download->url()))
2249 } 2249 return;
2250
2251 TabContents* current_tab = GetSelectedTabContents();
2252 // We make this check for the case of minimized windows, unit tests, etc.
2253 if (platform_util::IsVisible(current_tab->GetNativeView()) &&
2254 Animation::ShouldRenderRichAnimation())
2255 DownloadStartedAnimation::Show(current_tab);
2250 } 2256 }
2251 2257
2252 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, 2258 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url,
2253 Profile* profile) { 2259 Profile* profile) {
2254 window()->ConfirmAddSearchProvider(template_url, profile); 2260 window()->ConfirmAddSearchProvider(template_url, profile);
2255 } 2261 }
2256 2262
2257 void Browser::ShowPageInfo(Profile* profile, 2263 void Browser::ShowPageInfo(Profile* profile,
2258 const GURL& url, 2264 const GURL& url,
2259 const NavigationEntry::SSLStatus& ssl, 2265 const NavigationEntry::SSLStatus& ssl,
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
3148 /////////////////////////////////////////////////////////////////////////////// 3154 ///////////////////////////////////////////////////////////////////////////////
3149 // BrowserToolbarModel (private): 3155 // BrowserToolbarModel (private):
3150 3156
3151 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 3157 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
3152 // This |current_tab| can be NULL during the initialization of the 3158 // This |current_tab| can be NULL during the initialization of the
3153 // toolbar during window creation (i.e. before any tabs have been added 3159 // toolbar during window creation (i.e. before any tabs have been added
3154 // to the window). 3160 // to the window).
3155 TabContents* current_tab = browser_->GetSelectedTabContents(); 3161 TabContents* current_tab = browser_->GetSelectedTabContents();
3156 return current_tab ? &current_tab->controller() : NULL; 3162 return current_tab ? &current_tab->controller() : NULL;
3157 } 3163 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698