Chromium Code Reviews| 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 "mojo/public/cpp/bindings/binding.h" | 11 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 enum class LoginStatus; | 14 enum class LoginStatus; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace views { | |
| 18 class Widget; | |
| 19 class WidgetDelegate; | |
| 20 } | |
| 21 | |
| 17 // Handles method calls delegated back to chrome from ash. Also notifies ash of | 22 // Handles method calls delegated back to chrome from ash. Also notifies ash of |
| 18 // relevant state changes in chrome. | 23 // relevant state changes in chrome. |
| 19 // TODO: Consider renaming this to SystemTrayClientChromeOS. | 24 // TODO: Consider renaming this to SystemTrayClientChromeOS. |
| 20 class SystemTrayClient : public ash::mojom::SystemTrayClient, | 25 class SystemTrayClient : public ash::mojom::SystemTrayClient, |
| 21 public chromeos::system::SystemClockObserver { | 26 public chromeos::system::SystemClockObserver { |
| 22 public: | 27 public: |
| 23 SystemTrayClient(); | 28 SystemTrayClient(); |
| 24 ~SystemTrayClient() override; | 29 ~SystemTrayClient() override; |
| 25 | 30 |
| 26 static SystemTrayClient* Get(); | 31 static SystemTrayClient* Get(); |
| 27 | 32 |
| 28 // Returns the login state based on the user type, lock screen status, etc. | 33 // Returns the login state based on the user type, lock screen status, etc. |
| 29 static ash::LoginStatus GetUserLoginStatus(); | 34 static ash::LoginStatus GetUserLoginStatus(); |
| 30 | 35 |
| 31 // Returns the container id for the parent window for new dialogs. The parent | 36 // Returns the container id for the parent window for new dialogs. The parent |
| 32 // varies based on the current login and lock screen state. | 37 // varies based on the current login and lock screen state. |
| 33 static int GetDialogParentContainerId(); | 38 static int GetDialogParentContainerId(); |
| 34 | 39 |
| 40 // Creates a modal dialog in the parent window for new dialogs on the primary | |
| 41 // display. See GetDialogParentContainerId() and views::CreateDialogWidget(). | |
| 42 // The returned widget is owned by its native widget. | |
| 43 static views::Widget* CreateUnownedDialogWidget( | |
|
James Cook
2016/10/27 22:28:27
The next CL will need this to return a Widget, eve
| |
| 44 views::WidgetDelegate* widget_delegate); | |
| 45 | |
| 35 // ash::mojom::SystemTrayClient: | 46 // ash::mojom::SystemTrayClient: |
| 36 void ShowSettings() override; | 47 void ShowSettings() override; |
| 37 void ShowDateSettings() override; | 48 void ShowDateSettings() override; |
| 38 void ShowSetTimeDialog() override; | 49 void ShowSetTimeDialog() override; |
| 39 void ShowDisplaySettings() override; | 50 void ShowDisplaySettings() override; |
| 40 void ShowPowerSettings() override; | 51 void ShowPowerSettings() override; |
| 41 void ShowChromeSlow() override; | 52 void ShowChromeSlow() override; |
| 42 void ShowIMESettings() override; | 53 void ShowIMESettings() override; |
| 43 void ShowHelp() override; | 54 void ShowHelp() override; |
| 44 void ShowAccessibilityHelp() override; | 55 void ShowAccessibilityHelp() override; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 61 // Handles errors on the |system_tray_| interface connection. | 72 // Handles errors on the |system_tray_| interface connection. |
| 62 void OnClientConnectionError(); | 73 void OnClientConnectionError(); |
| 63 | 74 |
| 64 // System tray mojo service in ash. | 75 // System tray mojo service in ash. |
| 65 ash::mojom::SystemTrayPtr system_tray_; | 76 ash::mojom::SystemTrayPtr system_tray_; |
| 66 | 77 |
| 67 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); | 78 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); |
| 68 }; | 79 }; |
| 69 | 80 |
| 70 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ | 81 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ |
| OLD | NEW |