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

Side by Side Diff: ash/system/tray/system_tray_delegate.h

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 months 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
OLDNEW
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 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/system/user/login_status.h" 12 #include "ash/system/user/login_status.h"
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/i18n/time_formatting.h" 15 #include "base/i18n/time_formatting.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/strings/string16.h" 17 #include "base/strings/string16.h"
18 #include "ui/gfx/image/image_skia.h" 18 #include "ui/gfx/image/image_skia.h"
19 19
20 namespace base { 20 namespace base {
21 class TimeDelta; 21 class TimeDelta;
22 class TimeTicks; 22 class TimeTicks;
23 } 23 }
24 24
25 namespace ash { 25 namespace ash {
26 26
27 class CustodianInfoTrayObserver; 27 class CustodianInfoTrayObserver;
28 class ShutdownPolicyObserver;
28 29
29 struct ASH_EXPORT NetworkIconInfo { 30 struct ASH_EXPORT NetworkIconInfo {
30 NetworkIconInfo(); 31 NetworkIconInfo();
31 ~NetworkIconInfo(); 32 ~NetworkIconInfo();
32 33
33 bool highlight() const { return connected || connecting; } 34 bool highlight() const { return connected || connecting; }
34 35
35 bool connecting; 36 bool connecting;
36 bool connected; 37 bool connected;
37 bool tray_icon_visible; 38 bool tray_icon_visible;
38 gfx::ImageSkia image; 39 gfx::ImageSkia image;
39 base::string16 name; 40 base::string16 name;
40 base::string16 description; 41 base::string16 description;
41 std::string service_path; 42 std::string service_path;
42 bool is_cellular; 43 bool is_cellular;
43 }; 44 };
44 45
45 struct ASH_EXPORT BluetoothDeviceInfo { 46 struct ASH_EXPORT BluetoothDeviceInfo {
46 BluetoothDeviceInfo(); 47 BluetoothDeviceInfo();
47 ~BluetoothDeviceInfo(); 48 ~BluetoothDeviceInfo();
48 49
49 std::string address; 50 std::string address;
50 base::string16 display_name; 51 base::string16 display_name;
51 bool connected; 52 bool connected;
52 bool connecting; 53 bool connecting;
53 bool paired; 54 bool paired;
54 }; 55 };
55 56
56 typedef std::vector<BluetoothDeviceInfo> BluetoothDeviceList; 57 using BluetoothDeviceList = std::vector<BluetoothDeviceInfo>;
57 58
58 struct ASH_EXPORT IMEPropertyInfo { 59 struct ASH_EXPORT IMEPropertyInfo {
59 IMEPropertyInfo(); 60 IMEPropertyInfo();
60 ~IMEPropertyInfo(); 61 ~IMEPropertyInfo();
61 62
62 bool selected; 63 bool selected;
63 std::string key; 64 std::string key;
64 base::string16 name; 65 base::string16 name;
65 }; 66 };
66 67
67 typedef std::vector<IMEPropertyInfo> IMEPropertyInfoList; 68 using IMEPropertyInfoList = std::vector<IMEPropertyInfo>;
68 69
69 struct ASH_EXPORT IMEInfo { 70 struct ASH_EXPORT IMEInfo {
70 IMEInfo(); 71 IMEInfo();
71 ~IMEInfo(); 72 ~IMEInfo();
72 73
73 bool selected; 74 bool selected;
74 bool third_party; 75 bool third_party;
75 std::string id; 76 std::string id;
76 base::string16 name; 77 base::string16 name;
77 base::string16 medium_name; 78 base::string16 medium_name;
78 base::string16 short_name; 79 base::string16 short_name;
79 }; 80 };
80 81
81 struct ASH_EXPORT UpdateInfo { 82 struct ASH_EXPORT UpdateInfo {
82 enum UpdateSeverity { 83 enum UpdateSeverity {
83 UPDATE_NORMAL, 84 UPDATE_NORMAL,
84 UPDATE_LOW_GREEN, 85 UPDATE_LOW_GREEN,
85 UPDATE_HIGH_ORANGE, 86 UPDATE_HIGH_ORANGE,
86 UPDATE_SEVERE_RED, 87 UPDATE_SEVERE_RED,
87 }; 88 };
88 89
89 UpdateInfo(); 90 UpdateInfo();
90 ~UpdateInfo(); 91 ~UpdateInfo();
91 92
92 UpdateSeverity severity; 93 UpdateSeverity severity;
93 bool update_required; 94 bool update_required;
94 bool factory_reset_required; 95 bool factory_reset_required;
95 }; 96 };
96 97
97 typedef std::vector<IMEInfo> IMEInfoList; 98 using IMEInfoList = std::vector<IMEInfo>;
98 99
99 class VolumeControlDelegate; 100 class VolumeControlDelegate;
100 101
102 using RebootOnShutdownCallback = base::Callback<void(bool)>;
103
101 namespace tray { 104 namespace tray {
102 class UserAccountsDelegate; 105 class UserAccountsDelegate;
103 } // namespace tray 106 } // namespace tray
104 107
105 class ASH_EXPORT SystemTrayDelegate { 108 class ASH_EXPORT SystemTrayDelegate {
106 public: 109 public:
107 virtual ~SystemTrayDelegate() {} 110 virtual ~SystemTrayDelegate() {}
108 111
109 // Called after SystemTray has been instantiated. 112 // Called after SystemTray has been instantiated.
110 virtual void Initialize() = 0; 113 virtual void Initialize() = 0;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // Returns accounts delegate for given user. 296 // Returns accounts delegate for given user.
294 virtual tray::UserAccountsDelegate* GetUserAccountsDelegate( 297 virtual tray::UserAccountsDelegate* GetUserAccountsDelegate(
295 const std::string& user_id) = 0; 298 const std::string& user_id) = 0;
296 299
297 // Adding observers that are notified when supervised info is being changed. 300 // Adding observers that are notified when supervised info is being changed.
298 virtual void AddCustodianInfoTrayObserver( 301 virtual void AddCustodianInfoTrayObserver(
299 CustodianInfoTrayObserver* observer) = 0; 302 CustodianInfoTrayObserver* observer) = 0;
300 303
301 virtual void RemoveCustodianInfoTrayObserver( 304 virtual void RemoveCustodianInfoTrayObserver(
302 CustodianInfoTrayObserver* observer) = 0; 305 CustodianInfoTrayObserver* observer) = 0;
306
307 // Adds an observer whose |OnShutdownPolicyChanged| function is called when
308 // the |DeviceRebootOnShutdown| policy changes. If this policy is set to
309 // true, a device cannot be shut down anymore but only rebooted.
310 virtual void AddShutdownPolicyObserver(ShutdownPolicyObserver* observer) = 0;
311
312 virtual void RemoveShutdownPolicyObserver(
313 ShutdownPolicyObserver* observer) = 0;
314
315 // Determines whether the device is automatically rebooted when shut down as
316 // specified by the device policy |DeviceRebootOnShutdown|. This function
317 // asynchronously calls |callback| once a trusted policy becomes available.
318 virtual void ShouldRebootOnShutdown(
319 const RebootOnShutdownCallback& callback) = 0;
303 }; 320 };
304 321
305 } // namespace ash 322 } // namespace ash
306 323
307 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ 324 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_
OLDNEW
« no previous file with comments | « ash/system/tray/default_system_tray_delegate.cc ('k') | ash/test/test_lock_state_controller_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698