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

Side by Side Diff: chrome/browser/chromeos/status/network_menu_icon.cc

Issue 10701063: Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « ash/shell/app_list.cc ('k') | chrome/browser/extensions/extension_icon_manager.cc » ('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) 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/chromeos/status/network_menu_icon.h" 5 #include "chrome/browser/chromeos/status/network_menu_icon.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (bottom_left_badge_) { 226 if (bottom_left_badge_) {
227 canvas.DrawImageInt(*bottom_left_badge_, 227 canvas.DrawImageInt(*bottom_left_badge_,
228 kBadgeLeftX, 228 kBadgeLeftX,
229 icon_.height() - bottom_left_badge_->height()); 229 icon_.height() - bottom_left_badge_->height());
230 } 230 }
231 if (bottom_right_badge_) { 231 if (bottom_right_badge_) {
232 canvas.DrawImageInt(*bottom_right_badge_, 232 canvas.DrawImageInt(*bottom_right_badge_,
233 icon_.width() - bottom_right_badge_->width(), 233 icon_.width() - bottom_right_badge_->width(),
234 icon_.height() - bottom_right_badge_->height()); 234 icon_.height() - bottom_right_badge_->height());
235 } 235 }
236 return gfx::ImageSkiaRep(canvas.ExtractBitmap(), icon_rep.scale_factor()); 236 return canvas.ExtractImageRep();
237 } 237 }
238 238
239 private: 239 private:
240 const gfx::ImageSkia icon_; 240 const gfx::ImageSkia icon_;
241 const gfx::ImageSkia *top_left_badge_; 241 const gfx::ImageSkia *top_left_badge_;
242 const gfx::ImageSkia *top_right_badge_; 242 const gfx::ImageSkia *top_right_badge_;
243 const gfx::ImageSkia *bottom_left_badge_; 243 const gfx::ImageSkia *bottom_left_badge_;
244 const gfx::ImageSkia *bottom_right_badge_; 244 const gfx::ImageSkia *bottom_right_badge_;
245 245
246 DISALLOW_COPY_AND_ASSIGN(NetworkIconImageSource); 246 DISALLOW_COPY_AND_ASSIGN(NetworkIconImageSource);
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 const gfx::ImageSkia NetworkMenuIcon::GetConnectedImage(ImageType type, 937 const gfx::ImageSkia NetworkMenuIcon::GetConnectedImage(ImageType type,
938 ResourceColorTheme color) { 938 ResourceColorTheme color) {
939 return GetImage(type, NumImages(type) - 1, color); 939 return GetImage(type, NumImages(type) - 1, color);
940 } 940 }
941 941
942 int NetworkMenuIcon::NumImages(ImageType type) { 942 int NetworkMenuIcon::NumImages(ImageType type) {
943 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; 943 return (type == ARCS) ? kNumArcsImages : kNumBarsImages;
944 } 944 }
945 945
946 } // chromeos 946 } // chromeos
OLDNEW
« no previous file with comments | « ash/shell/app_list.cc ('k') | chrome/browser/extensions/extension_icon_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698