| Index: ash/accelerators/ash_menu_event_filter_delegate.h
|
| diff --git a/ash/accelerators/ash_menu_event_filter_delegate.h b/ash/accelerators/ash_menu_event_filter_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9f173594cb3d2ee6abcf76098160b331a089fd22
|
| --- /dev/null
|
| +++ b/ash/accelerators/ash_menu_event_filter_delegate.h
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2015 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 ASH_ACCELERATORS_ASH_MENU_EVENT_FILTER_DELEGATE_H_
|
| +#define ASH_ACCELERATORS_ASH_MENU_EVENT_FILTER_DELEGATE_H_
|
| +
|
| +#include "ui/views/controls/menu/menu_event_filter.h"
|
| +
|
| +namespace ui {
|
| +class AcceleratorHistory;
|
| +} // namespace ui
|
| +
|
| +namespace ash {
|
| +
|
| +// Defines an ash-specific implementation of the menu event filter delegate that
|
| +// can handle the accelerators while a menu is present.
|
| +class AshMenuEventFilterDelegate : public views::MenuEventFilter::Delegate {
|
| + public:
|
| + AshMenuEventFilterDelegate(ui::AcceleratorHistory* history);
|
| + ~AshMenuEventFilterDelegate() override;
|
| +
|
| + // views::MenuEventFilter::Delegate:
|
| + void StoreInHistory(const ui::Accelerator& accelerator) override;
|
| + views::MenuEventFilter::Delegate::Result ProcessAccelerator(
|
| + const ui::Accelerator& accelerator) override;
|
| + void ProcessAcceleratorNow(const ui::Accelerator& accelerator) override;
|
| +
|
| + private:
|
| + ui::AcceleratorHistory* accelerator_history_; // Not owned.
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AshMenuEventFilterDelegate);
|
| +};
|
| +
|
| +} // namespace ash
|
| +
|
| +#endif // ASH_ACCELERATORS_ASH_MENU_EVENT_FILTER_DELEGATE_H_
|
|
|