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

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

Issue 2427913003: Use mojo volume interfaces for mash and classic ash. (Closed)
Patch Set: Split volume and system events observers; only hook up volume. Created 4 years, 2 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_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "ash/ash_export.h" 12 #include "ash/ash_export.h"
13 #include "ash/common/login_status.h" 13 #include "ash/common/login_status.h"
14 #include "ash/common/system/volume_control_delegate.h"
15 #include "base/callback_forward.h" 14 #include "base/callback_forward.h"
16 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
17 #include "base/i18n/time_formatting.h" 16 #include "base/i18n/time_formatting.h"
18 #include "base/strings/string16.h" 17 #include "base/strings/string16.h"
19 #include "ui/gfx/image/image_skia.h" 18 #include "ui/gfx/image/image_skia.h"
20 19
21 class AccountId; 20 class AccountId;
22 21
23 namespace base { 22 namespace base {
24 class TimeDelta; 23 class TimeDelta;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 class NetworkingConfigDelegate; 93 class NetworkingConfigDelegate;
95 class VPNDelegate; 94 class VPNDelegate;
96 95
97 using RebootOnShutdownCallback = base::Callback<void(bool)>; 96 using RebootOnShutdownCallback = base::Callback<void(bool)>;
98 97
99 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the 98 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the
100 // application (e.g. Chrome). These tasks should be limited to application 99 // application (e.g. Chrome). These tasks should be limited to application
101 // (browser) specific tasks. For non application specific tasks, where possible, 100 // (browser) specific tasks. For non application specific tasks, where possible,
102 // components/, chromeos/, device/, etc., code should be used directly. If more 101 // components/, chromeos/, device/, etc., code should be used directly. If more
103 // than one related method is being added, consider adding an additional 102 // than one related method is being added, consider adding an additional
104 // specific delegate (e.g. VolumeControlDelegate). 103 // specific delegate (e.g. VPNDelegate).
105 // 104 //
106 // These methods should all have trivial default implementations for platforms 105 // These methods should all have trivial default implementations for platforms
107 // that do not implement the method (e.g. return false or nullptr). This 106 // that do not implement the method (e.g. return false or nullptr). This
108 // eliminates the need to propagate default implementations across the various 107 // eliminates the need to propagate default implementations across the various
109 // implementations of this class. Consumers of this delegate should handle the 108 // implementations of this class. Consumers of this delegate should handle the
110 // default return value (e.g. nullptr). 109 // default return value (e.g. nullptr).
111 class ASH_EXPORT SystemTrayDelegate { 110 class ASH_EXPORT SystemTrayDelegate {
112 public: 111 public:
113 SystemTrayDelegate(); 112 SystemTrayDelegate();
114 virtual ~SystemTrayDelegate(); 113 virtual ~SystemTrayDelegate();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 215
217 // Returns whether the delegate has initiated a bluetooth discovery session. 216 // Returns whether the delegate has initiated a bluetooth discovery session.
218 virtual bool GetBluetoothDiscovering(); 217 virtual bool GetBluetoothDiscovering();
219 218
220 // Returns CastConfigDelegate. May return nullptr. 219 // Returns CastConfigDelegate. May return nullptr.
221 virtual CastConfigDelegate* GetCastConfigDelegate(); 220 virtual CastConfigDelegate* GetCastConfigDelegate();
222 221
223 // Returns NetworkingConfigDelegate. May return nullptr. 222 // Returns NetworkingConfigDelegate. May return nullptr.
224 virtual NetworkingConfigDelegate* GetNetworkingConfigDelegate() const; 223 virtual NetworkingConfigDelegate* GetNetworkingConfigDelegate() const;
225 224
226 // Returns VolumeControlDelegate. May return nullptr.
227 virtual VolumeControlDelegate* GetVolumeControlDelegate() const;
228
229 // Sets the VolumeControlDelegate.
230 virtual void SetVolumeControlDelegate(
231 std::unique_ptr<VolumeControlDelegate> delegate);
232
233 // Retrieves the session start time. Returns |false| if the time is not set. 225 // Retrieves the session start time. Returns |false| if the time is not set.
234 virtual bool GetSessionStartTime(base::TimeTicks* session_start_time); 226 virtual bool GetSessionStartTime(base::TimeTicks* session_start_time);
235 227
236 // Retrieves the session length limit. Returns |false| if no limit is set. 228 // Retrieves the session length limit. Returns |false| if no limit is set.
237 virtual bool GetSessionLengthLimit(base::TimeDelta* session_length_limit); 229 virtual bool GetSessionLengthLimit(base::TimeDelta* session_length_limit);
238 230
239 // Get the system tray menu size in pixels (dependent on the language). 231 // Get the system tray menu size in pixels (dependent on the language).
240 virtual int GetSystemTrayMenuWidth(); 232 virtual int GetSystemTrayMenuWidth();
241 233
242 // The active user has been changed. This will be called when the UI is ready 234 // The active user has been changed. This will be called when the UI is ready
(...skipping 29 matching lines...) Expand all
272 // Creates a system tray item for display rotation lock. 264 // Creates a system tray item for display rotation lock.
273 // TODO(jamescook): Remove this when mus has support for display management 265 // TODO(jamescook): Remove this when mus has support for display management
274 // and we have a DisplayManager equivalent. See http://crbug.com/548429 266 // and we have a DisplayManager equivalent. See http://crbug.com/548429
275 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( 267 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem(
276 SystemTray* tray); 268 SystemTray* tray);
277 }; 269 };
278 270
279 } // namespace ash 271 } // namespace ash
280 272
281 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ 273 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/default_system_tray_delegate.cc ('k') | ash/common/system/tray/system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698