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_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "ash/ash_export.h" |
9 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
10 #include "base/i18n/time_formatting.h" | 14 #include "base/i18n/time_formatting.h" |
11 #include "base/string16.h" | 15 #include "base/string16.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
13 | 17 |
14 class SkBitmap; | 18 class SkBitmap; |
15 | 19 |
16 namespace ash { | 20 namespace ash { |
17 | 21 |
18 struct NetworkIconInfo { | 22 struct ASH_EXPORT NetworkIconInfo { |
| 23 NetworkIconInfo(); |
| 24 ~NetworkIconInfo(); |
| 25 |
19 SkBitmap image; | 26 SkBitmap image; |
20 string16 name; | 27 string16 name; |
21 string16 description; | 28 string16 description; |
| 29 std::string unique_id; |
22 }; | 30 }; |
23 | 31 |
24 class SystemTrayDelegate { | 32 class SystemTrayDelegate { |
25 public: | 33 public: |
26 virtual ~SystemTrayDelegate() {} | 34 virtual ~SystemTrayDelegate() {} |
27 | 35 |
28 // Gets information about the logged in user. | 36 // Gets information about the logged in user. |
29 virtual const std::string GetUserDisplayName() const = 0; | 37 virtual const std::string GetUserDisplayName() const = 0; |
30 virtual const std::string GetUserEmail() const = 0; | 38 virtual const std::string GetUserEmail() const = 0; |
31 virtual const SkBitmap& GetUserImage() const = 0; | 39 virtual const SkBitmap& GetUserImage() const = 0; |
32 virtual user::LoginStatus GetUserLoginStatus() const = 0; | 40 virtual user::LoginStatus GetUserLoginStatus() const = 0; |
33 | 41 |
34 // Returns whether a system upgrade is available. | 42 // Returns whether a system upgrade is available. |
35 virtual bool SystemShouldUpgrade() const = 0; | 43 virtual bool SystemShouldUpgrade() const = 0; |
36 | 44 |
37 // Returns the resource id for the icon to show for the update notification. | 45 // Returns the resource id for the icon to show for the update notification. |
38 virtual int GetSystemUpdateIconResource() const = 0; | 46 virtual int GetSystemUpdateIconResource() const = 0; |
39 | 47 |
40 // Returns the desired hour clock type. | 48 // Returns the desired hour clock type. |
41 virtual base::HourClockType GetHourClockType() const = 0; | 49 virtual base::HourClockType GetHourClockType() const = 0; |
42 | 50 |
43 // Shows settings. | 51 // Shows settings. |
44 virtual void ShowSettings() = 0; | 52 virtual void ShowSettings() = 0; |
45 | 53 |
46 // Shows the settings related to date, timezone etc. | 54 // Shows the settings related to date, timezone etc. |
47 virtual void ShowDateSettings() = 0; | 55 virtual void ShowDateSettings() = 0; |
48 | 56 |
| 57 // Show the settings related to network. |
| 58 virtual void ShowNetworkSettings() = 0; |
| 59 |
49 // Shows help. | 60 // Shows help. |
50 virtual void ShowHelp() = 0; | 61 virtual void ShowHelp() = 0; |
51 | 62 |
52 // Is the system audio muted? | 63 // Is the system audio muted? |
53 virtual bool IsAudioMuted() const = 0; | 64 virtual bool IsAudioMuted() const = 0; |
54 | 65 |
55 // Mutes/Unmutes the audio system. | 66 // Mutes/Unmutes the audio system. |
56 virtual void SetAudioMuted(bool muted) = 0; | 67 virtual void SetAudioMuted(bool muted) = 0; |
57 | 68 |
58 // Gets the volume level. | 69 // Gets the volume level. |
59 virtual float GetVolumeLevel() const = 0; | 70 virtual float GetVolumeLevel() const = 0; |
60 | 71 |
61 // Sets the volume level. | 72 // Sets the volume level. |
62 virtual void SetVolumeLevel(float level) = 0; | 73 virtual void SetVolumeLevel(float level) = 0; |
63 | 74 |
64 // Attempts to shut down the system. | 75 // Attempts to shut down the system. |
65 virtual void ShutDown() = 0; | 76 virtual void ShutDown() = 0; |
66 | 77 |
67 // Attempts to sign out the user. | 78 // Attempts to sign out the user. |
68 virtual void SignOut() = 0; | 79 virtual void SignOut() = 0; |
69 | 80 |
70 // Attempts to lock the screen. | 81 // Attempts to lock the screen. |
71 virtual void RequestLockScreen() = 0; | 82 virtual void RequestLockScreen() = 0; |
72 | 83 |
73 // Returns information about the most relevant network. Relevance is | 84 // Returns information about the most relevant network. Relevance is |
74 // determined by the implementor (e.g. a connecting network may be more | 85 // determined by the implementor (e.g. a connecting network may be more |
75 // relevant over a connected network etc.) | 86 // relevant over a connected network etc.) |
76 virtual NetworkIconInfo GetMostRelevantNetworkIcon() = 0; | 87 virtual NetworkIconInfo GetMostRelevantNetworkIcon(bool large) = 0; |
| 88 |
| 89 // Returns information about the available networks. |
| 90 virtual void GetAvailableNetworks(std::vector<NetworkIconInfo>* list) = 0; |
| 91 |
| 92 // Connects to the network specified by the unique id. |
| 93 virtual void ConnectToNetwork(const std::string& network_id) = 0; |
| 94 |
| 95 // Toggles airplane mode. |
| 96 virtual void ToggleAirplaneMode() = 0; |
| 97 |
| 98 // Shows UI for changing proxy settings. |
| 99 virtual void ChangeProxySettings() = 0; |
77 }; | 100 }; |
78 | 101 |
79 } // namespace ash | 102 } // namespace ash |
80 | 103 |
81 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 104 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
OLD | NEW |