gtk: Implement accelerator_util.

This commit is contained in:
Cheng Zhao 2014-01-02 14:12:05 +00:00
parent 7ca152070a
commit b73a114f8f
2 changed files with 21 additions and 0 deletions

View file

@ -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',

View 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