Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / chromeos / network / network_icon.h
blob5227af3df0f5290a4984a2a1af1d15c1e2d209e9
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
3 // found in the LICENSE file.
5 #ifndef UI_CHROMEOS_NETWORK_NETWORK_ICON_H_
6 #define UI_CHROMEOS_NETWORK_NETWORK_ICON_H_
8 #include <string>
10 #include "base/strings/string16.h"
11 #include "ui/chromeos/ui_chromeos_export.h"
12 #include "ui/gfx/image/image_skia.h"
14 namespace chromeos {
15 class NetworkState;
18 namespace ui {
19 namespace network_icon {
21 class AnimationObserver;
23 // Type of icon which dictates color theme and VPN badging
24 enum IconType {
25 ICON_TYPE_TRAY, // light icons with VPN badges
26 ICON_TYPE_DEFAULT_VIEW, // dark icons with VPN badges
27 ICON_TYPE_LIST, // dark icons without VPN badges
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
32 // show the VPN badge. This caches badged icons per network per |icon_type|.
33 UI_CHROMEOS_EXPORT gfx::ImageSkia GetImageForNetwork(
34 const chromeos::NetworkState* network,
35 IconType icon_type);
37 // Similar to GetImageForNetwork but returns the cached image url based on
38 // |scale_factor| instead.
39 UI_CHROMEOS_EXPORT std::string GetImageUrlForNetwork(
40 const chromeos::NetworkState* network,
41 IconType icon_type,
42 float scale_factor);
44 // Gets the fulls strength image for a connected network type.
45 UI_CHROMEOS_EXPORT gfx::ImageSkia GetImageForConnectedNetwork(
46 IconType icon_type,
47 const std::string& network_type);
49 // Gets the image for a connecting network type.
50 UI_CHROMEOS_EXPORT gfx::ImageSkia GetImageForConnectingNetwork(
51 IconType icon_type,
52 const std::string& network_type);
54 // Gets the image for a disconnected network type.
55 UI_CHROMEOS_EXPORT gfx::ImageSkia GetImageForDisconnectedNetwork(
56 IconType icon_type,
57 const std::string& network_type);
59 // Returns the label for |network| based on |icon_type|. |network| can be NULL.
60 UI_CHROMEOS_EXPORT base::string16 GetLabelForNetwork(
61 const chromeos::NetworkState* network,
62 IconType icon_type);
64 // Updates and returns the appropriate message id if the cellular network
65 // is uninitialized.
66 UI_CHROMEOS_EXPORT int GetCellularUninitializedMsg();
68 // Gets the correct icon and label for |icon_type|. Also sets |animating|
69 // based on whether or not the icon is animating (i.e. connecting).
70 UI_CHROMEOS_EXPORT void GetDefaultNetworkImageAndLabel(IconType icon_type,
71 gfx::ImageSkia* image,
72 base::string16* label,
73 bool* animating);
75 // Called when the list of networks changes. Retreives the list of networks
76 // from the global NetworkStateHandler instance and removes cached entries
77 // that are no longer in the list.
78 UI_CHROMEOS_EXPORT void PurgeNetworkIconCache();
80 } // namespace network_icon
81 } // namespace ui
83 #endif // UI_CHROMEOS_NETWORK_NETWORK_ICON_H_