Skip to content

Commit

Permalink
Revert 58388 - Revert 58215 - Revert 58186 - Move the keyboard files …
Browse files Browse the repository at this point in the history
…from base/ to app/.

Also moves the associated classes/enums from base:: to app::.

TEST=try bots compile
BUG=NONE

Review URL: http://codereview.chromium.org/3165064

TBR=bryeung@chromium.org

TBR=phajdan.jr@chromium.org
Review URL: http://codereview.chromium.org/3361003

TBR=bryeung@chromium.org
Review URL: http://codereview.chromium.org/3337006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58390 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
akalin@chromium.org committed Sep 2, 2010
1 parent 3c70591 commit 0cc3dfe
Show file tree
Hide file tree
Showing 144 changed files with 1,102 additions and 1,165 deletions.
34 changes: 0 additions & 34 deletions app/app_base.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@
'drag_drop_types_gtk.cc',
'drag_drop_types_win.cc',
'drag_drop_types.h',
'event_synthesis_gtk.cc',
'event_synthesis_gtk.h',
'file_download_interface.h',
'gfx/font_util.h',
'gfx/font_util.cc',
Expand Down Expand Up @@ -146,17 +144,6 @@
'gtk_signal_registrar.h',
'gtk_util.cc',
'gtk_util.h',
'keyboard_code_conversion.cc',
'keyboard_code_conversion.h',
'keyboard_code_conversion_gtk.cc',
'keyboard_code_conversion_gtk.h',
'keyboard_code_conversion_mac.mm',
'keyboard_code_conversion_mac.h',
'keyboard_code_conversion_win.cc',
'keyboard_code_conversion_win.h',
'keyboard_codes.h',
'keyboard_codes_win.h',
'keyboard_codes_posix.h',
'l10n_util.cc',
'l10n_util.h',
'l10n_util_mac.h',
Expand Down Expand Up @@ -318,11 +305,6 @@
'<(gl_binding_output_dir)/gl_bindings_autogen_glx.cc',
'<(gl_binding_output_dir)/gl_bindings_autogen_glx.h',
],
'sources!': [
'keyboard_code_conversion_mac.mm',
'keyboard_code_conversion_mac.h',
'keyboard_codes_win.h',
],
'include_dirs': [
# We don't use angle, but pull the EGL/GLES headers from there.
'../third_party/angle/include',
Expand All @@ -348,13 +330,6 @@
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
],
},
'sources!': [
'event_synthesis_gtk.cc',
'event_synthesis_gtk.h',
'keyboard_code_conversion_gtk.cc',
'keyboard_code_conversion_gtk.h',
'keyboard_codes_win.h',
],
}],
['OS=="win"', {
'include_dirs': [
Expand All @@ -368,15 +343,6 @@
'<(gl_binding_output_dir)/gl_bindings_autogen_wgl.cc',
'<(gl_binding_output_dir)/gl_bindings_autogen_wgl.h',
],
'sources!': [
'event_synthesis_gtk.cc',
'event_synthesis_gtk.h',
'keyboard_code_conversion_gtk.cc',
'keyboard_code_conversion_gtk.h',
'keyboard_code_conversion_mac.mm',
'keyboard_code_conversion_mac.h',
'keyboard_codes_posix.h',
],
}],
],
},
Expand Down
43 changes: 0 additions & 43 deletions app/keyboard_code_conversion_unittest.cc

This file was deleted.

17 changes: 0 additions & 17 deletions app/keyboard_code_conversion_win.cc

This file was deleted.

19 changes: 0 additions & 19 deletions app/keyboard_code_conversion_win.h

This file was deleted.

10 changes: 5 additions & 5 deletions app/menus/accelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define APP_MENUS_ACCELERATOR_H_
#pragma once

#include "app/keyboard_codes.h"
#include "base/keyboard_codes.h"

