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

Unified Diff: athena/input/input_manager_impl.h

Issue 654343002: Intorduce PowerButtonObserver API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: speculative fix Created 6 years, 2 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
« no previous file with comments | « athena/input/accelerator_manager_unittest.cc ('k') | athena/input/input_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/input/input_manager_impl.h
diff --git a/athena/input/input_manager_impl.h b/athena/input/input_manager_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..b2607a75889a283c134500e8039bbbf58e33d019
--- /dev/null
+++ b/athena/input/input_manager_impl.h
@@ -0,0 +1,65 @@
+// Copyright 2014 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 ATHENA_INPUT_INPUT_MANAGER_IMPL_H_
+#define ATHENA_INPUT_INPUT_MANAGER_IMPL_H_
+
+#include "athena/input/public/input_manager.h"
+
+#include "athena/athena_export.h"
+#include "athena/input/accelerator_manager_impl.h"
+#include "ui/aura/client/event_client.h"
+#include "ui/events/event_target.h"
+
+namespace athena {
+class PowerButtonController;
+
+namespace test {
+class ScopedPowerButtonTimeoutShortener;
+}
+
+class ATHENA_EXPORT InputManagerImpl : public InputManager,
+ public ui::EventTarget,
+ public aura::client::EventClient {
+ public:
+ InputManagerImpl();
+ virtual ~InputManagerImpl();
+
+ void Init();
+ void Shutdown();
+
+ private:
+ friend class test::ScopedPowerButtonTimeoutShortener;
+
+ // InputManager:
+ virtual void OnRootWindowCreated(aura::Window* root_window) override;
+ virtual ui::EventTarget* GetTopmostEventTarget() override;
+ virtual AcceleratorManager* GetAcceleratorManager() override;
+ virtual void AddPowerButtonObserver(PowerButtonObserver* observer) override;
+ virtual void RemovePowerButtonObserver(
+ PowerButtonObserver* observer) override;
+
+ // Overridden from aura::client::EventClient:
+ virtual bool CanProcessEventsWithinSubtree(
+ const aura::Window* window) const override;
+ virtual ui::EventTarget* GetToplevelEventTarget() override;
+
+ // ui::EventTarget:
+ virtual bool CanAcceptEvent(const ui::Event& event) override;
+ virtual ui::EventTarget* GetParentTarget() override;
+ virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override;
+ virtual ui::EventTargeter* GetEventTargeter() override;
+ virtual void OnEvent(ui::Event* event) override;
+
+ int SetPowerButtonTimeoutMsForTest(int timeout);
+
+ scoped_ptr<AcceleratorManagerImpl> accelerator_manager_;
+ scoped_ptr<PowerButtonController> power_button_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(InputManagerImpl);
+};
+
+} // namespace athena
+
+#endif // ATHENA_INPUT_INPUT_MANAGER_IMPL_H_
« no previous file with comments | « athena/input/accelerator_manager_unittest.cc ('k') | athena/input/input_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698