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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 canvas.ExtractImageRep(); | 236 return gfx::ImageSkiaRep(canvas.ExtractBitmap(), icon_rep.scale_factor()); |
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 Loading... |
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 |
OLD | NEW |