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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (bottom_left_badge_) { | 233 if (bottom_left_badge_) { |
234 canvas.DrawImageInt(*bottom_left_badge_, | 234 canvas.DrawImageInt(*bottom_left_badge_, |
235 kBadgeLeftX, | 235 kBadgeLeftX, |
236 icon_.height() - bottom_left_badge_->height()); | 236 icon_.height() - bottom_left_badge_->height()); |
237 } | 237 } |
238 if (bottom_right_badge_) { | 238 if (bottom_right_badge_) { |
239 canvas.DrawImageInt(*bottom_right_badge_, | 239 canvas.DrawImageInt(*bottom_right_badge_, |
240 icon_.width() - bottom_right_badge_->width(), | 240 icon_.width() - bottom_right_badge_->width(), |
241 icon_.height() - bottom_right_badge_->height()); | 241 icon_.height() - bottom_right_badge_->height()); |
242 } | 242 } |
243 return gfx::ImageSkiaRep(canvas.ExtractBitmap(), icon_rep.scale_factor()); | 243 return gfx::ImageSkiaRep(canvas.ExtractImageRep(), icon_rep.scale_factor()); |
244 } | 244 } |
245 | 245 |
246 private: | 246 private: |
247 const gfx::ImageSkia icon_; | 247 const gfx::ImageSkia icon_; |
248 const gfx::ImageSkia *top_left_badge_; | 248 const gfx::ImageSkia *top_left_badge_; |
249 const gfx::ImageSkia *top_right_badge_; | 249 const gfx::ImageSkia *top_right_badge_; |
250 const gfx::ImageSkia *bottom_left_badge_; | 250 const gfx::ImageSkia *bottom_left_badge_; |
251 const gfx::ImageSkia *bottom_right_badge_; | 251 const gfx::ImageSkia *bottom_right_badge_; |
252 | 252 |
253 DISALLOW_COPY_AND_ASSIGN(NetworkIconImageSource); | 253 DISALLOW_COPY_AND_ASSIGN(NetworkIconImageSource); |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 const gfx::ImageSkia NetworkMenuIcon::GetConnectedImage(ImageType type, | 969 const gfx::ImageSkia NetworkMenuIcon::GetConnectedImage(ImageType type, |
970 ResourceColorTheme color) { | 970 ResourceColorTheme color) { |
971 return GetImage(type, NumImages(type) - 1, color); | 971 return GetImage(type, NumImages(type) - 1, color); |
972 } | 972 } |
973 | 973 |
974 int NetworkMenuIcon::NumImages(ImageType type) { | 974 int NetworkMenuIcon::NumImages(ImageType type) { |
975 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; | 975 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; |
976 } | 976 } |
977 | 977 |
978 } // chromeos | 978 } // chromeos |
OLD | NEW |