namespace menus {

Expand All @@ -15,9 +15,9 @@ namespace menus {

class Accelerator {
public:
Accelerator() : key_code_(app::VKEY_UNKNOWN), modifiers_(0) {}
Accelerator() : key_code_(base::VKEY_UNKNOWN), modifiers_(0) {}

Accelerator(app::KeyboardCode keycode, int modifiers)
Accelerator(base::KeyboardCode keycode, int modifiers)
: key_code_(keycode),
modifiers_(modifiers) {}

Expand Down Expand Up @@ -52,7 +52,7 @@ class Accelerator {
return !(*this == rhs);
}

app::KeyboardCode GetKeyCode() const {
base::KeyboardCode GetKeyCode() const {
return key_code_;
}

Expand All @@ -62,7 +62,7 @@ class Accelerator {

protected:
// The keycode (VK_...).
app::KeyboardCode key_code_;
base::KeyboardCode key_code_;

// The state of the Shift/Ctrl/Alt keys (platform-dependent).
int modifiers_;
Expand Down
2 changes: 1 addition & 1 deletion app/menus/accelerator_cocoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace menus {
class AcceleratorCocoa : public Accelerator {
public:
AcceleratorCocoa(NSString* key_code, NSUInteger mask)
: Accelerator(app::VKEY_UNKNOWN, mask),
: Accelerator(base::VKEY_UNKNOWN, mask),
characters_([key_code copy]) {
}

Expand Down
10 changes: 5 additions & 5 deletions app/menus/accelerator_gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

#include <gdk/gdk.h>

#include "app/keyboard_code_conversion_gtk.h"
#include "app/keyboard_codes_posix.h"
#include "app/menus/accelerator.h"
#include "base/keyboard_code_conversion_gtk.h"
#include "base/keyboard_codes_posix.h"

namespace menus {

class AcceleratorGtk : public Accelerator {
public:
AcceleratorGtk(app::KeyboardCode key_code,
AcceleratorGtk(base::KeyboardCode key_code,
bool shift_pressed, bool ctrl_pressed, bool alt_pressed)
: gdk_keyval_(0) {
key_code_ = key_code;
Expand All @@ -30,7 +30,7 @@ class AcceleratorGtk : public Accelerator {
}

AcceleratorGtk(guint keyval, GdkModifierType modifier_type) {
key_code_ = app::WindowsKeyCodeForGdkKeyCode(keyval);
key_code_ = base::WindowsKeyCodeForGdkKeyCode(keyval);
gdk_keyval_ = keyval;
modifiers_ = modifier_type;
}
Expand All @@ -42,7 +42,7 @@ class AcceleratorGtk : public Accelerator {
return gdk_keyval_ > 0 ?
// The second parameter is false because accelerator keys are
// expressed in terms of the non-shift-modified key.
gdk_keyval_ : app::GdkKeyCodeForWindowsKeyCode(key_code_, false);
gdk_keyval_ : base::GdkKeyCodeForWindowsKeyCode(key_code_, false);
}

GdkModifierType gdk_modifier_type() {
Expand Down
1 change: 1 addition & 0 deletions base/base.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
'json/json_reader_unittest.cc',
'json/json_writer_unittest.cc',
'json/string_escape_unittest.cc',
'keyboard_code_conversion_unittest.cc',
'lazy_instance_unittest.cc',
'leak_tracker_unittest.cc',
'linked_list_unittest.cc',
Expand Down
12 changes: 6 additions & 6 deletions app/event_synthesis_gtk.cc → base/event_synthesis_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "app/event_synthesis_gtk.h"
#include "base/event_synthesis_gtk.h"

#include "app/keyboard_code_conversion_gtk.h"
#include "base/keyboard_code_conversion_gtk.h"

namespace app {
namespace base {

GdkEvent* SynthesizeKeyEvent(GdkWindow* window,
bool press, guint gdk_key, guint state) {
Expand Down Expand Up @@ -39,7 +39,7 @@ GdkEvent* SynthesizeKeyEvent(GdkWindow* window,
}

void SynthesizeKeyPressEvents(GdkWindow* window,
app::KeyboardCode key,
base::KeyboardCode key,
bool control, bool shift, bool alt,
std::vector<GdkEvent*>* events) {
if (control)
Expand All @@ -64,7 +64,7 @@ void SynthesizeKeyPressEvents(GdkWindow* window,
(shift ? GDK_SHIFT_MASK : 0) |
(alt ? GDK_MOD1_MASK : 0);

guint gdk_key = GdkKeyCodeForWindowsKeyCode(key, shift);
guint gdk_key = base::GdkKeyCodeForWindowsKeyCode(key, shift);
events->push_back(SynthesizeKeyEvent(window, true, gdk_key, state));
events->push_back(SynthesizeKeyEvent(window, false, gdk_key, state));

Expand All @@ -87,4 +87,4 @@ void SynthesizeKeyPressEvents(GdkWindow* window,
}
}

} // namespace app
} // namespace base
14 changes: 7 additions & 7 deletions app/event_synthesis_gtk.h → base/event_synthesis_gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
// only keyboard events). This is useful for a variety of testing purposes.
// NOTE: This should not be used outside of testing.

#ifndef APP_EVENT_SYNTHESIS_GTK_
#define APP_EVENT_SYNTHESIS_GTK_
#ifndef BASE_EVENT_SYNTHESIS_GTK_
#define BASE_EVENT_SYNTHESIS_GTK_
#pragma once

#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <vector>

#include "app/keyboard_codes.h"
#include "base/keyboard_codes.h"

namespace app {
namespace base {

// Creates and returns a key event. Passes ownership to the caller.
GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window,
Expand All @@ -28,10 +28,10 @@ GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window,
// Ownership of the events in the vector is passed to the caller.
void SynthesizeKeyPressEvents(
GdkWindow* window,
app::KeyboardCode key,
base::KeyboardCode key,
bool control, bool shift, bool alt,
std::vector<GdkEvent*>* events);

} // namespace app
} // namespace base

#endif // APP_EVENT_SYNTHESIS_GTK_
#endif // BASE_EVENT_SYNTHESIS_GTK_
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "app/keyboard_code_conversion.h"
#include "base/keyboard_code_conversion.h"

#include <string.h>

#include "app/keyboard_codes.h"
#include "base/keyboard_codes.h"

namespace app {
namespace base {

namespace {

Expand Down Expand Up @@ -293,4 +293,4 @@ KeyboardCode KeyCodeFromKeyIdentifier(const std::string& key_identifier) {
return id->key_code;
}

} // namespace app
} // namespace base
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef APP_KEYBOARD_CODE_CONVERSION_H_
#define APP_KEYBOARD_CODE_CONVERSION_H_
#ifndef BASE_KEYBOARD_CODE_CONVERSION_H_
#define BASE_KEYBOARD_CODE_CONVERSION_H_
#pragma once

#include "app/keyboard_codes.h"
#include "base/keyboard_codes.h"

#include <string>

namespace app {
namespace base {

// Convert a KeyIdentifer (see Section 6.3.3 here:
// http://www.w3.org/TR/DOM-Level-3-Events/#keyset-keyidentifiers)
// to a app::KeyboardCode.
// to a base::KeyboardCode.
KeyboardCode KeyCodeFromKeyIdentifier(const std::string& key_identifier);

} // namespace

#endif // APP_KEYBOARD_CODE_CONVERSION_H_
#endif // BASE_KEYBOARD_CODE_CONVERSION_H_
Loading

0 comments on commit 0cc3dfe

Please sign in to comment.