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