gtk: Implement accelerator_util.
This commit is contained in:
parent
7ca152070a
commit
b73a114f8f
2 changed files with 21 additions and 0 deletions
1
atom.gyp
1
atom.gyp
|
@ -103,6 +103,7 @@
|
||||||
'browser/net/url_request_string_job.h',
|
'browser/net/url_request_string_job.h',
|
||||||
'browser/ui/accelerator_util.cc',
|
'browser/ui/accelerator_util.cc',
|
||||||
'browser/ui/accelerator_util.h',
|
'browser/ui/accelerator_util.h',
|
||||||
|
'browser/ui/accelerator_util_gtk.cc',
|
||||||
'browser/ui/accelerator_util_mac.mm',
|
'browser/ui/accelerator_util_mac.mm',
|
||||||
'browser/ui/accelerator_util_win.cc',
|
'browser/ui/accelerator_util_win.cc',
|
||||||
'browser/ui/atom_event_processing_window.h',
|
'browser/ui/atom_event_processing_window.h',
|
||||||
|
|
20
browser/ui/accelerator_util_gtk.cc
Normal file
20
browser/ui/accelerator_util_gtk.cc
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "browser/ui/accelerator_util.h"
|
||||||
|
|
||||||
|
#include "ui/base/accelerators/accelerator.h"
|
||||||
|
#include "ui/base/accelerators/platform_accelerator_gtk.h"
|
||||||
|
|
||||||
|
namespace accelerator_util {
|
||||||
|
|
||||||
|
void SetPlatformAccelerator(ui::Accelerator* accelerator) {
|
||||||
|
scoped_ptr<ui::PlatformAccelerator> platform_accelerator(
|
||||||
|
new ui::PlatformAcceleratorGtk(
|
||||||
|
GetGdkKeyCodeForAccelerator(*accelerator),
|
||||||
|
GetGdkModifierForAccelerator(*accelerator)));
|
||||||
|
accelerator->set_platform_accelerator(platform_accelerator.Pass());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace accelerator_util
|
Loading…
Reference in a new issue