2016-07-06 23:04:18 +00:00
|
|
|
// Copyright (c) 2016 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_UI_VIEWS_MENU_MODEL_ADAPTER_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_UI_VIEWS_MENU_MODEL_ADAPTER_H_
|
2016-07-06 23:04:18 +00:00
|
|
|
|
2023-05-11 20:07:39 +00:00
|
|
|
#include "base/memory/raw_ptr.h"
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/ui/electron_menu_model.h"
|
2016-07-06 23:04:18 +00:00
|
|
|
#include "ui/views/controls/menu/menu_model_adapter.h"
|
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
class MenuModelAdapter : public views::MenuModelAdapter {
|
|
|
|
public:
|
|
|
|
explicit MenuModelAdapter(ElectronMenuModel* menu_model);
|
2018-05-03 14:04:22 +00:00
|
|
|
~MenuModelAdapter() override;
|
2016-07-06 23:04:18 +00:00
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
MenuModelAdapter(const MenuModelAdapter&) = delete;
|
|
|
|
MenuModelAdapter& operator=(const MenuModelAdapter&) = delete;
|
|
|
|
|
2016-07-06 23:04:18 +00:00
|
|
|
protected:
|
2024-06-20 08:49:07 +00:00
|
|
|
// views::MenuModelAdapter
|
2016-07-06 23:04:18 +00:00
|
|
|
bool GetAccelerator(int id, ui::Accelerator* accelerator) const override;
|
|
|
|
|
|
|
|
private:
|
2023-05-11 20:07:39 +00:00
|
|
|
raw_ptr<ElectronMenuModel> menu_model_;
|
2016-07-06 23:04:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_UI_VIEWS_MENU_MODEL_ADAPTER_H_
|