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

Side by Side Diff: chrome/browser/ui/views/download/download_started_animation_views.cc

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/download/download_started_animation.h" 5 #include "chrome/browser/download/download_started_animation.h"
6 6
7 #include "content/public/browser/notification_details.h" 7 #include "content/public/browser/notification_details.h"
8 #include "content/public/browser/notification_observer.h" 8 #include "content/public/browser/notification_observer.h"
9 #include "content/public/browser/notification_registrar.h" 9 #include "content/public/browser/notification_registrar.h"
10 #include "content/public/browser/notification_source.h" 10 #include "content/public/browser/notification_source.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 content::NotificationRegistrar registrar_; 75 content::NotificationRegistrar registrar_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(DownloadStartedAnimationWin); 77 DISALLOW_COPY_AND_ASSIGN(DownloadStartedAnimationWin);
78 }; 78 };
79 79
80 DownloadStartedAnimationWin::DownloadStartedAnimationWin( 80 DownloadStartedAnimationWin::DownloadStartedAnimationWin(
81 WebContents* web_contents) 81 WebContents* web_contents)
82 : ui::LinearAnimation(kMoveTimeMs, kFrameRateHz, NULL), 82 : ui::LinearAnimation(kMoveTimeMs, kFrameRateHz, NULL),
83 popup_(NULL), 83 popup_(NULL),
84 web_contents_(web_contents) { 84 web_contents_(web_contents) {
85 static SkBitmap* kDownloadImage = NULL; 85 static gfx::ImageSkia* kDownloadImage = NULL;
86 if (!kDownloadImage) { 86 if (!kDownloadImage) {
87 kDownloadImage = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( 87 kDownloadImage = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
88 IDR_DOWNLOAD_ANIMATION_BEGIN); 88 IDR_DOWNLOAD_ANIMATION_BEGIN);
89 } 89 }
90 90
91 // If we're too small to show the download image, then don't bother - 91 // If we're too small to show the download image, then don't bother -
92 // the shelf will be enough. 92 // the shelf will be enough.
93 web_contents_->GetContainerBounds(&web_contents_bounds_); 93 web_contents_->GetContainerBounds(&web_contents_bounds_);
94 if (web_contents_bounds_.height() < kDownloadImage->height()) 94 if (web_contents_bounds_.height() < kDownloadImage->height())
95 return; 95 return;
96 96
97 registrar_.Add( 97 registrar_.Add(
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 } // namespace 177 } // namespace
178 178
179 // static 179 // static
180 void DownloadStartedAnimation::Show(WebContents* web_contents) { 180 void DownloadStartedAnimation::Show(WebContents* web_contents) {
181 // The animation will delete itself when it's finished or when the tab 181 // The animation will delete itself when it's finished or when the tab
182 // contents is hidden or destroyed. 182 // contents is hidden or destroyed.
183 new DownloadStartedAnimationWin(web_contents); 183 new DownloadStartedAnimationWin(web_contents);
184 } 184 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_view.cc ('k') | chrome/browser/ui/views/dropdown_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698