| 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 "ash/common/system/chromeos/network/network_icon.h" | 5 #include "ash/common/system/chromeos/network/network_icon.h" |
| 6 | 6 |
| 7 #include "ash/common/strings/grit/ash_strings.h" | 7 #include "ash/common/strings/grit/ash_strings.h" |
| 8 #include "ash/common/system/chromeos/network/network_icon_animation.h" | 8 #include "ash/common/system/chromeos/network/network_icon_animation.h" |
| 9 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" | 9 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 bool IconTypeHasVPNBadge(IconType icon_type) { | 196 bool IconTypeHasVPNBadge(IconType icon_type) { |
| 197 return (icon_type != ICON_TYPE_LIST && icon_type != ICON_TYPE_MENU_LIST); | 197 return (icon_type != ICON_TYPE_LIST && icon_type != ICON_TYPE_MENU_LIST); |
| 198 } | 198 } |
| 199 | 199 |
| 200 // This defines how we assemble a network icon. | 200 // This defines how we assemble a network icon. |
| 201 class NetworkIconImageSource : public gfx::CanvasImageSource { | 201 class NetworkIconImageSource : public gfx::CanvasImageSource { |
| 202 public: | 202 public: |
| 203 static gfx::ImageSkia CreateImage(const gfx::ImageSkia& icon, | 203 static gfx::ImageSkia CreateImage(const gfx::ImageSkia& icon, |
| 204 const Badges& badges) { | 204 const Badges& badges) { |
| 205 auto source = new NetworkIconImageSource(icon, badges); | 205 auto* source = new NetworkIconImageSource(icon, badges); |
| 206 return gfx::ImageSkia(source, source->size()); | 206 return gfx::ImageSkia(source, source->size()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // gfx::CanvasImageSource: | 209 // gfx::CanvasImageSource: |
| 210 void Draw(gfx::Canvas* canvas) override { | 210 void Draw(gfx::Canvas* canvas) override { |
| 211 const int width = size().width(); | 211 const int width = size().width(); |
| 212 const int height = size().height(); | 212 const int height = size().height(); |
| 213 | 213 |
| 214 // The base icon is centered in both dimensions. | 214 // The base icon is centered in both dimensions. |
| 215 const int icon_y = (height - icon_.height()) / 2; | 215 const int icon_y = (height - icon_.height()) / 2; |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 network_paths.insert((*iter)->path()); | 948 network_paths.insert((*iter)->path()); |
| 949 } | 949 } |
| 950 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 950 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
| 951 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 951 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
| 952 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 952 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
| 953 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); | 953 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); |
| 954 } | 954 } |
| 955 | 955 |
| 956 } // namespace network_icon | 956 } // namespace network_icon |
| 957 } // namespace ash | 957 } // namespace ash |
| OLD | NEW |