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

Side by Side Diff: ash/mus/system_tray_delegate_mus.h

Issue 2360143004: mash: Add SystemTrayClient interface, use to show date settings (Closed)
Patch Set: reparent 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
« no previous file with comments | « ash/mus/shell_delegate_mus.cc ('k') | ash/mus/system_tray_delegate_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ 5 #ifndef ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_
6 #define ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ 6 #define ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_
7 7
8 #include "ash/common/system/tray/default_system_tray_delegate.h" 8 #include "ash/common/system/tray/default_system_tray_delegate.h"
9 #include "ash/public/interfaces/system_tray.mojom.h" 9 #include "ash/public/interfaces/system_tray.mojom.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 12
13 namespace shell {
14 class Connector;
15 }
16
13 namespace ash { 17 namespace ash {
14 18
15 // Handles the settings displayed in the system tray menu. For mus most settings 19 // Handles the settings displayed in the system tray menu. For mus most settings
16 // are obtained from chrome browser via mojo IPC. For the classic ash version 20 // are obtained from chrome browser via mojo IPC. For the classic ash version
17 // see SystemTrayDelegateChromeOS. 21 // see SystemTrayDelegateChromeOS.
18 // 22 //
19 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412. 23 // TODO: Support all methods in SystemTrayDelegate. http://crbug.com/647412.
20 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate, 24 class SystemTrayDelegateMus : public DefaultSystemTrayDelegate,
21 public mojom::SystemTray { 25 public mojom::SystemTray {
22 public: 26 public:
23 SystemTrayDelegateMus(); 27 explicit SystemTrayDelegateMus(shell::Connector* connector);
24 ~SystemTrayDelegateMus() override; 28 ~SystemTrayDelegateMus() override;
25 29
26 static SystemTrayDelegateMus* Get(); 30 static SystemTrayDelegateMus* Get();
27 31
28 private: 32 private:
33 // Connects or reconnects the |system_tray_client_| interface.
34 void ConnectToSystemTrayClient();
35
36 // Handles errors on the |system_tray_client_| interface connection.
37 void OnClientConnectionError();
38
29 // SystemTrayDelegate: 39 // SystemTrayDelegate:
30 base::HourClockType GetHourClockType() const override; 40 base::HourClockType GetHourClockType() const override;
41 void ShowDateSettings() override;
31 42
32 // mojom::SystemTray: 43 // mojom::SystemTray:
33 void SetUse24HourClock(bool use_24_hour) override; 44 void SetUse24HourClock(bool use_24_hour) override;
34 45
46 // May be null in unit tests.
47 shell::Connector* connector_;
48
49 // Client interface in chrome browser.
50 mojom::SystemTrayClientPtr system_tray_client_;
51
35 // 12 or 24 hour display. 52 // 12 or 24 hour display.
36 base::HourClockType hour_clock_type_; 53 base::HourClockType hour_clock_type_;
37 54
38 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus); 55 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateMus);
39 }; 56 };
40 57
41 } // namespace ash 58 } // namespace ash
42 59
43 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_ 60 #endif // ASH_MUS_SYSTEM_TRAY_DELEGATE_MUS_H_
OLDNEW
« no previous file with comments | « ash/mus/shell_delegate_mus.cc ('k') | ash/mus/system_tray_delegate_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698