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

Unified Diff: chrome/browser/ui/ash/tray_action_handler_client.h

Issue 2848813002: Introduce ash mojo interface for lock screen action handlers (Closed)
Patch Set: . Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/tray_action_handler_client.h
diff --git a/chrome/browser/ui/ash/tray_action_handler_client.h b/chrome/browser/ui/ash/tray_action_handler_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..d6f16a2eb0ba1c5d960559532eda329162759830
--- /dev/null
+++ b/chrome/browser/ui/ash/tray_action_handler_client.h
@@ -0,0 +1,50 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ASH_TRAY_ACTION_HANDLER_CLIENT_H_
+#define CHROME_BROWSER_UI_ASH_TRAY_ACTION_HANDLER_CLIENT_H_
+
+#include "ash/public/interfaces/tray_action_handler.mojom.h"
+#include "base/scoped_observer.h"
+#include "chrome/browser/chromeos/lock_screen_apps/state_observer.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace lock_screen_apps {
+class StateController;
+}
+
+// Chrome implementation of ash action handler interface.
+// Delegates action requests from ash to lock_sreen_apps::StateController and
+// lock screen apps state changes from lock_screen_apps::StateController to ash.
+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
+ public lock_screen_apps::StateObserver {
+ public:
+ explicit TrayActionHandlerClient(
+ lock_screen_apps::StateController* state_controller);
+ ~TrayActionHandlerClient() override;
+
+ // Initializes the handlers mojo bindings.
+ void Init();
+
+ // 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.
+ void RequestHandleAction(ash::mojom::TrayActionHandlerAction action) override;
+
+ // lock_screen_apps::StateObserver impl:
+ void OnLockScreenAppsStateChanged(
+ lock_screen_apps::Action action,
+ lock_screen_apps::ActionState state) override;
+
+ private:
+ lock_screen_apps::StateController* lock_screen_apps_state_controller_;
+ ScopedObserver<lock_screen_apps::StateController,
+ lock_screen_apps::StateObserver>
+ observer_;
+
+ mojo::Binding<ash::mojom::TrayActionHandlerClient> binding_;
+ ash::mojom::TrayActionHandlerControllerPtr tray_action_handler_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayActionHandlerClient);
+};
+
+#endif // CHROME_BROWSER_UI_ASH_TRAY_ACTION_HANDLER_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698