| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "athena/input/public/input_manager.h" | 5 #include "athena/input/public/input_manager.h" |
| 6 | 6 |
| 7 #include "athena/input/accelerator_manager_impl.h" | 7 #include "athena/input/accelerator_manager_impl.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ui/aura/client/event_client.h" | 9 #include "ui/aura/client/event_client.h" |
| 10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 public aura::client::EventClient { | 21 public aura::client::EventClient { |
| 22 public: | 22 public: |
| 23 InputManagerImpl(); | 23 InputManagerImpl(); |
| 24 virtual ~InputManagerImpl(); | 24 virtual ~InputManagerImpl(); |
| 25 | 25 |
| 26 void Init(); | 26 void Init(); |
| 27 void Shutdown(); | 27 void Shutdown(); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // InputManager: | 30 // InputManager: |
| 31 virtual void OnRootWindowCreated(aura::Window* root_window) OVERRIDE; | 31 virtual void OnRootWindowCreated(aura::Window* root_window) override; |
| 32 virtual ui::EventTarget* GetTopmostEventTarget() OVERRIDE { return this; } | 32 virtual ui::EventTarget* GetTopmostEventTarget() override { return this; } |
| 33 virtual AcceleratorManager* GetAcceleratorManager() OVERRIDE { | 33 virtual AcceleratorManager* GetAcceleratorManager() override { |
| 34 return accelerator_manager_.get(); | 34 return accelerator_manager_.get(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Overridden from aura::client::EventClient: | 37 // Overridden from aura::client::EventClient: |
| 38 virtual bool CanProcessEventsWithinSubtree( | 38 virtual bool CanProcessEventsWithinSubtree( |
| 39 const aura::Window* window) const OVERRIDE { | 39 const aura::Window* window) const override { |
| 40 return window && !window->ignore_events(); | 40 return window && !window->ignore_events(); |
| 41 } | 41 } |
| 42 virtual ui::EventTarget* GetToplevelEventTarget() OVERRIDE { return this; } | 42 virtual ui::EventTarget* GetToplevelEventTarget() override { return this; } |
| 43 | 43 |
| 44 // ui::EventTarget: | 44 // ui::EventTarget: |
| 45 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE; | 45 virtual bool CanAcceptEvent(const ui::Event& event) override; |
| 46 virtual ui::EventTarget* GetParentTarget() OVERRIDE; | 46 virtual ui::EventTarget* GetParentTarget() override; |
| 47 virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE; | 47 virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override; |
| 48 virtual ui::EventTargeter* GetEventTargeter() OVERRIDE; | 48 virtual ui::EventTargeter* GetEventTargeter() override; |
| 49 virtual void OnEvent(ui::Event* event) OVERRIDE; | 49 virtual void OnEvent(ui::Event* event) override; |
| 50 | 50 |
| 51 scoped_ptr<AcceleratorManagerImpl> accelerator_manager_; | 51 scoped_ptr<AcceleratorManagerImpl> accelerator_manager_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(InputManagerImpl); | 53 DISALLOW_COPY_AND_ASSIGN(InputManagerImpl); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 InputManagerImpl::InputManagerImpl() | 56 InputManagerImpl::InputManagerImpl() |
| 57 : accelerator_manager_( | 57 : accelerator_manager_( |
| 58 AcceleratorManagerImpl::CreateGlobalAcceleratorManager()) { | 58 AcceleratorManagerImpl::CreateGlobalAcceleratorManager()) { |
| 59 DCHECK(!instance); | 59 DCHECK(!instance); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 // static | 117 // static |
| 118 void InputManager::Shutdown() { | 118 void InputManager::Shutdown() { |
| 119 DCHECK(instance); | 119 DCHECK(instance); |
| 120 delete instance; | 120 delete instance; |
| 121 DCHECK(!instance); | 121 DCHECK(!instance); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace athena | 124 } // namespace athena |
| OLD | NEW |