Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_ASH_TRAY_ACTION_HANDLER_CLIENT_H_ | |
| 6 #define CHROME_BROWSER_UI_ASH_TRAY_ACTION_HANDLER_CLIENT_H_ | |
| 7 | |
| 8 #include "ash/public/interfaces/tray_action_handler.mojom.h" | |
| 9 #include "base/scoped_observer.h" | |
| 10 #include "chrome/browser/chromeos/lock_screen_apps/state_observer.h" | |
| 11 #include "mojo/public/cpp/bindings/binding.h" | |
| 12 | |
| 13 namespace lock_screen_apps { | |
| 14 class StateController; | |
| 15 } | |
| 16 | |
| 17 // Chrome implementation of ash action handler interface. | |
| 18 // Delegates action requests from ash to lock_sreen_apps::StateController and | |
| 19 // lock screen apps state changes from lock_screen_apps::StateController to ash. | |
| 20 class TrayActionHandlerClient : public ash::mojom::TrayActionHandlerClient, | |
|
James Cook
2017/05/03 23:31:52
High-level comment: Do you need this class at all?
tbarzic
2017/05/04 20:58:31
OK, done. I though it might be useful to separate
| |
| 21 public lock_screen_apps::StateObserver { | |
| 22 public: | |
| 23 explicit TrayActionHandlerClient( | |
| 24 lock_screen_apps::StateController* state_controller); | |
| 25 ~TrayActionHandlerClient() override; | |
| 26 | |
| 27 // Initializes the handlers mojo bindings. | |
| 28 void Init(); | |
| 29 | |
| 30 // ash::mojom::ActionHandler impl: | |
|
James Cook
2017/05/03 23:31:51
nit: no "impl:", just ":" or "overrides:" or somet
tbarzic
2017/05/04 20:58:31
Done.
| |
| 31 void RequestHandleAction(ash::mojom::TrayActionHandlerAction action) override; | |
| 32 | |
| 33 // lock_screen_apps::StateObserver impl: | |
| 34 void OnLockScreenAppsStateChanged( | |
| 35 lock_screen_apps::Action action, | |
| 36 lock_screen_apps::ActionState state) override; | |
| 37 | |
| 38 private: | |
| 39 lock_screen_apps::StateController* lock_screen_apps_state_controller_; | |
| 40 ScopedObserver<lock_screen_apps::StateController, | |
| 41 lock_screen_apps::StateObserver> | |
| 42 observer_; | |
| 43 | |
| 44 mojo::Binding<ash::mojom::TrayActionHandlerClient> binding_; | |
| 45 ash::mojom::TrayActionHandlerControllerPtr tray_action_handler_controller_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(TrayActionHandlerClient); | |
| 48 }; | |
| 49 | |
| 50 #endif // CHROME_BROWSER_UI_ASH_TRAY_ACTION_HANDLER_CLIENT_H_ | |
| OLD | NEW |