| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |