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
3 // found in the LICENSE file.
5 #ifndef ATHENA_INPUT_INPUT_MANAGER_IMPL_H_
6 #define ATHENA_INPUT_INPUT_MANAGER_IMPL_H_
8 #include "athena/input/public/input_manager.h"
10 #include "athena/athena_export.h"
11 #include "athena/input/accelerator_manager_impl.h"
12 #include "ui/aura/client/event_client.h"
13 #include "ui/events/event_target.h"
16 class PowerButtonController
;
19 class ScopedPowerButtonTimeoutShortener
;
22 class ATHENA_EXPORT InputManagerImpl
: public InputManager
,
23 public ui::EventTarget
,
24 public aura::client::EventClient
{
27 virtual ~InputManagerImpl();
33 friend class test::ScopedPowerButtonTimeoutShortener
;
36 virtual void OnRootWindowCreated(aura::Window
* root_window
) override
;
37 virtual ui::EventTarget
* GetTopmostEventTarget() override
;
38 virtual AcceleratorManager
* GetAcceleratorManager() override
;
39 virtual void AddPowerButtonObserver(PowerButtonObserver
* observer
) override
;
40 virtual void RemovePowerButtonObserver(
41 PowerButtonObserver
* observer
) override
;
43 // Overridden from aura::client::EventClient:
44 virtual bool CanProcessEventsWithinSubtree(
45 const aura::Window
* window
) const override
;
46 virtual ui::EventTarget
* GetToplevelEventTarget() override
;
49 virtual bool CanAcceptEvent(const ui::Event
& event
) override
;
50 virtual ui::EventTarget
* GetParentTarget() override
;
51 virtual scoped_ptr
<ui::EventTargetIterator
> GetChildIterator() const override
;
52 virtual ui::EventTargeter
* GetEventTargeter() override
;
53 virtual void OnEvent(ui::Event
* event
) override
;
55 int SetPowerButtonTimeoutMsForTest(int timeout
);
57 scoped_ptr
<AcceleratorManagerImpl
> accelerator_manager_
;
58 scoped_ptr
<PowerButtonController
> power_button_controller_
;
60 DISALLOW_COPY_AND_ASSIGN(InputManagerImpl
);
65 #endif // ATHENA_INPUT_INPUT_MANAGER_IMPL_H_