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

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

Issue 11377068: ui: Make gfx::Size::Scale() mutate the class. Add gfx::ScaleSize() similar to Rect/Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseTOGO Created 8 years, 1 month 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 | « cc/page_scale_animation.cc ('k') | chrome/browser/extensions/extension_icon_image.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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 class EmptyImageSource: public gfx::ImageSkiaSource { 178 class EmptyImageSource: public gfx::ImageSkiaSource {
179 public: 179 public:
180 explicit EmptyImageSource(const gfx::Size& size) 180 explicit EmptyImageSource(const gfx::Size& size)
181 : size_(size) { 181 : size_(size) {
182 } 182 }
183 183
184 virtual gfx::ImageSkiaRep GetImageForScale( 184 virtual gfx::ImageSkiaRep GetImageForScale(
185 ui::ScaleFactor scale_factor) OVERRIDE { 185 ui::ScaleFactor scale_factor) OVERRIDE {
186 gfx::Size pixel_size = gfx::ToFlooredSize( 186 gfx::Size pixel_size = gfx::ToFlooredSize(
187 size_.Scale(ui::GetScaleFactorScale(scale_factor))); 187 gfx::ScaleSize(size_, ui::GetScaleFactorScale(scale_factor)));
188 SkBitmap empty_bitmap = GetEmptyBitmap(pixel_size); 188 SkBitmap empty_bitmap = GetEmptyBitmap(pixel_size);
189 return gfx::ImageSkiaRep(empty_bitmap, scale_factor); 189 return gfx::ImageSkiaRep(empty_bitmap, scale_factor);
190 } 190 }
191 private: 191 private:
192 const gfx::Size size_; 192 const gfx::Size size_;
193 193
194 DISALLOW_COPY_AND_ASSIGN(EmptyImageSource); 194 DISALLOW_COPY_AND_ASSIGN(EmptyImageSource);
195 }; 195 };
196 196
197 // This defines how we assemble a network icon. 197 // This defines how we assemble a network icon.
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 gfx::ImageSkia* NetworkMenuIcon::GetVirtualNetworkImage() { 953 gfx::ImageSkia* NetworkMenuIcon::GetVirtualNetworkImage() {
954 return ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 954 return ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
955 IDR_STATUSBAR_VPN); 955 IDR_STATUSBAR_VPN);
956 } 956 }
957 957
958 int NetworkMenuIcon::NumImages(ImageType type) { 958 int NetworkMenuIcon::NumImages(ImageType type) {
959 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; 959 return (type == ARCS) ? kNumArcsImages : kNumBarsImages;
960 } 960 }
961 961
962 } // chromeos 962 } // chromeos
OLDNEW
« no previous file with comments | « cc/page_scale_animation.cc ('k') | chrome/browser/extensions/extension_icon_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698