| 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 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ |
| 6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ | 6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/string16.h" | |
| 11 #include "ui/gfx/image/image_skia.h" | 10 #include "ui/gfx/image/image_skia.h" |
| 12 | 11 |
| 13 namespace chromeos { | 12 namespace chromeos { |
| 14 class NetworkState; | 13 class NetworkState; |
| 15 } | 14 } |
| 16 | 15 |
| 17 namespace ash { | 16 namespace ash { |
| 18 namespace network_icon { | 17 namespace network_icon { |
| 19 | 18 |
| 20 class AnimationObserver; | 19 class AnimationObserver; |
| 21 | 20 |
| 22 // Type of icon which dictates color theme and VPN badging | 21 // Color theme based on icon background. |
| 23 enum IconType { | 22 enum ResourceColorTheme { |
| 24 ICON_TYPE_TRAY, // light icons with VPN badges | 23 COLOR_DARK, |
| 25 ICON_TYPE_DEFAULT_VIEW, // dark icons with VPN badges | 24 COLOR_LIGHT, |
| 26 ICON_TYPE_LIST, // dark icons without VPN badges | |
| 27 }; | 25 }; |
| 28 | 26 |
| 29 // Gets the image for the network associated with |service_path|. |network| must | 27 // Get the image for the network associated with |service_path|. |
| 30 // not be NULL. |icon_type| determines the color theme and whether or not to | 28 // |color| determines the color theme. If the icon is animating (i.e the |
| 31 // show the VPN badge. This caches badged icons per network per |icon_type|. | 29 // network is connecting) and |observer| is provided, it will be notified |
| 30 // when the icon changes. |
| 32 gfx::ImageSkia GetImageForNetwork(const chromeos::NetworkState* network, | 31 gfx::ImageSkia GetImageForNetwork(const chromeos::NetworkState* network, |
| 33 IconType icon_type); | 32 ResourceColorTheme color, |
| 34 | 33 AnimationObserver* observer); |
| 35 // Gets the image for a connecting network type. | |
| 36 gfx::ImageSkia GetImageForConnectingNetwork(IconType icon_type, | |
| 37 const std::string& network_type); | |
| 38 | |
| 39 // Gets the image for a disconnected network type. | |
| 40 gfx::ImageSkia GetImageForDisconnectedNetwork(IconType icon_type, | |
| 41 const std::string& network_type); | |
| 42 | |
| 43 // Returns the label for |network| based on |icon_type|. |network| can be NULL. | |
| 44 string16 GetLabelForNetwork(const chromeos::NetworkState* network, | |
| 45 IconType icon_type); | |
| 46 | 34 |
| 47 } // namespace network_icon | 35 } // namespace network_icon |
| 48 } // namespace ash | 36 } // namespace ash |
| 49 | 37 |
| 50 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ | 38 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ |
| OLD | NEW |