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

Side by Side Diff: ui/chromeos/network/network_icon.cc

Issue 623293004: replace OVERRIDE and FINAL with override and final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 years, 2 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
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/chromeos/network/network_icon_animation.h » ('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 "ui/chromeos/network/network_icon.h" 5 #include "ui/chromeos/network/network_icon.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chromeos/network/device_state.h" 8 #include "chromeos/network/device_state.h"
9 #include "chromeos/network/network_connection_handler.h" 9 #include "chromeos/network/network_connection_handler.h"
10 #include "chromeos/network/network_state.h" 10 #include "chromeos/network/network_state.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 (*s_empty_bitmaps)[key] = empty; 207 (*s_empty_bitmaps)[key] = empty;
208 return empty; 208 return empty;
209 } 209 }
210 210
211 class EmptyImageSource: public gfx::ImageSkiaSource { 211 class EmptyImageSource: public gfx::ImageSkiaSource {
212 public: 212 public:
213 explicit EmptyImageSource(const gfx::Size& size) 213 explicit EmptyImageSource(const gfx::Size& size)
214 : size_(size) { 214 : size_(size) {
215 } 215 }
216 216
217 virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { 217 virtual gfx::ImageSkiaRep GetImageForScale(float scale) override {
218 gfx::Size pixel_size = gfx::ToFlooredSize(gfx::ScaleSize(size_, scale)); 218 gfx::Size pixel_size = gfx::ToFlooredSize(gfx::ScaleSize(size_, scale));
219 SkBitmap empty_bitmap = GetEmptyBitmap(pixel_size); 219 SkBitmap empty_bitmap = GetEmptyBitmap(pixel_size);
220 return gfx::ImageSkiaRep(empty_bitmap, scale); 220 return gfx::ImageSkiaRep(empty_bitmap, scale);
221 } 221 }
222 222
223 private: 223 private:
224 const gfx::Size size_; 224 const gfx::Size size_;
225 225
226 DISALLOW_COPY_AND_ASSIGN(EmptyImageSource); 226 DISALLOW_COPY_AND_ASSIGN(EmptyImageSource);
227 }; 227 };
228 228
229 // This defines how we assemble a network icon. 229 // This defines how we assemble a network icon.
230 class NetworkIconImageSource : public gfx::ImageSkiaSource { 230 class NetworkIconImageSource : public gfx::ImageSkiaSource {
231 public: 231 public:
232 NetworkIconImageSource(const gfx::ImageSkia& icon, const Badges& badges) 232 NetworkIconImageSource(const gfx::ImageSkia& icon, const Badges& badges)
233 : icon_(icon), 233 : icon_(icon),
234 badges_(badges) { 234 badges_(badges) {
235 } 235 }
236 virtual ~NetworkIconImageSource() {} 236 virtual ~NetworkIconImageSource() {}
237 237
238 // TODO(pkotwicz): Figure out what to do when a new image resolution becomes 238 // TODO(pkotwicz): Figure out what to do when a new image resolution becomes
239 // available. 239 // available.
240 virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { 240 virtual gfx::ImageSkiaRep GetImageForScale(float scale) override {
241 gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale); 241 gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale);
242 if (icon_rep.is_null()) 242 if (icon_rep.is_null())
243 return gfx::ImageSkiaRep(); 243 return gfx::ImageSkiaRep();
244 gfx::Canvas canvas(icon_rep, false); 244 gfx::Canvas canvas(icon_rep, false);
245 if (badges_.top_left) 245 if (badges_.top_left)
246 canvas.DrawImageInt(*badges_.top_left, 0, 0); 246 canvas.DrawImageInt(*badges_.top_left, 0, 0);
247 if (badges_.top_right) 247 if (badges_.top_right)
248 canvas.DrawImageInt(*badges_.top_right, 248 canvas.DrawImageInt(*badges_.top_right,
249 icon_.width() - badges_.top_right->width(), 0); 249 icon_.width() - badges_.top_right->width(), 0);
250 if (badges_.bottom_left) { 250 if (badges_.bottom_left) {
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 iter != networks.end(); ++iter) { 953 iter != networks.end(); ++iter) {
954 network_paths.insert((*iter)->path()); 954 network_paths.insert((*iter)->path());
955 } 955 }
956 PurgeIconMap(ICON_TYPE_TRAY, network_paths); 956 PurgeIconMap(ICON_TYPE_TRAY, network_paths);
957 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); 957 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths);
958 PurgeIconMap(ICON_TYPE_LIST, network_paths); 958 PurgeIconMap(ICON_TYPE_LIST, network_paths);
959 } 959 }
960 960
961 } // namespace network_icon 961 } // namespace network_icon
962 } // namespace ui 962 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/chromeos/network/network_icon_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698