Chromium Code Reviews| 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_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 class NetworkState; | 15 class NetworkState; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace network_icon { | 19 namespace network_icon { |
| 20 | 20 |
| 21 // Type of icon which dictates color theme and VPN badging | 21 // Type of icon which dictates color theme and VPN badging |
| 22 enum IconType { | 22 enum IconType { |
| 23 ICON_TYPE_TRAY, // light icons with VPN badges | 23 ICON_TYPE_TRAY, // light icons with VPN badges |
| 24 ICON_TYPE_DEFAULT_VIEW, // dark icons with VPN badges | 24 ICON_TYPE_DEFAULT_VIEW, // dark icons with VPN badges |
| 25 ICON_TYPE_LIST, // dark icons without VPN badges | 25 ICON_TYPE_LIST, // dark icons without VPN badges; in-line status |
| 26 ICON_TYPE_MENU_LIST, // dark icons without VPN badges; separate status | |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 // Gets the image for the network associated with |service_path|. |network| must | 29 // Gets the image for the network associated with |service_path|. |network| must |
| 29 // not be NULL. |icon_type| determines the color theme and whether or not to | 30 // not be NULL. |icon_type| determines the color theme and whether or not to |
| 30 // show the VPN badge. This caches badged icons per network per |icon_type|. | 31 // show the VPN badge. This caches badged icons per network per |icon_type|. |
| 31 ASH_EXPORT gfx::ImageSkia GetImageForNetwork( | 32 ASH_EXPORT gfx::ImageSkia GetImageForNetwork( |
| 32 const chromeos::NetworkState* network, | 33 const chromeos::NetworkState* network, |
| 33 IconType icon_type); | 34 IconType icon_type); |
| 34 | 35 |
| 35 // Gets the full strength image for a Wi-Fi network. | 36 // Gets the full strength image for a Wi-Fi network. |
| 36 // TODO(estade): Expose SignalStrengthImageSource and use that instead. | 37 // TODO(estade): Expose SignalStrengthImageSource and use that instead. |
| 37 ASH_EXPORT gfx::ImageSkia GetImageForConnectedMobileNetwork(); | 38 ASH_EXPORT gfx::ImageSkia GetImageForConnectedMobileNetwork(); |
| 38 | 39 |
| 39 // Gets the disconnected image for a cell network. | 40 // Gets the disconnected image for a cell network. |
| 40 // TODO(estade): Expose SignalStrengthImageSource and use that instead. | 41 // TODO(estade): Expose SignalStrengthImageSource and use that instead. |
| 41 ASH_EXPORT gfx::ImageSkia GetImageForDisconnectedCellNetwork(); | 42 ASH_EXPORT gfx::ImageSkia GetImageForDisconnectedCellNetwork(); |
| 42 | 43 |
| 43 // Gets the full strength image for a Wi-Fi network using |icon_color| for the | 44 // Gets the full strength image for a Wi-Fi network using |icon_color| for the |
| 44 // main icon and |badge_color| for the badge. | 45 // main icon and |badge_color| for the badge. |
| 45 ASH_EXPORT gfx::ImageSkia GetImageForNewWifiNetwork(SkColor icon_color, | 46 ASH_EXPORT gfx::ImageSkia GetImageForNewWifiNetwork(SkColor icon_color, |
| 46 SkColor badge_color); | 47 SkColor badge_color); |
| 47 | 48 |
| 48 // Returns a vpn image suitable for use on a light background. | 49 // Returns a vpn image suitable for use on a light background. |
| 49 ASH_EXPORT gfx::ImageSkia GetVpnImage(); | 50 ASH_EXPORT gfx::ImageSkia GetVpnImage(); |
| 50 | 51 |
| 51 // Returns the label for |network| based on |icon_type|. |network| can be NULL. | 52 // Returns the label for |network| based on |icon_type|. |network| cannot be |
| 53 // NULL. | |
|
sadrul
2016/12/21 02:05:54
nullptr
varkha
2016/12/21 04:36:49
Done.
| |
| 52 ASH_EXPORT base::string16 GetLabelForNetwork( | 54 ASH_EXPORT base::string16 GetLabelForNetwork( |
| 53 const chromeos::NetworkState* network, | 55 const chromeos::NetworkState* network, |
| 54 IconType icon_type); | 56 IconType icon_type); |
| 55 | 57 |
| 56 // Updates and returns the appropriate message id if the cellular network | 58 // Updates and returns the appropriate message id if the cellular network |
| 57 // is uninitialized. | 59 // is uninitialized. |
| 58 ASH_EXPORT int GetCellularUninitializedMsg(); | 60 ASH_EXPORT int GetCellularUninitializedMsg(); |
| 59 | 61 |
| 60 // Gets the correct icon and label for |icon_type|. Also sets |animating| | 62 // Gets the correct icon and label for |icon_type|. Also sets |animating| |
| 61 // based on whether or not the icon is animating (i.e. connecting). | 63 // based on whether or not the icon is animating (i.e. connecting). |
| 62 ASH_EXPORT void GetDefaultNetworkImageAndLabel(IconType icon_type, | 64 ASH_EXPORT void GetDefaultNetworkImageAndLabel(IconType icon_type, |
| 63 gfx::ImageSkia* image, | 65 gfx::ImageSkia* image, |
| 64 base::string16* label, | 66 base::string16* label, |
| 65 bool* animating); | 67 bool* animating); |
| 66 | 68 |
| 67 // Called when the list of networks changes. Retreives the list of networks | 69 // Called when the list of networks changes. Retreives the list of networks |
| 68 // from the global NetworkStateHandler instance and removes cached entries | 70 // from the global NetworkStateHandler instance and removes cached entries |
| 69 // that are no longer in the list. | 71 // that are no longer in the list. |
| 70 ASH_EXPORT void PurgeNetworkIconCache(); | 72 ASH_EXPORT void PurgeNetworkIconCache(); |
| 71 | 73 |
| 72 } // namespace network_icon | 74 } // namespace network_icon |
| 73 } // namespace ash | 75 } // namespace ash |
| 74 | 76 |
| 75 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ | 77 #endif // ASH_COMMON_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ |
| OLD | NEW |