From: Cheng Zhao Date: Thu, 2 Jan 2014 14:12:05 +0000 (+0000) Subject: gtk: Implement accelerator_util. X-Git-Tag: v0.10.0~6^2~37 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b73a114f8f309fa585c6c11f64f2a4e53516ebf1;p=electron.git gtk: Implement accelerator_util. --- diff --git a/atom.gyp b/atom.gyp index 0bf99831..5d379fe0 100644 --- a/atom.gyp +++ b/atom.gyp @@ -103,6 +103,7 @@ 'browser/net/url_request_string_job.h', 'browser/ui/accelerator_util.cc', 'browser/ui/accelerator_util.h', + 'browser/ui/accelerator_util_gtk.cc', 'browser/ui/accelerator_util_mac.mm', 'browser/ui/accelerator_util_win.cc', 'browser/ui/atom_event_processing_window.h', diff --git a/browser/ui/accelerator_util_gtk.cc b/browser/ui/accelerator_util_gtk.cc new file mode 100644 index 00000000..ac14b260 --- /dev/null +++ b/browser/ui/accelerator_util_gtk.cc @@ -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 platform_accelerator( + new ui::PlatformAcceleratorGtk( + GetGdkKeyCodeForAccelerator(*accelerator), + GetGdkModifierForAccelerator(*accelerator))); + accelerator->set_platform_accelerator(platform_accelerator.Pass()); +} + +} // namespace accelerator_util