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 "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 ICON_TYPE_LIST, // dark icons without VPN badges | 27 ICON_TYPE_LIST, // dark icons without VPN badges |
28 }; | 28 }; |
29 | 29 |
30 // Gets the image for the network associated with |service_path|. |network| must | 30 // Gets the image for the network associated with |service_path|. |network| must |
31 // not be NULL. |icon_type| determines the color theme and whether or not to | 31 // not be NULL. |icon_type| determines the color theme and whether or not to |
32 // show the VPN badge. This caches badged icons per network per |icon_type|. | 32 // show the VPN badge. This caches badged icons per network per |icon_type|. |
33 ASH_EXPORT gfx::ImageSkia GetImageForNetwork( | 33 ASH_EXPORT gfx::ImageSkia GetImageForNetwork( |
34 const chromeos::NetworkState* network, | 34 const chromeos::NetworkState* network, |
35 IconType icon_type); | 35 IconType icon_type); |
36 | 36 |
| 37 // Similar to GetImageForNetwork but returns the cached image url based on |
| 38 // |scale_factor| instead. |
| 39 ASH_EXPORT std::string GetImageUrlForNetwork( |
| 40 const chromeos::NetworkState* network, |
| 41 IconType icon_type, |
| 42 float scale_factor); |
| 43 |
37 // Gets the fulls strength image for a connected network type. | 44 // Gets the fulls strength image for a connected network type. |
38 ASH_EXPORT gfx::ImageSkia GetImageForConnectedNetwork( | 45 ASH_EXPORT gfx::ImageSkia GetImageForConnectedNetwork( |
39 IconType icon_type, | 46 IconType icon_type, |
40 const std::string& network_type); | 47 const std::string& network_type); |
41 | 48 |
42 // Gets the image for a connecting network type. | 49 // Gets the image for a connecting network type. |
43 ASH_EXPORT gfx::ImageSkia GetImageForConnectingNetwork( | 50 ASH_EXPORT gfx::ImageSkia GetImageForConnectingNetwork( |
44 IconType icon_type, | 51 IconType icon_type, |
45 const std::string& network_type); | 52 const std::string& network_type); |
46 | 53 |
47 // Gets the image for a disconnected network type. | 54 // Gets the image for a disconnected network type. |
48 ASH_EXPORT gfx::ImageSkia GetImageForDisconnectedNetwork( | 55 ASH_EXPORT gfx::ImageSkia GetImageForDisconnectedNetwork( |
49 IconType icon_type, | 56 IconType icon_type, |
50 const std::string& network_type); | 57 const std::string& network_type); |
51 | 58 |
| 59 // Gets a url representing the image for a disconnected network type. |
| 60 ASH_EXPORT std::string GetImageUrlForDisconnectedNetwork( |
| 61 IconType icon_type, |
| 62 const std::string& network_type, |
| 63 float scale_factor); |
| 64 |
52 // Returns the label for |network| based on |icon_type|. |network| can be NULL. | 65 // Returns the label for |network| based on |icon_type|. |network| can be NULL. |
53 ASH_EXPORT base::string16 GetLabelForNetwork( | 66 ASH_EXPORT base::string16 GetLabelForNetwork( |
54 const chromeos::NetworkState* network, | 67 const chromeos::NetworkState* network, |
55 IconType icon_type); | 68 IconType icon_type); |
56 | 69 |
57 // Updates and returns the appropriate message id if the cellular network | 70 // Updates and returns the appropriate message id if the cellular network |
58 // is uninitialized. | 71 // is uninitialized. |
59 ASH_EXPORT int GetCellularUninitializedMsg(); | 72 ASH_EXPORT int GetCellularUninitializedMsg(); |
60 | 73 |
61 // Gets the correct icon and label for |icon_type|. Also sets |animating| | 74 // Gets the correct icon and label for |icon_type|. Also sets |animating| |
62 // based on whether or not the icon is animating (i.e. connecting). | 75 // based on whether or not the icon is animating (i.e. connecting). |
63 ASH_EXPORT void GetDefaultNetworkImageAndLabel(IconType icon_type, | 76 ASH_EXPORT void GetDefaultNetworkImageAndLabel(IconType icon_type, |
64 gfx::ImageSkia* image, | 77 gfx::ImageSkia* image, |
65 base::string16* label, | 78 base::string16* label, |
66 bool* animating); | 79 bool* animating); |
67 | 80 |
68 // Called when the list of networks changes. Retreives the list of networks | 81 // Called when the list of networks changes. Retreives the list of networks |
69 // from the global NetworkStateHandler instance and removes cached entries | 82 // from the global NetworkStateHandler instance and removes cached entries |
70 // that are no longer in the list. | 83 // that are no longer in the list. |
71 ASH_EXPORT void PurgeNetworkIconCache(); | 84 ASH_EXPORT void PurgeNetworkIconCache(); |
72 | 85 |
73 } // namespace network_icon | 86 } // namespace network_icon |
74 } // namespace ash | 87 } // namespace ash |
75 | 88 |
76 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ | 89 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_H_ |
OLD | NEW |