| Index: ui/base/accelerators/accelerator_gtk.h
|
| diff --git a/ui/base/accelerators/accelerator_gtk.h b/ui/base/accelerators/accelerator_gtk.h
|
| index 4b4f1b3acf54fe44e4cbbc5340f2df52d283bd22..8ec6fd693b9f11dfca4b2d8c9d5b1e9cf541dbb8 100644
|
| --- a/ui/base/accelerators/accelerator_gtk.h
|
| +++ b/ui/base/accelerators/accelerator_gtk.h
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -9,49 +9,33 @@
|
| #include <gdk/gdk.h>
|
|
|
| #include "ui/base/accelerators/accelerator.h"
|
| -#include "ui/base/keycodes/keyboard_code_conversion_gtk.h"
|
| -#include "ui/base/keycodes/keyboard_codes_posix.h"
|
| +#include "ui/base/ui_export.h"
|
|
|
| namespace ui {
|
|
|
| -class AcceleratorGtk : public Accelerator {
|
| +class UI_EXPORT AcceleratorGtk : public Accelerator {
|
| public:
|
| - AcceleratorGtk(ui::KeyboardCode key_code,
|
| - bool shift_pressed, bool ctrl_pressed, bool alt_pressed)
|
| - : gdk_keyval_(0) {
|
| - key_code_ = key_code;
|
| - modifiers_ = 0;
|
| - if (shift_pressed)
|
| - modifiers_ |= GDK_SHIFT_MASK;
|
| - if (ctrl_pressed)
|
| - modifiers_ |= GDK_CONTROL_MASK;
|
| - if (alt_pressed)
|
| - modifiers_ |= GDK_MOD1_MASK;
|
| - }
|
| + AcceleratorGtk();
|
|
|
| - AcceleratorGtk(guint keyval, GdkModifierType modifier_type) {
|
| - key_code_ = ui::WindowsKeyCodeForGdkKeyCode(keyval);
|
| - gdk_keyval_ = keyval;
|
| - modifiers_ = modifier_type;
|
| - }
|
| + AcceleratorGtk(guint key_code, GdkModifierType modifier_type);
|
|
|
| - AcceleratorGtk() : gdk_keyval_(0) { }
|
| - virtual ~AcceleratorGtk() { }
|
| + AcceleratorGtk(KeyboardCode key_code,
|
| + bool shift_pressed,
|
| + bool ctrl_pressed,
|
| + bool alt_pressed);
|
|
|
| - guint GetGdkKeyCode() const {
|
| - return gdk_keyval_ > 0 ?
|
| - // The second parameter is false because accelerator keys are
|
| - // expressed in terms of the non-shift-modified key.
|
| - gdk_keyval_ : ui::GdkKeyCodeForWindowsKeyCode(key_code_, false);
|
| - }
|
| + virtual ~AcceleratorGtk();
|
| +
|
| + guint GetGdkKeyCode() const;
|
|
|
| GdkModifierType gdk_modifier_type() const {
|
| - return static_cast<GdkModifierType>(modifiers());
|
| + return static_cast<GdkModifierType>(modifiers_);
|
| }
|
|
|
| private:
|
| - // The GDK keycode.
|
| - guint gdk_keyval_;
|
| + guint gdk_key_code_;
|
| +
|
| + // Copy and assign is allowed.
|
| };
|
|
|
| } // namespace ui
|
|
|