electron/shell/common/gin_converters/accelerator_converter.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
658 B
C++
Raw Normal View History

// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/common/gin_converters/accelerator_converter.h"
2014-08-05 00:46:06 +00:00
#include <string>
#include "shell/browser/ui/accelerator_util.h"
namespace gin {
// static
2018-04-18 01:55:30 +00:00
bool Converter<ui::Accelerator>::FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
ui::Accelerator* out) {
std::string keycode;
if (!ConvertFromV8(isolate, val, &keycode))
return false;
return accelerator_util::StringToAccelerator(keycode, out);
}
} // namespace gin