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

Unified Diff: chrome/browser/chromeos/events/event_rewriter_controller.h

Issue 240173007: Convert KeyboardDrivenEventRewriter to a ui::EventRewriter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/chromeos/events/event_rewriter_controller.h
diff --git a/chrome/browser/chromeos/events/event_rewriter_controller.h b/chrome/browser/chromeos/events/event_rewriter_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..6650cec95512ef45b31712dd00d0d71c4d1164e7
--- /dev/null
+++ b/chrome/browser/chromeos/events/event_rewriter_controller.h
@@ -0,0 +1,46 @@
+// 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 CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_CONTROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_CONTROLLER_H_
+
+#include <list>
+
+#include "ui/aura/env_observer.h"
+#include "ui/events/event_rewriter.h"
+
+namespace ui {
+class EventSource;
+} // namespace ui
+
+namespace chromeos {
+
+class EventRewriterController : public aura::EnvObserver {
sadrul 2014/04/22 16:07:04 Add doc comments
+ public:
+ explicit EventRewriterController(ui::EventRewriter* rewriter);
Daniel Erat 2014/04/18 02:50:06 change the argument to a scoped_ptr to make it obv
+ ~EventRewriterController();
Daniel Erat 2014/04/18 02:50:06 virtual
+
+ void Init();
+
+ // aura::EnvObserver overrides:
+ virtual void OnWindowInitialized(aura::Window* window) OVERRIDE {}
+ virtual void OnHostInitialized(aura::WindowTreeHost* host) OVERRIDE;
+
+ private:
+ typedef std::list<ui::EventSource*> EventSourceList;
+
+ void AddToEventSource(ui::EventSource* source);
+
+ // The |EventRewriter| managed by this controller.
+ scoped_ptr<ui::EventRewriter> rewriter_;
+
+ // |EventSource|s to which the rewriter has been added.
+ EventSourceList event_sources_;
sadrul 2014/04/22 16:07:04 I assume you keep this list so that you can remove
+
+ DISALLOW_COPY_AND_ASSIGN(EventRewriterController);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698