Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: ui/chromeos/network/network_icon.h

Issue 2435903002: Move tray code from ui/chromeos/network/ (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/chromeos/material_design_icon_controller.cc ('k') | ui/chromeos/network/network_icon.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef UI_CHROMEOS_NETWORK_NETWORK_ICON_H_
6 #define UI_CHROMEOS_NETWORK_NETWORK_ICON_H_
7
8 #include <string>
9
10 #include "base/strings/string16.h"
11 #include "ui/chromeos/ui_chromeos_export.h"
12 #include "ui/gfx/image/image_skia.h"
13
14 namespace chromeos {
15 class NetworkState;
16 }
17
18 namespace ui {
19 namespace network_icon {
20
21 class AnimationObserver;
22
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
28 };
29
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);
36
37 // Gets the full strength image for a Wi-Fi network.
38 // TODO(estade): Expose SignalStrengthImageSource and use that instead.
39 UI_CHROMEOS_EXPORT gfx::ImageSkia GetImageForConnectedMobileNetwork();
40
41 // Gets the disconnected image for a cell network.
42 // TODO(estade): Expose SignalStrengthImageSource and use that instead.
43 UI_CHROMEOS_EXPORT gfx::ImageSkia GetImageForDisconnectedCellNetwork();
44
45 // Gets the full strength image for a Wi-Fi network using |icon_color| for the
46 // main icon and |badge_color| for the badge.
47 UI_CHROMEOS_EXPORT gfx::ImageSkia GetImageForNewWifiNetwork(
48 SkColor icon_color,
49 SkColor badge_color);
50
51 // Returns a vpn image suitable for use on a light background.
52 UI_CHROMEOS_EXPORT gfx::ImageSkia GetVpnImage();
53
54 // Returns the label for |network| based on |icon_type|. |network| can be NULL.
55 UI_CHROMEOS_EXPORT base::string16 GetLabelForNetwork(
56 const chromeos::NetworkState* network,
57 IconType icon_type);
58
59 // Updates and returns the appropriate message id if the cellular network
60 // is uninitialized.
61 UI_CHROMEOS_EXPORT int GetCellularUninitializedMsg();
62
63 // Gets the correct icon and label for |icon_type|. Also sets |animating|
64 // based on whether or not the icon is animating (i.e. connecting).
65 UI_CHROMEOS_EXPORT void GetDefaultNetworkImageAndLabel(IconType icon_type,
66 gfx::ImageSkia* image,
67 base::string16* label,
68 bool* animating);
69
70 // Called when the list of networks changes. Retreives the list of networks
71 // from the global NetworkStateHandler instance and removes cached entries
72 // that are no longer in the list.
73 UI_CHROMEOS_EXPORT void PurgeNetworkIconCache();
74
75 } // namespace network_icon
76 } // namespace ui
77
78 #endif // UI_CHROMEOS_NETWORK_NETWORK_ICON_H_
OLDNEW
« no previous file with comments | « ui/chromeos/material_design_icon_controller.cc ('k') | ui/chromeos/network/network_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698