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

Unified Diff: chrome/browser/ui/ash/lock_screen_action_handler.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/lock_screen_action_handler.h
diff --git a/chrome/browser/ui/ash/lock_screen_action_handler.h b/chrome/browser/ui/ash/lock_screen_action_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..32c412a1f5bff745935602946956f0e00a46dc11
--- /dev/null
+++ b/chrome/browser/ui/ash/lock_screen_action_handler.h
@@ -0,0 +1,47 @@
+// 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_LOCK_SCREEN_ACTION_HANDLER_H_
+#define CHROME_BROWSER_UI_ASH_LOCK_SCREEN_ACTION_HANDLER_H_
+
+#include "ash/public/interfaces/action_handler.mojom.h"
+#include "base/scoped_observer.h"
+#include "chrome/browser/chromeos/lock_screen_apps/state_controller.h"
+#include "chrome/browser/chromeos/lock_screen_apps/state_observer.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+// 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 LockScreenActionHandler : public ash::mojom::ActionHandler,
+ public lock_screen_apps::StateObserver {
+ public:
+ explicit LockScreenActionHandler(
+ lock_screen_apps::StateController* state_controller);
+ ~LockScreenActionHandler() override;
+
+ // Initializes the handlers mojo bindings.
+ void Init();
+
+ // ash::mojom::ActionHandler impl:
+ void RequestHandleAction(ash::mojom::ActionHandlerAction 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::ActionHandler> binding_;
+ ash::mojom::ActionHandlerStateControllerPtr action_handler_state_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(LockScreenActionHandler);
+};
+
+#endif // CHROME_BROWSER_UI_ASH_LOCK_SCREEN_ACTION_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698