Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ash / accelerators / accelerator_delegate.h
blob611db0ed2ef71d8e25a589720dcdd47a01054676
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 ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_
6 #define ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_
8 #include "ash/ash_export.h"
9 #include "base/compiler_specific.h"
10 #include "base/macros.h"
11 #include "ui/wm/core/accelerator_delegate.h"
13 namespace ash {
15 class ASH_EXPORT AcceleratorDelegate
16 : NON_EXPORTED_BASE(public wm::AcceleratorDelegate) {
17 public:
18 AcceleratorDelegate();
19 ~AcceleratorDelegate() override;
21 // wm::AcceleratorDelegate:
22 bool ProcessAccelerator(const ui::KeyEvent& event,
23 const ui::Accelerator& accelerator,
24 KeyType key_type) override;
26 private:
27 // Returns true if the window should be allowed a chance to handle
28 // system keys.
29 bool CanConsumeSystemKeys(const ui::KeyEvent& event);
31 bool ShouldProcessAcceleratorNow(const ui::KeyEvent& event,
32 const ui::Accelerator& accelerator);
34 DISALLOW_COPY_AND_ASSIGN(AcceleratorDelegate);
37 } // namespace ash
39 #endif // ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_