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

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

Issue 159623: Implement the download arrow animation for Mac (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/cocoa/download_started_animation_mac.mm » ('j') | 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) 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/idle_timer.h" 10 #include "base/idle_timer.h"
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 return window_->GetExtraRenderViewHeight(); 2011 return window_->GetExtraRenderViewHeight();
2012 } 2012 }
2013 2013
2014 void Browser::OnStartDownload(DownloadItem* download) { 2014 void Browser::OnStartDownload(DownloadItem* download) {
2015 if (!window()) 2015 if (!window())
2016 return; 2016 return;
2017 2017
2018 // GetDownloadShelf creates the download shelf if it was not yet created. 2018 // GetDownloadShelf creates the download shelf if it was not yet created.
2019 window()->GetDownloadShelf()->AddDownload(new DownloadItemModel(download)); 2019 window()->GetDownloadShelf()->AddDownload(new DownloadItemModel(download));
2020 2020
2021 // TODO(port): port for mac.
2022 #if defined(OS_WIN) || defined(OS_LINUX)
2023 // Don't show the animation for "Save file" downloads. 2021 // Don't show the animation for "Save file" downloads.
2024 if (download->total_bytes() > 0) { 2022 if (download->total_bytes() > 0) {
2025 TabContents* current_tab = GetSelectedTabContents(); 2023 TabContents* current_tab = GetSelectedTabContents();
2026 // We make this check for the case of minimized windows, unit tests, etc. 2024 // We make this check for the case of minimized windows, unit tests, etc.
2027 if (platform_util::IsVisible(current_tab->GetNativeView()) && 2025 if (platform_util::IsVisible(current_tab->GetNativeView()) &&
2028 Animation::ShouldRenderRichAnimation()) 2026 Animation::ShouldRenderRichAnimation())
2029 DownloadStartedAnimation::Show(current_tab); 2027 DownloadStartedAnimation::Show(current_tab);
2030 } 2028 }
2031 #endif
2032 } 2029 }
2033 2030
2034 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, 2031 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url,
2035 Profile* profile) { 2032 Profile* profile) {
2036 window()->ConfirmAddSearchProvider(template_url, profile); 2033 window()->ConfirmAddSearchProvider(template_url, profile);
2037 } 2034 }
2038 2035
2039 void Browser::ShowPageInfo(Profile* profile, 2036 void Browser::ShowPageInfo(Profile* profile,
2040 const GURL& url, 2037 const GURL& url,
2041 const NavigationEntry::SSLStatus& ssl, 2038 const NavigationEntry::SSLStatus& ssl,
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 /////////////////////////////////////////////////////////////////////////////// 2788 ///////////////////////////////////////////////////////////////////////////////
2792 // BrowserToolbarModel (private): 2789 // BrowserToolbarModel (private):
2793 2790
2794 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 2791 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
2795 // This |current_tab| can be NULL during the initialization of the 2792 // This |current_tab| can be NULL during the initialization of the
2796 // toolbar during window creation (i.e. before any tabs have been added 2793 // toolbar during window creation (i.e. before any tabs have been added
2797 // to the window). 2794 // to the window).
2798 TabContents* current_tab = browser_->GetSelectedTabContents(); 2795 TabContents* current_tab = browser_->GetSelectedTabContents();
2799 return current_tab ? &current_tab->controller() : NULL; 2796 return current_tab ? &current_tab->controller() : NULL;
2800 } 2797 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/download_started_animation_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698