| 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 "components/policy/core/common/cloud/cloud_policy_store.h" |
| 11 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 13 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 14 | 15 |
| 15 namespace ash { | 16 namespace ash { |
| 16 enum class LoginStatus; | 17 enum class LoginStatus; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace views { | 20 namespace views { |
| 20 class Widget; | 21 class Widget; |
| 21 class WidgetDelegate; | 22 class WidgetDelegate; |
| 22 } | 23 } |
| 23 | 24 |
| 24 // Handles method calls delegated back to chrome from ash. Also notifies ash of | 25 // Handles method calls delegated back to chrome from ash. Also notifies ash of |
| 25 // relevant state changes in chrome. | 26 // relevant state changes in chrome. |
| 26 // TODO: Consider renaming this to SystemTrayClientChromeOS. | 27 // TODO: Consider renaming this to SystemTrayClientChromeOS. |
| 27 class SystemTrayClient : public ash::mojom::SystemTrayClient, | 28 class SystemTrayClient : public ash::mojom::SystemTrayClient, |
| 28 public chromeos::system::SystemClockObserver, | 29 public chromeos::system::SystemClockObserver, |
| 30 public policy::CloudPolicyStore::Observer, |
| 29 public content::NotificationObserver { | 31 public content::NotificationObserver { |
| 30 public: | 32 public: |
| 31 SystemTrayClient(); | 33 SystemTrayClient(); |
| 32 ~SystemTrayClient() override; | 34 ~SystemTrayClient() override; |
| 33 | 35 |
| 34 static SystemTrayClient* Get(); | 36 static SystemTrayClient* Get(); |
| 35 | 37 |
| 36 // Returns the login state based on the user type, lock screen status, etc. | 38 // Returns the login state based on the user type, lock screen status, etc. |
| 37 static ash::LoginStatus GetUserLoginStatus(); | 39 static ash::LoginStatus GetUserLoginStatus(); |
| 38 | 40 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 66 void ShowDisplaySettings() override; | 68 void ShowDisplaySettings() override; |
| 67 void ShowPowerSettings() override; | 69 void ShowPowerSettings() override; |
| 68 void ShowChromeSlow() override; | 70 void ShowChromeSlow() override; |
| 69 void ShowIMESettings() override; | 71 void ShowIMESettings() override; |
| 70 void ShowHelp() override; | 72 void ShowHelp() override; |
| 71 void ShowAccessibilityHelp() override; | 73 void ShowAccessibilityHelp() override; |
| 72 void ShowAccessibilitySettings() override; | 74 void ShowAccessibilitySettings() override; |
| 73 void ShowPaletteHelp() override; | 75 void ShowPaletteHelp() override; |
| 74 void ShowPaletteSettings() override; | 76 void ShowPaletteSettings() override; |
| 75 void ShowPublicAccountInfo() override; | 77 void ShowPublicAccountInfo() override; |
| 78 void ShowEnterpriseInfo() override; |
| 76 void ShowNetworkConfigure(const std::string& network_id) override; | 79 void ShowNetworkConfigure(const std::string& network_id) override; |
| 77 void ShowNetworkCreate(const std::string& type) override; | 80 void ShowNetworkCreate(const std::string& type) override; |
| 78 void ShowThirdPartyVpnCreate(const std::string& extension_id) override; | 81 void ShowThirdPartyVpnCreate(const std::string& extension_id) override; |
| 79 void ShowNetworkSettings(const std::string& network_id) override; | 82 void ShowNetworkSettings(const std::string& network_id) override; |
| 80 void ShowProxySettings() override; | 83 void ShowProxySettings() override; |
| 81 void SignOut() override; | 84 void SignOut() override; |
| 82 void RequestRestartForUpdate() override; | 85 void RequestRestartForUpdate() override; |
| 83 | 86 |
| 84 private: | 87 private: |
| 85 // Requests that ash show the update available icon. | 88 // Requests that ash show the update available icon. |
| 86 void HandleUpdateAvailable(); | 89 void HandleUpdateAvailable(); |
| 87 | 90 |
| 88 // chromeos::system::SystemClockObserver: | 91 // chromeos::system::SystemClockObserver: |
| 89 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; | 92 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; |
| 90 | 93 |
| 94 // policy::CloudPolicyStore::Observer |
| 95 void OnStoreLoaded(policy::CloudPolicyStore* store) override; |
| 96 void OnStoreError(policy::CloudPolicyStore* store) override; |
| 97 |
| 98 void UpdateEnterpriseDomain(); |
| 99 |
| 91 // content::NotificationObserver: | 100 // content::NotificationObserver: |
| 92 void Observe(int type, | 101 void Observe(int type, |
| 93 const content::NotificationSource& source, | 102 const content::NotificationSource& source, |
| 94 const content::NotificationDetails& details) override; | 103 const content::NotificationDetails& details) override; |
| 95 | 104 |
| 96 // System tray mojo service in ash. | 105 // System tray mojo service in ash. |
| 97 ash::mojom::SystemTrayPtr system_tray_; | 106 ash::mojom::SystemTrayPtr system_tray_; |
| 98 | 107 |
| 99 // Binds this object to the client interface. | 108 // Binds this object to the client interface. |
| 100 mojo::Binding<ash::mojom::SystemTrayClient> binding_; | 109 mojo::Binding<ash::mojom::SystemTrayClient> binding_; |
| 101 | 110 |
| 102 // Whether an Adobe Flash component update is available. | 111 // Whether an Adobe Flash component update is available. |
| 103 bool flash_update_available_ = false; | 112 bool flash_update_available_ = false; |
| 104 | 113 |
| 114 // Avoid sending ash an empty enterprise domain at startup and suppress |
| 115 // duplicate IPCs during the session. |
| 116 std::string last_enterprise_domain_; |
| 117 bool last_active_directory_managed_ = false; |
| 118 |
| 105 content::NotificationRegistrar registrar_; | 119 content::NotificationRegistrar registrar_; |
| 106 | 120 |
| 107 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); | 121 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); |
| 108 }; | 122 }; |
| 109 | 123 |
| 110 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 124 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
| OLD | NEW |