diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 04:56:36 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-10 04:56:36 +0000 |
commit | 8d577a70f6e6d2e47f0ac32f8606e489a7a77998 (patch) | |
tree | 48eae3f525e0323362db629efa2589e70a5a4e49 /chrome/browser/extensions/extension_input_api.cc | |
parent | 8fb0ecf45b286845fd2004a157a294d7e3ca7a39 (diff) | |
download | chromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.zip chromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.tar.gz chromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.tar.bz2 |
Migrate Event API methods to Google Style.
Re-landing, moving the bits Mac uses to ui/base/events.h
BUG=72040
TEST=none
TBR=sky
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=74377
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_input_api.cc')
-rw-r--r-- | chrome/browser/extensions/extension_input_api.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/chrome/browser/extensions/extension_input_api.cc b/chrome/browser/extensions/extension_input_api.cc index bb91c00..b062fd4 100644 --- a/chrome/browser/extensions/extension_input_api.cc +++ b/chrome/browser/extensions/extension_input_api.cc @@ -39,13 +39,13 @@ const char kUnsupportedModifier[] = "Unsupported modifier."; const char kNoValidRecipientError[] = "No valid recipient for event."; const char kKeyEventUnprocessedError[] = "Event was not handled."; -views::Event::EventType GetTypeFromString(const std::string& type) { +ui::EventType GetTypeFromString(const std::string& type) { if (type == kKeyDown) { - return views::Event::ET_KEY_PRESSED; + return ui::ET_KEY_PRESSED; } else if (type == kKeyUp) { - return views::Event::ET_KEY_RELEASED; + return ui::ET_KEY_RELEASED; } - return views::Event::ET_UNKNOWN; + return ui::ET_UNKNOWN; } } // namespace @@ -77,8 +77,8 @@ bool SendKeyboardEventInputFunction::RunImpl() { std::string type_name; EXTENSION_FUNCTION_VALIDATE(args->GetString(kType, &type_name)); - views::Event::EventType type = GetTypeFromString(type_name); - if (type == views::Event::ET_UNKNOWN) { + ui::EventType type = GetTypeFromString(type_name); + if (type == ui::ET_UNKNOWN) { error_ = kUnknownEventTypeError; return false; } @@ -89,21 +89,21 @@ bool SendKeyboardEventInputFunction::RunImpl() { const views::KeyEvent& prototype_event = KeyEventFromKeyIdentifier(identifier); - if (prototype_event.GetKeyCode() == ui::VKEY_UNKNOWN) { + if (prototype_event.key_code() == ui::VKEY_UNKNOWN) { error_ = kUnknownOrUnsupportedKeyIdentiferError; return false; } - int flags = prototype_event.GetFlags(); + int flags = prototype_event.flags(); bool alt = false; if (args->GetBoolean(kAlt, &alt)) - flags |= alt ? views::Event::EF_ALT_DOWN : 0; + flags |= alt ? ui::EF_ALT_DOWN : 0; bool ctrl = false; if (args->GetBoolean(kCtrl, &ctrl)) - flags |= ctrl ? views::Event::EF_CONTROL_DOWN : 0; + flags |= ctrl ? ui::EF_CONTROL_DOWN : 0; bool shift = false; if (args->GetBoolean(kShift, &shift)) - flags |= shift ? views::Event::EF_SHIFT_DOWN : 0; + flags |= shift ? ui::EF_SHIFT_DOWN : 0; bool meta = false; if (args->GetBoolean(kMeta, &meta)) { // Views does not have a Meta event flag, so return an error for now. @@ -119,7 +119,7 @@ bool SendKeyboardEventInputFunction::RunImpl() { return false; } - views::KeyEvent event(type, prototype_event.GetKeyCode(), flags, 0, 0); + views::KeyEvent event(type, prototype_event.key_code(), flags, 0, 0); if (!root_view->ProcessKeyEvent(event)) { error_ = kKeyEventUnprocessedError; return false; |