OLD | NEW |
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 CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
7 | 7 |
8 #include "ash/public/interfaces/system_tray.mojom.h" | 8 #include "ash/public/interfaces/system_tray.mojom.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/browser/chromeos/system/system_clock_observer.h" | 10 #include "chrome/browser/chromeos/system/system_clock_observer.h" |
| 11 #include "chrome/browser/upgrade_detector.h" |
| 12 #include "chromeos/dbus/update_engine_client.h" |
11 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 13 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
12 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
13 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 16 |
14 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
15 | 18 |
16 namespace ash { | 19 namespace ash { |
17 enum class LoginStatus; | 20 enum class LoginStatus; |
18 } | 21 } |
19 | 22 |
20 namespace views { | 23 namespace views { |
21 class Widget; | 24 class Widget; |
22 class WidgetDelegate; | 25 class WidgetDelegate; |
23 } | 26 } |
24 | 27 |
25 // Handles method calls delegated back to chrome from ash. Also notifies ash of | 28 // Handles method calls delegated back to chrome from ash. Also notifies ash of |
26 // relevant state changes in chrome. | 29 // relevant state changes in chrome. |
27 // TODO: Consider renaming this to SystemTrayClientChromeOS. | 30 // TODO: Consider renaming this to SystemTrayClientChromeOS. |
28 class SystemTrayClient : public ash::mojom::SystemTrayClient, | 31 class SystemTrayClient : public ash::mojom::SystemTrayClient, |
29 public chromeos::system::SystemClockObserver, | 32 public chromeos::system::SystemClockObserver, |
30 public policy::CloudPolicyStore::Observer, | 33 public policy::CloudPolicyStore::Observer, |
31 public content::NotificationObserver { | 34 public content::NotificationObserver, |
| 35 public UpgradeDetector::UpgradeObserver { |
32 public: | 36 public: |
33 SystemTrayClient(); | 37 SystemTrayClient(); |
34 ~SystemTrayClient() override; | 38 ~SystemTrayClient() override; |
35 | 39 |
36 static SystemTrayClient* Get(); | 40 static SystemTrayClient* Get(); |
37 | 41 |
38 // Returns the login state based on the user type, lock screen status, etc. | 42 // Returns the login state based on the user type, lock screen status, etc. |
39 static ash::LoginStatus GetUserLoginStatus(); | 43 static ash::LoginStatus GetUserLoginStatus(); |
40 | 44 |
41 // Returns the container id for the parent window for new dialogs. The parent | 45 // Returns the container id for the parent window for new dialogs. The parent |
(...skipping 20 matching lines...) Expand all Loading... |
62 void ShowBluetoothPairingDialog(const std::string& address, | 66 void ShowBluetoothPairingDialog(const std::string& address, |
63 const base::string16& name_for_display, | 67 const base::string16& name_for_display, |
64 bool paired, | 68 bool paired, |
65 bool connected) override; | 69 bool connected) override; |
66 void ShowDateSettings() override; | 70 void ShowDateSettings() override; |
67 void ShowSetTimeDialog() override; | 71 void ShowSetTimeDialog() override; |
68 void ShowDisplaySettings() override; | 72 void ShowDisplaySettings() override; |
69 void ShowPowerSettings() override; | 73 void ShowPowerSettings() override; |
70 void ShowChromeSlow() override; | 74 void ShowChromeSlow() override; |
71 void ShowIMESettings() override; | 75 void ShowIMESettings() override; |
| 76 void ShowAboutChromeOS() override; |
72 void ShowHelp() override; | 77 void ShowHelp() override; |
73 void ShowAccessibilityHelp() override; | 78 void ShowAccessibilityHelp() override; |
74 void ShowAccessibilitySettings() override; | 79 void ShowAccessibilitySettings() override; |
75 void ShowPaletteHelp() override; | 80 void ShowPaletteHelp() override; |
76 void ShowPaletteSettings() override; | 81 void ShowPaletteSettings() override; |
77 void ShowPublicAccountInfo() override; | 82 void ShowPublicAccountInfo() override; |
78 void ShowEnterpriseInfo() override; | 83 void ShowEnterpriseInfo() override; |
79 void ShowNetworkConfigure(const std::string& network_id) override; | 84 void ShowNetworkConfigure(const std::string& network_id) override; |
80 void ShowNetworkCreate(const std::string& type) override; | 85 void ShowNetworkCreate(const std::string& type) override; |
81 void ShowThirdPartyVpnCreate(const std::string& extension_id) override; | 86 void ShowThirdPartyVpnCreate(const std::string& extension_id) override; |
82 void ShowNetworkSettings(const std::string& network_id) override; | 87 void ShowNetworkSettings(const std::string& network_id) override; |
83 void ShowProxySettings() override; | 88 void ShowProxySettings() override; |
84 void SignOut() override; | 89 void SignOut() override; |
85 void RequestRestartForUpdate() override; | 90 void RequestRestartForUpdate() override; |
86 | 91 |
87 private: | 92 private: |
88 // Helper function shared by ShowNetworkSettings() and ShowNetworkConfigure(). | 93 // Helper function shared by ShowNetworkSettings() and ShowNetworkConfigure(). |
89 void ShowNetworkSettingsHelper(const std::string& network_id, | 94 void ShowNetworkSettingsHelper(const std::string& network_id, |
90 bool show_configure); | 95 bool show_configure); |
91 | 96 |
92 // Requests that ash show the update available icon. | 97 // Requests that ash show the update available icon. |
93 void HandleUpdateAvailable(); | 98 void HandleUpdateAvailable(); |
94 | 99 |
| 100 // Requests that ash show the update over cellular available icon. |
| 101 void HandleUpdateOverCellularAvailable(); |
| 102 |
95 // chromeos::system::SystemClockObserver: | 103 // chromeos::system::SystemClockObserver: |
96 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; | 104 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; |
97 | 105 |
| 106 // UpgradeDetector::UpgradeObserver: |
| 107 void OnUpdateOverCellularAvailable() override; |
| 108 |
98 // policy::CloudPolicyStore::Observer | 109 // policy::CloudPolicyStore::Observer |
99 void OnStoreLoaded(policy::CloudPolicyStore* store) override; | 110 void OnStoreLoaded(policy::CloudPolicyStore* store) override; |
100 void OnStoreError(policy::CloudPolicyStore* store) override; | 111 void OnStoreError(policy::CloudPolicyStore* store) override; |
101 | 112 |
102 void UpdateEnterpriseDomain(); | 113 void UpdateEnterpriseDomain(); |
103 | 114 |
104 // content::NotificationObserver: | 115 // content::NotificationObserver: |
105 void Observe(int type, | 116 void Observe(int type, |
106 const content::NotificationSource& source, | 117 const content::NotificationSource& source, |
107 const content::NotificationDetails& details) override; | 118 const content::NotificationDetails& details) override; |
(...skipping 11 matching lines...) Expand all Loading... |
119 // duplicate IPCs during the session. | 130 // duplicate IPCs during the session. |
120 std::string last_enterprise_domain_; | 131 std::string last_enterprise_domain_; |
121 bool last_active_directory_managed_ = false; | 132 bool last_active_directory_managed_ = false; |
122 | 133 |
123 content::NotificationRegistrar registrar_; | 134 content::NotificationRegistrar registrar_; |
124 | 135 |
125 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); | 136 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); |
126 }; | 137 }; |
127 | 138 |
128 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 139 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
OLD | NEW |