2b316f3843
* refactor: clang-tidy modernize-use-nullptr * refactor: clang-tidy modernize-use-equals-default * refactor: clang-tidy modernize-make-unique * refactor: omit nullptr arg from unique_ptr.reset() As per comment by @miniak
25 lines
805 B
C++
25 lines
805 B
C++
// Copyright (c) 2016 GitHub, Inc.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "shell/browser/ui/views/menu_model_adapter.h"
|
|
|
|
namespace electron {
|
|
|
|
MenuModelAdapter::MenuModelAdapter(AtomMenuModel* menu_model)
|
|
: views::MenuModelAdapter(menu_model), menu_model_(menu_model) {}
|
|
|
|
MenuModelAdapter::~MenuModelAdapter() = default;
|
|
|
|
bool MenuModelAdapter::GetAccelerator(int id,
|
|
ui::Accelerator* accelerator) const {
|
|
ui::MenuModel* model = menu_model_;
|
|
int index = 0;
|
|
if (ui::MenuModel::GetModelAndIndexForCommandId(id, &model, &index)) {
|
|
return static_cast<AtomMenuModel*>(model)->GetAcceleratorAtWithParams(
|
|
index, true, accelerator);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
} // namespace electron
|