diff options
author | bryeung@chromium.org <bryeung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 00:38:27 +0000 |
---|---|---|
committer | bryeung@chromium.org <bryeung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 00:38:27 +0000 |
commit | 7f05552488f8f9ea5000512fd1972894aee7ee82 (patch) | |
tree | 0e2ed5a562335907e44307a1d99e9c6ab8d8a3ec /chrome | |
parent | 9d7e8fd4a448491817b816585d6f375d71c0a97a (diff) | |
download | chromium_src-7f05552488f8f9ea5000512fd1972894aee7ee82.zip chromium_src-7f05552488f8f9ea5000512fd1972894aee7ee82.tar.gz chromium_src-7f05552488f8f9ea5000512fd1972894aee7ee82.tar.bz2 |
Re-lands 58186:
Original message:
"""
Move the keyboard files 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=phajdan.jr@chromium.org
Review URL: http://codereview.chromium.org/3354005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58438 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
73 files changed, 563 insertions, 563 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc b/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc index 5b00bab..8ffb9cc 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc @@ -4,7 +4,7 @@ #include <stdio.h> -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/platform_thread.h" @@ -43,24 +43,24 @@ namespace { const char kSearchKeyword[] = "foo"; const wchar_t kSearchKeywordKeys[] = { - base::VKEY_F, base::VKEY_O, base::VKEY_O, 0 + app::VKEY_F, app::VKEY_O, app::VKEY_O, 0 }; const char kSearchURL[] = "http://www.foo.com/search?q={searchTerms}"; const char kSearchShortName[] = "foo"; const char kSearchText[] = "abc"; const wchar_t kSearchTextKeys[] = { - base::VKEY_A, base::VKEY_B, base::VKEY_C, 0 + app::VKEY_A, app::VKEY_B, app::VKEY_C, 0 }; const char kSearchTextURL[] = "http://www.foo.com/search?q=abc"; const char kSearchSingleChar[] = "z"; -const wchar_t kSearchSingleCharKeys[] = { base::VKEY_Z, 0 }; +const wchar_t kSearchSingleCharKeys[] = { app::VKEY_Z, 0 }; const char kSearchSingleCharURL[] = "http://www.foo.com/search?q=z"; const char kHistoryPageURL[] = "chrome://history/#q=abc"; const char kDesiredTLDHostname[] = "www.bar.com"; const wchar_t kDesiredTLDKeys[] = { - base::VKEY_B, base::VKEY_A, base::VKEY_R, 0 + app::VKEY_B, app::VKEY_A, app::VKEY_R, 0 }; // Hostnames that shall be blocked by host resolver. @@ -122,7 +122,7 @@ class AutocompleteEditViewTest : public InProcessBrowserTest, ASSERT_TRUE(*edit_view); } - void SendKey(base::KeyboardCode key, bool control, bool shift, bool alt) { + void SendKey(app::KeyboardCode key, bool control, bool shift, bool alt) { gfx::NativeWindow window = NULL; ASSERT_NO_FATAL_FAILURE(GetNativeWindow(&window)); ASSERT_TRUE( @@ -132,7 +132,7 @@ class AutocompleteEditViewTest : public InProcessBrowserTest, void SendKeySequence(const wchar_t* keys) { for (; *keys; ++keys) - ASSERT_NO_FATAL_FAILURE(SendKey(static_cast<base::KeyboardCode>(*keys), + ASSERT_NO_FATAL_FAILURE(SendKey(static_cast<app::KeyboardCode>(*keys), false, false, false)); } @@ -299,25 +299,25 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, BrowserAccelerators) { ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); // Select the first Tab. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_1, true, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_1, true, false, false)); ASSERT_EQ(0, browser()->selected_index()); browser()->FocusLocationBar(); // Select the second Tab. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_2, true, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_2, true, false, false)); ASSERT_EQ(1, browser()->selected_index()); browser()->FocusLocationBar(); // Close a Tab. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_W, true, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_W, true, false, false)); ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count)); // Try ctrl-l to focus location bar. edit_view->SetUserText(L"Hello world"); EXPECT_FALSE(edit_view->IsSelectAll()); - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_L, true, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_L, true, false, false)); EXPECT_TRUE(edit_view->IsSelectAll()); } @@ -334,17 +334,17 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, BackspaceInKeywordMode) { ASSERT_EQ(kSearchKeyword, WideToUTF8(edit_view->model()->keyword())); // Trigger keyword mode. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_TAB, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_TAB, false, false, false)); ASSERT_FALSE(edit_view->model()->is_keyword_hint()); ASSERT_EQ(kSearchKeyword, WideToUTF8(edit_view->model()->keyword())); // Backspace without search text should bring back keyword hint mode. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_BACK, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); ASSERT_TRUE(edit_view->model()->is_keyword_hint()); ASSERT_EQ(kSearchKeyword, WideToUTF8(edit_view->model()->keyword())); // Trigger keyword mode again. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_TAB, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_TAB, false, false, false)); ASSERT_FALSE(edit_view->model()->is_keyword_hint()); ASSERT_EQ(kSearchKeyword, WideToUTF8(edit_view->model()->keyword())); @@ -354,7 +354,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, BackspaceInKeywordMode) { // Should stay in keyword mode while deleting search text by pressing // backspace. for (size_t i = 0; i < arraysize(kSearchText) - 1; ++i) { - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_BACK, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); ASSERT_FALSE(edit_view->model()->is_keyword_hint()); ASSERT_EQ(kSearchKeyword, WideToUTF8(edit_view->model()->keyword())); } @@ -363,10 +363,10 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, BackspaceInKeywordMode) { ASSERT_NO_FATAL_FAILURE(SendKeySequence(kSearchTextKeys)); // Move cursor to the beginning of the search text. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_HOME, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_HOME, false, false, false)); // Backspace at the beginning of the search text shall turn off // the keyword mode. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_BACK, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); ASSERT_FALSE(edit_view->model()->is_keyword_hint()); ASSERT_EQ(std::string(), WideToUTF8(edit_view->model()->keyword())); ASSERT_EQ(std::string(kSearchKeyword) + kSearchText, @@ -386,11 +386,11 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, Escape) { EXPECT_TRUE(edit_view->IsSelectAll()); // Delete all text in omnibox. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_BACK, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_BACK, false, false, false)); EXPECT_TRUE(edit_view->GetText().empty()); // Escape shall revert the text in omnibox. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_ESCAPE, false, false, false)); EXPECT_EQ(old_text, edit_view->GetText()); EXPECT_TRUE(edit_view->IsSelectAll()); } @@ -409,7 +409,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, DesiredTLD) { ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone()); ASSERT_TRUE(popup_model->IsOpen()); // ctrl-Enter triggers desired_tld feature, thus www.bar.com shall be opened. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, true, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, true, false, false)); GURL url = browser()->GetSelectedTabContents()->GetURL(); EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str()); @@ -426,7 +426,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, AltEnter) { edit_view->SetUserText(ASCIIToWide(chrome::kChromeUIHistoryURL)); int tab_count = browser()->tab_count(); // alt-Enter opens a new tab. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, true)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, true)); ASSERT_NO_FATAL_FAILURE(WaitForTabOpenOrClose(tab_count + 1)); } @@ -450,7 +450,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EnterToSearch) { popup_model->result().default_match()->type); // Open the default match. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, false)); GURL url = browser()->GetSelectedTabContents()->GetURL(); EXPECT_STREQ(kSearchTextURL, url.spec().c_str()); @@ -467,7 +467,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EnterToSearch) { popup_model->result().default_match()->type); // Open the default match. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, false)); url = browser()->GetSelectedTabContents()->GetURL(); EXPECT_STREQ(kSearchSingleCharURL, url.spec().c_str()); } @@ -495,7 +495,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EnterToOpenHistoryPage) { AutocompleteMatch::OPEN_HISTORY_PAGE) break; size_t old_selected_line = popup_model->selected_line(); - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_DOWN, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_DOWN, false, false, false)); ASSERT_EQ(old_selected_line + 1, popup_model->selected_line()); if (popup_model->selected_line() == size - 1) break; @@ -506,7 +506,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EnterToOpenHistoryPage) { popup_model->result().match_at(popup_model->selected_line()).type); // Open the history page item. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_RETURN, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_RETURN, false, false, false)); GURL url = browser()->GetSelectedTabContents()->GetURL(); EXPECT_STREQ(kHistoryPageURL, url.spec().c_str()); } @@ -536,7 +536,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EscapeToDefaultMatch) { // Move to another line with different text. size_t size = popup_model->result().size(); while (popup_model->selected_line() < size - 1) { - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_DOWN, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_DOWN, false, false, false)); ASSERT_NE(old_selected_line, popup_model->selected_line()); if (old_text != edit_view->GetText()) break; @@ -545,7 +545,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteEditViewTest, EscapeToDefaultMatch) { EXPECT_NE(old_text, edit_view->GetText()); // Escape shall revert back to the default match item. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_ESCAPE, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_ESCAPE, false, false, false)); EXPECT_EQ(old_text, edit_view->GetText()); EXPECT_EQ(old_selected_line, popup_model->selected_line()); } diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index 0230fb3..e75ce26 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -13,6 +13,7 @@ #include "app/clipboard/clipboard.h" #include "app/clipboard/scoped_clipboard_writer.h" +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/l10n_util_win.h" #include "app/os_exchange_data.h" @@ -24,7 +25,6 @@ #include "base/basictypes.h" #include "base/i18n/rtl.h" #include "base/iat_patch.h" -#include "base/keyboard_codes.h" #include "base/lazy_instance.h" #include "base/ref_counted.h" #include "base/utf_string_conversions.h" @@ -877,10 +877,10 @@ void AutocompleteEditViewWin::PasteAndGo(const std::wstring& text) { bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing( const views::KeyEvent& e) { - base::KeyboardCode key = e.GetKeyCode(); + app::KeyboardCode key = e.GetKeyCode(); // We don't process ALT + numpad digit as accelerators, they are used for // entering special characters. We do translate alt-home. - if (e.IsAltDown() && (key != base::VKEY_HOME) && + if (e.IsAltDown() && (key != app::VKEY_HOME) && win_util::IsNumPadDigit(key, e.IsExtendedKey())) return true; @@ -892,28 +892,28 @@ bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing( // accelerators (e.g., F5 for reload the page should work even when the // Omnibox gets focused). switch (key) { - case base::VKEY_ESCAPE: { + case app::VKEY_ESCAPE: { ScopedFreeze freeze(this, GetTextObjectModel()); return model_->OnEscapeKeyPressed(); } - case base::VKEY_RETURN: + case app::VKEY_RETURN: return true; - case base::VKEY_UP: - case base::VKEY_DOWN: + case app::VKEY_UP: + case app::VKEY_DOWN: return !e.IsAltDown(); - case base::VKEY_DELETE: - case base::VKEY_INSERT: + case app::VKEY_DELETE: + case app::VKEY_INSERT: return !e.IsAltDown() && e.IsShiftDown() && !e.IsControlDown(); - case base::VKEY_X: - case base::VKEY_V: + case app::VKEY_X: + case app::VKEY_V: return !e.IsAltDown() && e.IsControlDown(); - case base::VKEY_BACK: - case base::VKEY_OEM_PLUS: + case app::VKEY_BACK: + case app::VKEY_OEM_PLUS: return true; default: @@ -1761,7 +1761,7 @@ void AutocompleteEditViewWin::HandleKeystroke(UINT message, ScopedFreeze freeze(this, GetTextObjectModel()); OnBeforePossibleChange(); - if (key == base::VKEY_HOME || key == base::VKEY_END) { + if (key == app::VKEY_HOME || key == app::VKEY_END) { // DefWindowProc() might reset the keyboard layout when it receives a // keydown event for VKEY_HOME or VKEY_END. When the window was created // with WS_EX_LAYOUTRTL and the current keyboard layout is not a RTL one, diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 61a179f..fb06b9a 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -12,7 +12,6 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/json/string_escape.h" -#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "base/path_service.h" #include "base/process_util.h" diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 41994e8..3495991 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -4,8 +4,8 @@ #include "chrome/browser/automation/automation_provider.h" +#include "app/keyboard_codes.h" #include "base/json/json_reader.h" -#include "base/keyboard_codes.h" #include "base/trace_event.h" #include "base/utf_string_conversions.h" #include "chrome/browser/automation/automation_browser_tracker.h" @@ -200,7 +200,7 @@ void AutomationProvider::WindowSimulateDrag(int handle, if (press_escape_en_route) { // Press Escape. - ui_controls::SendKeyPress(window, base::VKEY_ESCAPE, + ui_controls::SendKeyPress(window, app::VKEY_ESCAPE, ((flags & views::Event::EF_CONTROL_DOWN) == views::Event::EF_CONTROL_DOWN), ((flags & views::Event::EF_SHIFT_DOWN) == diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 89c69f0..62e98a9 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -894,7 +894,7 @@ void TestingAutomationProvider::WindowSimulateKeyPress( gfx::NativeWindow window = window_tracker_->GetResource(handle); // The key event is sent to whatever window is active. - ui_controls::SendKeyPress(window, static_cast<base::KeyboardCode>(key), + ui_controls::SendKeyPress(window, static_cast<app::KeyboardCode>(key), ((flags & views::Event::EF_CONTROL_DOWN) == views::Event::EF_CONTROL_DOWN), ((flags & views::Event::EF_SHIFT_DOWN) == diff --git a/chrome/browser/automation/ui_controls.h b/chrome/browser/automation/ui_controls.h index 2b26dfe..3664567 100644 --- a/chrome/browser/automation/ui_controls.h +++ b/chrome/browser/automation/ui_controls.h @@ -12,7 +12,7 @@ #include <wtypes.h> #endif -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "gfx/native_widget_types.h" #include "gfx/point.h" @@ -46,13 +46,13 @@ namespace ui_controls { // If you're writing a test chances are you want the variant in ui_test_utils. // See it for details. bool SendKeyPress(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, bool command); bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, diff --git a/chrome/browser/automation/ui_controls_linux.cc b/chrome/browser/automation/ui_controls_linux.cc index bdf71df..a2dd0ae 100644 --- a/chrome/browser/automation/ui_controls_linux.cc +++ b/chrome/browser/automation/ui_controls_linux.cc @@ -7,8 +7,8 @@ #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> +#include "app/event_synthesis_gtk.h" #include "gfx/rect.h" -#include "base/event_synthesis_gtk.h" #include "base/logging.h" #include "base/message_loop.h" #include "chrome/browser/automation/ui_controls_internal.h" @@ -96,7 +96,7 @@ void FakeAMouseMotionEvent(gint x, gint y) { namespace ui_controls { bool SendKeyPress(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, bool command) { DCHECK(command == false); // No command key on Linux GdkWindow* event_window = NULL; @@ -124,7 +124,7 @@ bool SendKeyPress(gfx::NativeWindow window, } std::vector<GdkEvent*> events; - base::SynthesizeKeyPressEvents(event_window, key, control, shift, alt, + app::SynthesizeKeyPressEvents(event_window, key, control, shift, alt, &events); for (std::vector<GdkEvent*>::iterator iter = events.begin(); iter != events.end(); ++iter) { @@ -137,7 +137,7 @@ bool SendKeyPress(gfx::NativeWindow window, } bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, bool command, Task* task) { diff --git a/chrome/browser/automation/ui_controls_mac.mm b/chrome/browser/automation/ui_controls_mac.mm index d95dbc2..5edfa5d 100644 --- a/chrome/browser/automation/ui_controls_mac.mm +++ b/chrome/browser/automation/ui_controls_mac.mm @@ -8,7 +8,7 @@ #include <mach/mach_time.h> #include <vector> -#include "base/keyboard_code_conversion_mac.h" +#include "app/keyboard_code_conversion_mac.h" #include "base/message_loop.h" #include "chrome/browser/automation/ui_controls_internal.h" #include "chrome/browser/chrome_thread.h" @@ -76,11 +76,11 @@ NSTimeInterval TimeIntervalSinceSystemStartup() { // Creates and returns an autoreleased key event. NSEvent* SynthesizeKeyEvent(NSWindow* window, bool keyDown, - base::KeyboardCode keycode, + app::KeyboardCode keycode, NSUInteger flags) { unichar character; unichar characterIgnoringModifiers; - int macKeycode = base::MacKeyCodeForWindowsKeyCode( + int macKeycode = app::MacKeyCodeForWindowsKeyCode( keycode, flags, &character, &characterIgnoringModifiers); if (macKeycode < 0) @@ -97,8 +97,8 @@ NSEvent* SynthesizeKeyEvent(NSWindow* window, // Modifier keys generate NSFlagsChanged event rather than // NSKeyDown/NSKeyUp events. - if (keycode == base::VKEY_CONTROL || keycode == base::VKEY_SHIFT || - keycode == base::VKEY_MENU || keycode == base::VKEY_COMMAND) + if (keycode == app::VKEY_CONTROL || keycode == app::VKEY_SHIFT || + keycode == app::VKEY_MENU || keycode == app::VKEY_COMMAND) type = NSFlagsChanged; // For events other than mouse moved, [event locationInWindow] is @@ -121,7 +121,7 @@ NSEvent* SynthesizeKeyEvent(NSWindow* window, // Creates the proper sequence of autoreleased key events for a key down + up. void SynthesizeKeyEventsSequence(NSWindow* window, - base::KeyboardCode keycode, + app::KeyboardCode keycode, bool control, bool shift, bool alt, @@ -131,25 +131,25 @@ void SynthesizeKeyEventsSequence(NSWindow* window, NSUInteger flags = 0; if (control) { flags |= NSControlKeyMask; - event = SynthesizeKeyEvent(window, true, base::VKEY_CONTROL, flags); + event = SynthesizeKeyEvent(window, true, app::VKEY_CONTROL, flags); DCHECK(event); events->push_back(event); } if (shift) { flags |= NSShiftKeyMask; - event = SynthesizeKeyEvent(window, true, base::VKEY_SHIFT, flags); + event = SynthesizeKeyEvent(window, true, app::VKEY_SHIFT, flags); DCHECK(event); events->push_back(event); } if (alt) { flags |= NSAlternateKeyMask; - event = SynthesizeKeyEvent(window, true, base::VKEY_MENU, flags); + event = SynthesizeKeyEvent(window, true, app::VKEY_MENU, flags); DCHECK(event); events->push_back(event); } if (command) { flags |= NSCommandKeyMask; - event = SynthesizeKeyEvent(window, true, base::VKEY_COMMAND, flags); + event = SynthesizeKeyEvent(window, true, app::VKEY_COMMAND, flags); DCHECK(event); events->push_back(event); } @@ -163,25 +163,25 @@ void SynthesizeKeyEventsSequence(NSWindow* window, if (command) { flags &= ~NSCommandKeyMask; - event = SynthesizeKeyEvent(window, false, base::VKEY_COMMAND, flags); + event = SynthesizeKeyEvent(window, false, app::VKEY_COMMAND, flags); DCHECK(event); events->push_back(event); } if (alt) { flags &= ~NSAlternateKeyMask; - event = SynthesizeKeyEvent(window, false, base::VKEY_MENU, flags); + event = SynthesizeKeyEvent(window, false, app::VKEY_MENU, flags); DCHECK(event); events->push_back(event); } if (shift) { flags &= ~NSShiftKeyMask; - event = SynthesizeKeyEvent(window, false, base::VKEY_SHIFT, flags); + event = SynthesizeKeyEvent(window, false, app::VKEY_SHIFT, flags); DCHECK(event); events->push_back(event); } if (control) { flags &= ~NSControlKeyMask; - event = SynthesizeKeyEvent(window, false, base::VKEY_CONTROL, flags); + event = SynthesizeKeyEvent(window, false, app::VKEY_CONTROL, flags); DCHECK(event); events->push_back(event); } @@ -221,7 +221,7 @@ NSPoint g_mouse_location = { 0, 0 }; namespace ui_controls { bool SendKeyPress(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, @@ -234,7 +234,7 @@ bool SendKeyPress(gfx::NativeWindow window, // Win and Linux implement a SendKeyPress() this as a // SendKeyPressAndRelease(), so we should as well (despite the name). bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc index 50bb88f..fdd1732 100644 --- a/chrome/browser/automation/ui_controls_win.cc +++ b/chrome/browser/automation/ui_controls_win.cc @@ -4,7 +4,8 @@ #include "chrome/browser/automation/ui_controls.h" -#include "base/keyboard_codes.h" +#include "app/keyboard_code_conversion_win.h" +#include "app/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/win_util.h" @@ -137,10 +138,10 @@ void InputDispatcher::NotifyTask() { // Populate the INPUT structure with the appropriate keyboard event // parameters required by SendInput -bool FillKeyboardInput(base::KeyboardCode key, INPUT* input, bool key_up) { +bool FillKeyboardInput(app::KeyboardCode key, INPUT* input, bool key_up) { memset(input, 0, sizeof(INPUT)); input->type = INPUT_KEYBOARD; - input->ki.wVk = win_util::KeyboardCodeToWin(key); + input->ki.wVk = app::WindowsKeyCodeForKeyboardCode(key); input->ki.dwFlags = key_up ? KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP : KEYEVENTF_EXTENDEDKEY; @@ -148,7 +149,7 @@ bool FillKeyboardInput(base::KeyboardCode key, INPUT* input, bool key_up) { } // Send a key event (up/down) -bool SendKeyEvent(base::KeyboardCode key, bool up) { +bool SendKeyEvent(app::KeyboardCode key, bool up) { INPUT input = { 0 }; if (!FillKeyboardInput(key, &input, up)) @@ -160,7 +161,7 @@ bool SendKeyEvent(base::KeyboardCode key, bool up) { return true; } -bool SendKeyPressImpl(base::KeyboardCode key, +bool SendKeyPressImpl(app::KeyboardCode key, bool control, bool shift, bool alt, Task* task) { scoped_refptr<InputDispatcher> dispatcher( @@ -171,7 +172,7 @@ bool SendKeyPressImpl(base::KeyboardCode key, // exists, send the key event directly there. HWND popup_menu = ::FindWindow(L"#32768", 0); if (popup_menu != NULL && popup_menu == ::GetTopWindow(NULL)) { - WPARAM w_param = win_util::KeyboardCodeToWin(key); + WPARAM w_param = app::WindowsKeyCodeForKeyboardCode(key); LPARAM l_param = 0; ::SendMessage(popup_menu, WM_KEYDOWN, w_param, l_param); ::SendMessage(popup_menu, WM_KEYUP, w_param, l_param); @@ -185,19 +186,19 @@ bool SendKeyPressImpl(base::KeyboardCode key, UINT i = 0; if (control) { - if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], false)) + if (!FillKeyboardInput(app::VKEY_CONTROL, &input[i], false)) return false; i++; } if (shift) { - if (!FillKeyboardInput(base::VKEY_SHIFT, &input[i], false)) + if (!FillKeyboardInput(app::VKEY_SHIFT, &input[i], false)) return false; i++; } if (alt) { - if (!FillKeyboardInput(base::VKEY_MENU, &input[i], false)) + if (!FillKeyboardInput(app::VKEY_MENU, &input[i], false)) return false; i++; } @@ -211,19 +212,19 @@ bool SendKeyPressImpl(base::KeyboardCode key, i++; if (alt) { - if (!FillKeyboardInput(base::VKEY_MENU, &input[i], true)) + if (!FillKeyboardInput(app::VKEY_MENU, &input[i], true)) return false; i++; } if (shift) { - if (!FillKeyboardInput(base::VKEY_SHIFT, &input[i], true)) + if (!FillKeyboardInput(app::VKEY_SHIFT, &input[i], true)) return false; i++; } if (control) { - if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], true)) + if (!FillKeyboardInput(app::VKEY_CONTROL, &input[i], true)) return false; i++; } @@ -322,14 +323,14 @@ bool SendMouseEventsImpl(MouseButton type, int state, Task* task) { // public functions ----------------------------------------------------------- -bool SendKeyPress(gfx::NativeWindow window, base::KeyboardCode key, +bool SendKeyPress(gfx::NativeWindow window, app::KeyboardCode key, bool control, bool shift, bool alt, bool command) { DCHECK(command == false); // No command key on Windows return SendKeyPressImpl(key, control, shift, alt, NULL); } bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, bool command, Task* task) { diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 12515f7..0b7ffa7 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -306,7 +306,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) { ASSERT_TRUE(IsViewFocused(vid)); ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_TAB, true, false, false, false)); + window, app::VKEY_TAB, true, false, false, false)); } // As above, but with ctrl+shift+tab. @@ -317,7 +317,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) { ASSERT_TRUE(IsViewFocused(vid)); ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_TAB, true, true, false, false)); + window, app::VKEY_TAB, true, true, false, false)); } } } @@ -480,7 +480,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { &actual)); ASSERT_STREQ(kExpElementIDs[j], actual.c_str()); - ASSERT_TRUE(ui_controls::SendKeyPress(window, base::VKEY_TAB, + ASSERT_TRUE(ui_controls::SendKeyPress(window, app::VKEY_TAB, false, false, false, false)); if (j < arraysize(kExpElementIDs) - 1) { @@ -509,7 +509,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { // Now let's press shift-tab to move the focus in reverse. for (size_t j = 0; j < 7; ++j) { SCOPED_TRACE(StringPrintf("inner loop: %" PRIuS, j)); - ASSERT_TRUE(ui_controls::SendKeyPress(window, base::VKEY_TAB, + ASSERT_TRUE(ui_controls::SendKeyPress(window, app::VKEY_TAB, false, true, false, false)); if (j < arraysize(kExpElementIDs) - 1) { @@ -584,7 +584,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) { std::string actual = interstitial_page->GetFocusedElement(); ASSERT_STREQ(kExpElementIDs[j], actual.c_str()); - ASSERT_TRUE(ui_controls::SendKeyPress(window, base::VKEY_TAB, + ASSERT_TRUE(ui_controls::SendKeyPress(window, app::VKEY_TAB, false, false, false, false)); if (j < arraysize(kExpElementIDs) - 1) { @@ -609,7 +609,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) { // Now let's press shift-tab to move the focus in reverse. for (size_t j = 0; j < 7; ++j) { - ASSERT_TRUE(ui_controls::SendKeyPress(window, base::VKEY_TAB, + ASSERT_TRUE(ui_controls::SendKeyPress(window, app::VKEY_TAB, false, true, false, false)); if (j < arraysize(kExpElementIDs) - 1) { @@ -682,11 +682,11 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { #if defined(OS_MACOSX) // Press Cmd+F, which will make the Find box open and request focus. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_F, false, false, false, true)); + window, app::VKEY_F, false, false, false, true)); #else // Press Ctrl+F, which will make the Find box open and request focus. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_F, true, false, false, false)); + window, app::VKEY_F, true, false, false, false)); #endif // Ideally, we wouldn't sleep here and instead would intercept the @@ -706,10 +706,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { // Now press Ctrl+F again and focus should move to the Find box. #if defined(OS_MACOSX) ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_F, false, false, false, true)); + window, app::VKEY_F, false, false, false, true)); #else ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_F, true, false, false, false)); + window, app::VKEY_F, true, false, false, false)); #endif ASSERT_TRUE(IsViewFocused(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); @@ -720,10 +720,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { // Now press Ctrl+F again and focus should move to the Find box. #if defined(OS_MACOSX) ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_F, false, false, false, true)); + window, app::VKEY_F, false, false, false, true)); #else ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_F, true, false, false, false)); + window, app::VKEY_F, true, false, false, false)); #endif // See remark above on why we wait. diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index 87a6bedf..8656e22 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -4,8 +4,8 @@ #include "build/build_config.h" +#include "app/keyboard_codes.h" #include "base/basictypes.h" -#include "base/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -63,7 +63,7 @@ const size_t kMaxResultLength = 10; // input. // Please refer to chrome/test/data/keyevents_test.html for details. struct KeyEventTestData { - base::KeyboardCode key; + app::KeyboardCode key; bool ctrl; bool shift; bool alt; @@ -142,7 +142,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { ui_test_utils::ShowAndFocusNativeWindow(window); } - void SendKey(base::KeyboardCode key, + void SendKey(app::KeyboardCode key, bool control, bool shift, bool alt, @@ -315,13 +315,13 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, NormalKeyEvents) { static const KeyEventTestData kTestNoInput[] = { // a - { base::VKEY_A, false, false, false, false, + { app::VKEY_A, false, false, false, false, false, false, false, false, 3, { "D 65 0 false false false false", "P 97 97 false false false false", "U 65 0 false false false false" } }, // shift-a - { base::VKEY_A, false, true, false, false, + { app::VKEY_A, false, true, false, false, false, false, false, false, 5, { "D 16 0 false true false false", "D 65 0 false true false false", @@ -329,7 +329,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, NormalKeyEvents) { "U 65 0 false true false false", "U 16 0 false true false false" } }, // a, suppress keydown - { base::VKEY_A, false, false, false, false, + { app::VKEY_A, false, false, false, false, true, false, false, false, 2, { "D 65 0 false false false false", "U 65 0 false false false false" } }, @@ -337,14 +337,14 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, NormalKeyEvents) { static const KeyEventTestData kTestWithInput[] = { // a - { base::VKEY_A, false, false, false, false, + { app::VKEY_A, false, false, false, false, false, false, false, false, 4, { "D 65 0 false false false false", "P 97 97 false false false false", "T a", "U 65 0 false false false false" } }, // shift-a - { base::VKEY_A, false, true, false, false, + { app::VKEY_A, false, true, false, false, false, false, false, false, 6, { "D 16 0 false true false false", "D 65 0 false true false false", @@ -353,18 +353,18 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, NormalKeyEvents) { "U 65 0 false true false false", "U 16 0 false true false false" } }, // a, suppress keydown - { base::VKEY_A, false, false, false, false, + { app::VKEY_A, false, false, false, false, true, false, false, false, 2, { "D 65 0 false false false false", "U 65 0 false false false false" } }, // a, suppress keypress - { base::VKEY_A, false, false, false, false, + { app::VKEY_A, false, false, false, false, false, true, false, false, 3, { "D 65 0 false false false false", "P 97 97 false false false false", "U 65 0 false false false false" } }, // a, suppress textInput - { base::VKEY_A, false, false, false, false, + { app::VKEY_A, false, false, false, false, false, false, false, true, 4, { "D 65 0 false false false false", "P 97 97 false false false false", @@ -410,14 +410,14 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, NormalKeyEvents) { #if defined(OS_WIN) || defined(OS_LINUX) IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CtrlKeyEvents) { static const KeyEventTestData kTestCtrlF = { - base::VKEY_F, true, false, false, false, + app::VKEY_F, true, false, false, false, false, false, false, false, 2, { "D 17 0 true false false false", "D 70 0 true false false false" } }; static const KeyEventTestData kTestCtrlFSuppressKeyDown = { - base::VKEY_F, true, false, false, false, + app::VKEY_F, true, false, false, false, true, false, false, false, 4, { "D 17 0 true false false false", "D 70 0 true false false false", @@ -428,7 +428,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CtrlKeyEvents) { // Ctrl+Z doesn't bind to any accelerators, which then should generate a // keypress event with charCode=26. static const KeyEventTestData kTestCtrlZ = { - base::VKEY_Z, true, false, false, false, + app::VKEY_Z, true, false, false, false, false, false, false, false, 5, { "D 17 0 true false false false", "D 90 0 true false false false", @@ -438,7 +438,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CtrlKeyEvents) { }; static const KeyEventTestData kTestCtrlZSuppressKeyDown = { - base::VKEY_Z, true, false, false, false, + app::VKEY_Z, true, false, false, false, true, false, false, false, 4, { "D 17 0 true false false false", "D 90 0 true false false false", @@ -448,7 +448,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CtrlKeyEvents) { // Ctrl+Enter shall generate a keypress event with charCode=10 (LF). static const KeyEventTestData kTestCtrlEnter = { - base::VKEY_RETURN, true, false, false, false, + app::VKEY_RETURN, true, false, false, false, false, false, false, false, 5, { "D 17 0 true false false false", "D 13 0 true false false false", @@ -473,7 +473,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CtrlKeyEvents) { // Press Escape to close the Find box and move the focus back to the web page. ASSERT_NO_FATAL_FAILURE( - SendKey(base::VKEY_ESCAPE, false, false, false, false)); + SendKey(app::VKEY_ESCAPE, false, false, false, false)); ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); // Press Ctrl+F with keydown suppressed shall not open the find box. @@ -487,7 +487,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CtrlKeyEvents) { #elif defined(OS_MACOSX) IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CommandKeyEvents) { static const KeyEventTestData kTestCmdF = { - base::VKEY_F, false, false, false, true, + app::VKEY_F, false, false, false, true, false, false, false, false, 2, { "D 91 0 false false false true", "D 70 0 false false false true" } @@ -495,7 +495,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CommandKeyEvents) { // On Mac we don't send key up events when command modifier is down. static const KeyEventTestData kTestCmdFSuppressKeyDown = { - base::VKEY_F, false, false, false, true, + app::VKEY_F, false, false, false, true, true, false, false, false, 3, { "D 91 0 false false false true", "D 70 0 false false false true", @@ -518,7 +518,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CommandKeyEvents) { // Press Escape to close the Find box and move the focus back to the web page. ASSERT_NO_FATAL_FAILURE( - SendKey(base::VKEY_ESCAPE, false, false, false, false)); + SendKey(app::VKEY_ESCAPE, false, false, false, false)); ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); // Press Cmd+F with keydown suppressed shall not open the find box. @@ -531,7 +531,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, AccessKeys) { #if defined(OS_MACOSX) // On Mac, access keys use ctrl+alt modifiers. static const KeyEventTestData kTestAccessA = { - base::VKEY_A, true, false, true, false, + app::VKEY_A, true, false, true, false, false, false, false, false, 6, { "D 17 0 true false false false", "D 18 0 true false true false", @@ -542,7 +542,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, AccessKeys) { }; static const KeyEventTestData kTestAccessDSuppress = { - base::VKEY_D, true, false, true, false, + app::VKEY_D, true, false, true, false, true, true, true, false, 6, { "D 17 0 true false false false", "D 18 0 true false true false", @@ -553,7 +553,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, AccessKeys) { }; static const KeyEventTestData kTestAccess1 = { - base::VKEY_1, true, false, true, false, + app::VKEY_1, true, false, true, false, false, false, false, false, 6, { "D 17 0 true false false false", "D 18 0 true false true false", @@ -564,7 +564,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, AccessKeys) { }; #else static const KeyEventTestData kTestAccessA = { - base::VKEY_A, false, false, true, false, + app::VKEY_A, false, false, true, false, false, false, false, false, 4, { "D 18 0 false false true false", "D 65 0 false false true false", @@ -573,14 +573,14 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, AccessKeys) { }; static const KeyEventTestData kTestAccessD = { - base::VKEY_D, false, false, true, false, + app::VKEY_D, false, false, true, false, false, false, false, false, 2, { "D 18 0 false false true false", "D 68 0 false false true false" } }; static const KeyEventTestData kTestAccessDSuppress = { - base::VKEY_D, false, false, true, false, + app::VKEY_D, false, false, true, false, true, true, true, false, 4, { "D 18 0 false false true false", "D 68 0 false false true false", @@ -589,7 +589,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, AccessKeys) { }; static const KeyEventTestData kTestAccess1 = { - base::VKEY_1, false, false, true, false, + app::VKEY_1, false, false, true, false, false, false, false, false, 4, { "D 18 0 false false true false", "D 49 0 false false true false", @@ -676,7 +676,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) static const KeyEventTestData kTestCtrlT = { - base::VKEY_T, true, false, false, false, + app::VKEY_T, true, false, false, false, true, false, false, false, 1, { "D 17 0 true false false false" } }; @@ -695,11 +695,11 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { // Reserved accelerators can't be suppressed. ASSERT_NO_FATAL_FAILURE(SuppressAllEvents(0, true)); // Press Ctrl+W, which will close the tab. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_W, true, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_W, true, false, false, false)); EXPECT_EQ(1, browser()->tab_count()); #elif defined(OS_MACOSX) static const KeyEventTestData kTestCmdT = { - base::VKEY_T, false, false, false, true, + app::VKEY_T, false, false, false, true, true, false, false, false, 1, { "D 91 0 false false false true" } }; @@ -718,31 +718,31 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { // Reserved accelerators can't be suppressed. ASSERT_NO_FATAL_FAILURE(SuppressAllEvents(0, true)); // Press Cmd+W, which will close the tab. - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_W, false, false, false, true)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_W, false, false, false, true)); EXPECT_EQ(1, browser()->tab_count()); #elif defined(TOOLKIT_GTK) // Ctrl-[a-z] are not treated as reserved accelerators on GTK. static const KeyEventTestData kTestCtrlT = { - base::VKEY_T, true, false, false, false, + app::VKEY_T, true, false, false, false, false, false, false, false, 2, { "D 17 0 true false false false", "D 84 0 true false false false" } }; static const KeyEventTestData kTestCtrlPageDown = { - base::VKEY_NEXT, true, false, false, false, + app::VKEY_NEXT, true, false, false, false, true, false, false, false, 1, { "D 17 0 true false false false" } }; static const KeyEventTestData kTestCtrlTab = { - base::VKEY_TAB, true, false, false, false, + app::VKEY_TAB, true, false, false, false, true, false, false, false, 1, { "D 17 0 true false false false" } }; static const KeyEventTestData kTestCtrlTBlocked = { - base::VKEY_T, true, false, false, false, + app::VKEY_T, true, false, false, false, true, false, false, false, 4, { "D 17 0 true false false false", "D 84 0 true false false false", @@ -751,7 +751,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { }; static const KeyEventTestData kTestCtrlWBlocked = { - base::VKEY_W, true, false, false, false, + app::VKEY_W, true, false, false, false, true, false, false, false, 4, { "D 17 0 true false false false", "D 87 0 true false false false", @@ -788,7 +788,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { // Ctrl+F4 to close the tab. ASSERT_NO_FATAL_FAILURE(SuppressAllEvents(0, true)); - ASSERT_NO_FATAL_FAILURE(SendKey(base::VKEY_F4, true, false, false, false)); + ASSERT_NO_FATAL_FAILURE(SendKey(app::VKEY_F4, true, false, false, false)); ASSERT_EQ(1, browser()->tab_count()); #endif } @@ -796,7 +796,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { #if defined(OS_MACOSX) IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, EditorKeyBindings) { static const KeyEventTestData kTestCtrlA = { - base::VKEY_A, true, false, false, false, + app::VKEY_A, true, false, false, false, false, false, false, false, 4, { "D 17 0 true false false false", "D 65 0 true false false false", @@ -805,7 +805,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, EditorKeyBindings) { }; static const KeyEventTestData kTestCtrlF = { - base::VKEY_F, true, false, false, false, + app::VKEY_F, true, false, false, false, false, false, false, false, 4, { "D 17 0 true false false false", "D 70 0 true false false false", @@ -814,7 +814,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, EditorKeyBindings) { }; static const KeyEventTestData kTestCtrlK = { - base::VKEY_K, true, false, false, false, + app::VKEY_K, true, false, false, false, false, false, false, false, 4, { "D 17 0 true false false false", "D 75 0 true false false false", @@ -846,14 +846,14 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, EditorKeyBindings) { IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, PageUpDownKeys) { static const KeyEventTestData kTestPageUp = { - base::VKEY_PRIOR, false, false, false, false, + app::VKEY_PRIOR, false, false, false, false, false, false, false, false, 2, { "D 33 0 false false false false", "U 33 0 false false false false" } }; static const KeyEventTestData kTestPageDown = { - base::VKEY_NEXT, false, false, false, false, + app::VKEY_NEXT, false, false, false, false, false, false, false, false, 2, { "D 34 0 false false false false", "U 34 0 false false false false" } @@ -878,21 +878,21 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, PageUpDownKeys) { #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, FocusMenuBarByAltKey) { static const KeyEventTestData kTestAltKey = { - base::VKEY_MENU, false, false, false, false, + app::VKEY_MENU, false, false, false, false, false, false, false, false, 2, { "D 18 0 false false true false", "U 18 0 false false true false" } }; static const KeyEventTestData kTestAltKeySuppress = { - base::VKEY_MENU, false, false, false, false, + app::VKEY_MENU, false, false, false, false, true, false, false, false, 2, { "D 18 0 false false true false", "U 18 0 false false true false" } }; static const KeyEventTestData kTestCtrlAltKey = { - base::VKEY_MENU, true, false, false, false, + app::VKEY_MENU, true, false, false, false, false, false, false, false, 4, { "D 17 0 true false false false", "D 18 0 true false true false", diff --git a/chrome/browser/chromeos/login/existing_user_view.cc b/chrome/browser/chromeos/login/existing_user_view.cc index 45c4176..eaadb11 100644 --- a/chrome/browser/chromeos/login/existing_user_view.cc +++ b/chrome/browser/chromeos/login/existing_user_view.cc @@ -45,7 +45,7 @@ class UserEntryTextfield : public views::Textfield { // Overridden from View: virtual bool OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == base::VKEY_TAB) { + if (e.GetKeyCode() == app::VKEY_TAB) { int index = controller_->user_index() + (e.IsShiftDown() ? -1 : 1); controller_->SelectUser(index); return true; @@ -56,7 +56,7 @@ class UserEntryTextfield : public views::Textfield { // Overridden from views::Textfield: virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { - if (e.GetKeyCode() == base::VKEY_TAB) + if (e.GetKeyCode() == app::VKEY_TAB) return true; else return views::Textfield::SkipDefaultKeyEventProcessing(e); diff --git a/chrome/browser/chromeos/login/new_user_view.cc b/chrome/browser/chromeos/login/new_user_view.cc index e727f70..ea8a563 100644 --- a/chrome/browser/chromeos/login/new_user_view.cc +++ b/chrome/browser/chromeos/login/new_user_view.cc @@ -10,11 +10,11 @@ #include <algorithm> #include <vector> +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/callback.h" #include "base/command_line.h" -#include "base/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/process_util.h" @@ -83,8 +83,8 @@ NewUserView::NewUserView(Delegate* delegate, browse_without_signin_link_(NULL), languages_menubutton_(NULL), throbber_(NULL), - accel_focus_user_(views::Accelerator(base::VKEY_U, false, false, true)), - accel_focus_pass_(views::Accelerator(base::VKEY_P, false, false, true)), + accel_focus_user_(views::Accelerator(app::VKEY_U, false, false, true)), + accel_focus_pass_(views::Accelerator(app::VKEY_P, false, false, true)), delegate_(delegate), ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)), focus_delayed_(false), @@ -385,11 +385,11 @@ bool NewUserView::HandleKeystroke(views::Textfield* s, if (!CrosLibrary::Get()->EnsureLoaded() || login_in_process_) return false; - if (keystroke.GetKeyboardCode() == base::VKEY_RETURN) { + if (keystroke.GetKeyboardCode() == app::VKEY_RETURN) { Login(); // Return true so that processing ends return true; - } else if (keystroke.GetKeyboardCode() == base::VKEY_LEFT) { + } else if (keystroke.GetKeyboardCode() == app::VKEY_LEFT) { if (s == username_field_ && username_field_->text().empty() && password_field_->text().empty()) { diff --git a/chrome/browser/chromeos/login/password_changed_view.cc b/chrome/browser/chromeos/login/password_changed_view.cc index ddb36ae..daa2909 100644 --- a/chrome/browser/chromeos/login/password_changed_view.cc +++ b/chrome/browser/chromeos/login/password_changed_view.cc @@ -4,9 +4,9 @@ #include "chrome/browser/chromeos/login/password_changed_view.h" +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "base/keyboard_codes.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" #include "grit/generated_resources.h" @@ -162,7 +162,7 @@ void PasswordChangedView::ButtonPressed(Button* sender, bool PasswordChangedView::HandleKeystroke(views::Textfield* s, const views::Textfield::Keystroke& keystroke) { - if (keystroke.GetKeyboardCode() == base::VKEY_RETURN) { + if (keystroke.GetKeyboardCode() == app::VKEY_RETURN) { ExitDialog(); return true; } diff --git a/chrome/browser/chromeos/login/screen_lock_view.cc b/chrome/browser/chromeos/login/screen_lock_view.cc index 3e19bc6..3906560 100644 --- a/chrome/browser/chromeos/login/screen_lock_view.cc +++ b/chrome/browser/chromeos/login/screen_lock_view.cc @@ -202,7 +202,7 @@ bool ScreenLockView::HandleKeystroke( views::Textfield* sender, const views::Textfield::Keystroke& keystroke) { screen_locker_->ClearErrors(); - if (keystroke.GetKeyboardCode() == base::VKEY_RETURN) { + if (keystroke.GetKeyboardCode() == app::VKEY_RETURN) { screen_locker_->Authenticate(password_field_->text()); return true; } diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 9a2038c..85cc6bd 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -718,7 +718,7 @@ ScreenLocker::~ScreenLocker() { MessageLoopForUI::current()->RemoveObserver(input_event_observer_.get()); if (locker_input_event_observer_.get()) { lock_widget_->GetFocusManager()->UnregisterAccelerator( - views::Accelerator(base::VKEY_ESCAPE, false, false, false), this); + views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); MessageLoopForUI::current()->RemoveObserver( locker_input_event_observer_.get()); } @@ -750,7 +750,7 @@ void ScreenLocker::ScreenLockReady() { lock_widget_->GetRootView()->SetVisible(true); if (background_view_->ScreenSaverEnabled()) { lock_widget_->GetFocusManager()->RegisterAccelerator( - views::Accelerator(base::VKEY_ESCAPE, false, false, false), this); + views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); locker_input_event_observer_.reset(new LockerInputEventObserver(this)); MessageLoopForUI::current()->AddObserver( locker_input_event_observer_.get()); diff --git a/chrome/browser/chromeos/login/screen_locker_browsertest.cc b/chrome/browser/chromeos/login/screen_locker_browsertest.cc index 5706e4d..f9fa9f4 100644 --- a/chrome/browser/chromeos/login/screen_locker_browsertest.cc +++ b/chrome/browser/chromeos/login/screen_locker_browsertest.cc @@ -246,7 +246,7 @@ IN_PROC_BROWSER_TEST_F(ScreenLockerTest, TestNoPasswordWithMouseClick) { void KeyPress(views::Widget* widget) { ui_controls::SendKeyPress(GTK_WINDOW(widget->GetNativeView()), - base::VKEY_SPACE, false, false, false, false); + app::VKEY_SPACE, false, false, false, false); } IN_PROC_BROWSER_TEST_F(ScreenLockerTest, TestNoPasswordWithKeyPress) { diff --git a/chrome/browser/chromeos/login/update_view.cc b/chrome/browser/chromeos/login/update_view.cc index b99f4af..e99d13d 100644 --- a/chrome/browser/chromeos/login/update_view.cc +++ b/chrome/browser/chromeos/login/update_view.cc @@ -56,7 +56,7 @@ const SkColor kManualRebootLabelColor = 0xFFAA0000; namespace chromeos { UpdateView::UpdateView(chromeos::ScreenObserver* observer) - : escape_accelerator_(base::VKEY_ESCAPE, false, false, false), + : escape_accelerator_(app::VKEY_ESCAPE, false, false, false), installing_updates_label_(NULL), reboot_label_(NULL), manual_reboot_label_(NULL), @@ -199,7 +199,7 @@ void UpdateView::Layout() { bool UpdateView::AcceleratorPressed(const views::Accelerator& a) { #if !defined(OFFICIAL_BUILD) RemoveAccelerator(escape_accelerator_); - if (a.GetKeyCode() == base::VKEY_ESCAPE) { + if (a.GetKeyCode() == app::VKEY_ESCAPE) { if (controller_ != NULL) { controller_->CancelUpdate(); } diff --git a/chrome/browser/chromeos/login/user_controller.cc b/chrome/browser/chromeos/login/user_controller.cc index 7ac62a7..22f0f9b 100644 --- a/chrome/browser/chromeos/login/user_controller.cc +++ b/chrome/browser/chromeos/login/user_controller.cc @@ -214,13 +214,13 @@ void UserController::ButtonPressed(views::Button* sender, bool UserController::HandleKeystroke( views::Textfield* sender, const views::Textfield::Keystroke& keystroke) { - if (keystroke.GetKeyboardCode() == base::VKEY_RETURN) { + if (keystroke.GetKeyboardCode() == app::VKEY_RETURN) { Login(); return true; - } else if (keystroke.GetKeyboardCode() == base::VKEY_LEFT) { + } else if (keystroke.GetKeyboardCode() == app::VKEY_LEFT) { SelectUser(user_index() - 1); return true; - } else if (keystroke.GetKeyboardCode() == base::VKEY_RIGHT) { + } else if (keystroke.GetKeyboardCode() == app::VKEY_RIGHT) { SelectUser(user_index() + 1); return true; } diff --git a/chrome/browser/chromeos/login/wizard_accessibility_helper.h b/chrome/browser/chromeos/login/wizard_accessibility_helper.h index fa411ca..5f4d370 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_helper.h +++ b/chrome/browser/chromeos/login/wizard_accessibility_helper.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ #pragma once -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/scoped_ptr.h" #include "base/singleton.h" #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h" @@ -34,7 +34,7 @@ class WizardAccessibilityHelper { void MaybeEnableAccessibility(views::View* view_tree, Profile* profile); // Keyboard accelerator key to enable accessibility. - static const base::KeyboardCode accelerator = base::VKEY_Z; + static const app::KeyboardCode accelerator = app::VKEY_Z; private: friend struct DefaultSingletonTraits<WizardAccessibilityHelper>; diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 82faecd..d8f40b1 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -86,19 +86,19 @@ class ContentView : public views::View { window_y_(window_y), screen_w_(screen_w), screen_h_(screen_h), - accel_account_screen_(views::Accelerator(base::VKEY_A, + accel_account_screen_(views::Accelerator(app::VKEY_A, false, true, true)), - accel_login_screen_(views::Accelerator(base::VKEY_L, + accel_login_screen_(views::Accelerator(app::VKEY_L, false, true, true)), - accel_network_screen_(views::Accelerator(base::VKEY_N, + accel_network_screen_(views::Accelerator(app::VKEY_N, false, true, true)), - accel_update_screen_(views::Accelerator(base::VKEY_U, + accel_update_screen_(views::Accelerator(app::VKEY_U, false, true, true)), - accel_image_screen_(views::Accelerator(base::VKEY_I, + accel_image_screen_(views::Accelerator(app::VKEY_I, false, true, true)), - accel_eula_screen_(views::Accelerator(base::VKEY_E, + accel_eula_screen_(views::Accelerator(app::VKEY_E, false, true, true)), - accel_register_screen_(views::Accelerator(base::VKEY_R, + accel_register_screen_(views::Accelerator(app::VKEY_R, false, true, true)), accel_enable_accessibility_(views::Accelerator( WizardAccessibilityHelper::accelerator, false, true, true)) { diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index 1fa0261..67d4fde 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc @@ -203,12 +203,12 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, Accelerators) { views::FocusManager* focus_manager = controller()->contents()->GetFocusManager(); - views::Accelerator accel_account_screen(base::VKEY_A, false, true, true); - views::Accelerator accel_login_screen(base::VKEY_L, false, true, true); - views::Accelerator accel_network_screen(base::VKEY_N, false, true, true); - views::Accelerator accel_update_screen(base::VKEY_U, false, true, true); - views::Accelerator accel_image_screen(base::VKEY_I, false, true, true); - views::Accelerator accel_eula_screen(base::VKEY_E, false, true, true); + views::Accelerator accel_account_screen(app::VKEY_A, false, true, true); + views::Accelerator accel_login_screen(app::VKEY_L, false, true, true); + views::Accelerator accel_network_screen(app::VKEY_N, false, true, true); + views::Accelerator accel_update_screen(app::VKEY_U, false, true, true); + views::Accelerator accel_image_screen(app::VKEY_I, false, true, true); + views::Accelerator accel_eula_screen(app::VKEY_E, false, true, true); EXPECT_CALL(*mock_network_screen_, Hide()).Times(1); EXPECT_CALL(*mock_account_screen_, Show()).Times(1); diff --git a/chrome/browser/cocoa/html_dialog_window_controller.mm b/chrome/browser/cocoa/html_dialog_window_controller.mm index 0db46c7..87691fb 100644 --- a/chrome/browser/cocoa/html_dialog_window_controller.mm +++ b/chrome/browser/cocoa/html_dialog_window_controller.mm @@ -4,7 +4,7 @@ #import "chrome/browser/cocoa/html_dialog_window_controller.h" -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/logging.h" #include "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" @@ -194,8 +194,8 @@ void HtmlDialogWindowDelegateBridge::HandleKeyboardEvent( // TODO(thakis): It would be nice to get cancel: to work somehow. // Bug: http://code.google.com/p/chromium/issues/detail?id=32828 . if (event.type == NativeWebKeyboardEvent::RawKeyDown && - ((event.windowsKeyCode == base::VKEY_ESCAPE) || - (event.windowsKeyCode == base::VKEY_OEM_PERIOD && + ((event.windowsKeyCode == app::VKEY_ESCAPE) || + (event.windowsKeyCode == app::VKEY_OEM_PERIOD && event.modifiers == NativeWebKeyboardEvent::MetaKey))) { [controller_ close]; return; diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 39e3cd9..bca2f6f 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -6,9 +6,9 @@ #include <list> +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "base/singleton.h" #include "base/string_util.h" @@ -627,7 +627,7 @@ bool ExtensionHost::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { if (extension_host_type_ == ViewType::EXTENSION_POPUP && event.type == NativeWebKeyboardEvent::RawKeyDown && - event.windowsKeyCode == base::VKEY_ESCAPE) { + event.windowsKeyCode == app::VKEY_ESCAPE) { DCHECK(is_keyboard_shortcut != NULL); *is_keyboard_shortcut = true; } @@ -637,7 +637,7 @@ bool ExtensionHost::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, void ExtensionHost::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { if (extension_host_type_ == ViewType::EXTENSION_POPUP) { if (event.type == NativeWebKeyboardEvent::RawKeyDown && - event.windowsKeyCode == base::VKEY_ESCAPE) { + event.windowsKeyCode == app::VKEY_ESCAPE) { NotificationService::current()->Notify( NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE, Source<Profile>(profile_), diff --git a/chrome/browser/extensions/extension_input_api.cc b/chrome/browser/extensions/extension_input_api.cc index 40c4bc0..c4ce3f6 100644 --- a/chrome/browser/extensions/extension_input_api.cc +++ b/chrome/browser/extensions/extension_input_api.cc @@ -6,8 +6,8 @@ #include <string> +#include "app/keyboard_code_conversion.h" #include "base/values.h" -#include "base/keyboard_code_conversion.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/extensions/extension_tabs_module.h" @@ -84,8 +84,8 @@ bool SendKeyboardEventInputFunction::RunImpl() { std::string identifier; EXTENSION_FUNCTION_VALIDATE(args->GetString(kKeyIdentifier, &identifier)); - base::KeyboardCode code = base::KeyCodeFromKeyIdentifier(identifier); - if (code == base::VKEY_UNKNOWN) { + app::KeyboardCode code = app::KeyCodeFromKeyIdentifier(identifier); + if (code == app::VKEY_UNKNOWN) { error_ = kUnknownOrUnsupportedKeyIdentiferError; return false; } diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index d3a7684..f645793 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -918,7 +918,7 @@ void ExternalTabContainer::LoadAccelerators() { bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; views::Accelerator accelerator( - static_cast<base::KeyboardCode>(accelerators[i].key), + static_cast<app::KeyboardCode>(accelerators[i].key), shift_down, ctrl_down, alt_down); accelerator_table_[accelerator] = accelerators[i].cmd; diff --git a/chrome/browser/find_bar_host_browsertest.cc b/chrome/browser/find_bar_host_browsertest.cc index d68e35d..e5f7068 100644 --- a/chrome/browser/find_bar_host_browsertest.cc +++ b/chrome/browser/find_bar_host_browsertest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/message_loop.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -721,7 +721,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, browser()->window()->GetNativeHandle()); // See where Escape is registered. - views::Accelerator escape(base::VKEY_ESCAPE, false, false, false); + views::Accelerator escape(app::VKEY_ESCAPE, false, false, false); views::AcceleratorTarget* old_target = focus_manager->GetCurrentTargetForAccelerator(escape); EXPECT_TRUE(old_target != NULL); diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 1cef421..da1a13d 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -9,10 +9,10 @@ #include <string> #include "app/gtk_util.h" +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "base/base_paths.h" #include "base/command_line.h" -#include "base/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/path_service.h" @@ -299,8 +299,8 @@ bool ShouldExecuteReservedCommandImmediately( // Keys like Ctrl+w, Ctrl+n, etc. should always be sent to the renderer first, // otherwise some web apps or the Emacs key bindings may not work correctly. int vkey = event.windowsKeyCode; - if ((vkey >= base::VKEY_0 && vkey <= base::VKEY_9) || - (vkey >= base::VKEY_A && vkey <= base::VKEY_Z)) + if ((vkey >= app::VKEY_0 && vkey <= app::VKEY_9) || + (vkey >= app::VKEY_A && vkey <= app::VKEY_Z)) return false; // All other reserved accelerators should be processed immediately. diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 30766ea..5c5ee42 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -4,10 +4,10 @@ #include "chrome/browser/renderer_host/render_widget_host.h" +#include "app/keyboard_codes.h" #include "base/auto_reset.h" #include "base/command_line.h" #include "base/histogram.h" -#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/renderer_host/backing_store.h" @@ -468,8 +468,8 @@ void RenderWidgetHost::ForwardKeyboardEvent( return; if (key_event.type == WebKeyboardEvent::Char && - (key_event.windowsKeyCode == base::VKEY_RETURN || - key_event.windowsKeyCode == base::VKEY_SPACE)) { + (key_event.windowsKeyCode == app::VKEY_RETURN || + key_event.windowsKeyCode == app::VKEY_SPACE)) { OnUserGesture(); } diff --git a/chrome/browser/renderer_host/render_widget_host_unittest.cc b/chrome/browser/renderer_host/render_widget_host_unittest.cc index 1fe03ed..1c5bb17 100644 --- a/chrome/browser/renderer_host/render_widget_host_unittest.cc +++ b/chrome/browser/renderer_host/render_widget_host_unittest.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/keyboard_codes.h" #include "base/basictypes.h" -#include "base/keyboard_codes.h" #include "base/scoped_ptr.h" #include "base/shared_memory.h" #include "base/timer.h" @@ -264,7 +264,7 @@ class RenderWidgetHostTest : public testing::Test { void SimulateKeyboardEvent(WebInputEvent::Type type) { NativeWebKeyboardEvent key_event; key_event.type = type; - key_event.windowsKeyCode = base::VKEY_L; // non-null made up value. + key_event.windowsKeyCode = app::VKEY_L; // non-null made up value. host_->ForwardKeyboardEvent(key_event); } diff --git a/chrome/browser/views/accelerator_table_gtk.cc b/chrome/browser/views/accelerator_table_gtk.cc index 1841ac6..ff6b87d 100644 --- a/chrome/browser/views/accelerator_table_gtk.cc +++ b/chrome/browser/views/accelerator_table_gtk.cc @@ -4,8 +4,8 @@ #include "chrome/browser/views/accelerator_table_gtk.h" +#include "app/keyboard_codes.h" #include "base/basictypes.h" -#include "base/keyboard_codes.h" #include "chrome/app/chrome_dll_resource.h" namespace browser { @@ -14,135 +14,135 @@ namespace browser { // the Windows accelerators in ../../app/chrome_dll.rc. const AcceleratorMapping kAcceleratorMap[] = { // Keycode Shift Ctrl Alt Command ID - { base::VKEY_A, true, true, false, IDC_AUTOFILL_DEFAULT }, - { base::VKEY_LEFT, false, false, true, IDC_BACK }, - { base::VKEY_BACK, false, false, false, IDC_BACK }, + { app::VKEY_A, true, true, false, IDC_AUTOFILL_DEFAULT }, + { app::VKEY_LEFT, false, false, true, IDC_BACK }, + { app::VKEY_BACK, false, false, false, IDC_BACK }, #if defined(OS_CHROMEOS) - { base::VKEY_F1, false, false, false, IDC_BACK }, + { app::VKEY_F1, false, false, false, IDC_BACK }, #endif - { base::VKEY_D, false, true, false, IDC_BOOKMARK_PAGE }, - { base::VKEY_D, true, true, false, IDC_BOOKMARK_ALL_TABS }, - { base::VKEY_DELETE, true, true, false, IDC_CLEAR_BROWSING_DATA }, + { app::VKEY_D, false, true, false, IDC_BOOKMARK_PAGE }, + { app::VKEY_D, true, true, false, IDC_BOOKMARK_ALL_TABS }, + { app::VKEY_DELETE, true, true, false, IDC_CLEAR_BROWSING_DATA }, #if !defined(OS_CHROMEOS) - { base::VKEY_F4, false, true, false, IDC_CLOSE_TAB }, + { app::VKEY_F4, false, true, false, IDC_CLOSE_TAB }, #endif - { base::VKEY_W, false, true, false, IDC_CLOSE_TAB }, - { base::VKEY_W, true, true, false, IDC_CLOSE_WINDOW }, + { app::VKEY_W, false, true, false, IDC_CLOSE_TAB }, + { app::VKEY_W, true, true, false, IDC_CLOSE_WINDOW }, #if !defined(OS_CHROMEOS) - { base::VKEY_F4, false, false, true, IDC_CLOSE_WINDOW }, + { app::VKEY_F4, false, false, true, IDC_CLOSE_WINDOW }, #endif - { base::VKEY_Q, true, true, false, IDC_EXIT }, - { base::VKEY_F, false, true, false, IDC_FIND }, - { base::VKEY_G, false, true, false, IDC_FIND_NEXT }, + { app::VKEY_Q, true, true, false, IDC_EXIT }, + { app::VKEY_F, false, true, false, IDC_FIND }, + { app::VKEY_G, false, true, false, IDC_FIND_NEXT }, #if !defined(OS_CHROMEOS) - { base::VKEY_F3, false, false, false, IDC_FIND_NEXT }, + { app::VKEY_F3, false, false, false, IDC_FIND_NEXT }, #endif - { base::VKEY_G, true, true, false, IDC_FIND_PREVIOUS }, + { app::VKEY_G, true, true, false, IDC_FIND_PREVIOUS }, #if !defined(OS_CHROMEOS) - { base::VKEY_F3, true, false, false, IDC_FIND_PREVIOUS }, + { app::VKEY_F3, true, false, false, IDC_FIND_PREVIOUS }, #endif #if defined(OS_CHROMEOS) - { base::VKEY_S, true, false, true, IDC_FOCUS_CHROMEOS_STATUS }, + { app::VKEY_S, true, false, true, IDC_FOCUS_CHROMEOS_STATUS }, #endif - { base::VKEY_D, false, false, true, IDC_FOCUS_LOCATION }, - { base::VKEY_L, false, true, false, IDC_FOCUS_LOCATION }, + { app::VKEY_D, false, false, true, IDC_FOCUS_LOCATION }, + { app::VKEY_L, false, true, false, IDC_FOCUS_LOCATION }, #if !defined(OS_CHROMEOS) - { base::VKEY_F10, false, false, false, IDC_FOCUS_MENU_BAR }, + { app::VKEY_F10, false, false, false, IDC_FOCUS_MENU_BAR }, #endif - { base::VKEY_MENU, false, false, false, IDC_FOCUS_MENU_BAR }, + { app::VKEY_MENU, false, false, false, IDC_FOCUS_MENU_BAR }, #if !defined(OS_CHROMEOS) - { base::VKEY_F6, false, false, false, IDC_FOCUS_NEXT_PANE }, + { app::VKEY_F6, false, false, false, IDC_FOCUS_NEXT_PANE }, #endif #if defined(OS_CHROMEOS) - { base::VKEY_F2, false, true, false, IDC_FOCUS_NEXT_PANE }, + { app::VKEY_F2, false, true, false, IDC_FOCUS_NEXT_PANE }, #endif #if !defined(OS_CHROMEOS) - { base::VKEY_F6, true, false, false, IDC_FOCUS_PREVIOUS_PANE }, + { app::VKEY_F6, true, false, false, IDC_FOCUS_PREVIOUS_PANE }, #endif #if defined(OS_CHROMEOS) - { base::VKEY_F1, false, true, false, IDC_FOCUS_PREVIOUS_PANE }, -#endif - { base::VKEY_K, false, true, false, IDC_FOCUS_SEARCH }, - { base::VKEY_E, false, true, false, IDC_FOCUS_SEARCH }, - { base::VKEY_BROWSER_SEARCH, false, false, false, IDC_FOCUS_SEARCH }, - { base::VKEY_T, true, false, true, IDC_FOCUS_TOOLBAR }, - { base::VKEY_B, true, false, true, IDC_FOCUS_BOOKMARKS }, - { base::VKEY_RIGHT, false, false, true, IDC_FORWARD }, - { base::VKEY_BACK, true, false, false, IDC_FORWARD }, + { app::VKEY_F1, false, true, false, IDC_FOCUS_PREVIOUS_PANE }, +#endif + { app::VKEY_K, false, true, false, IDC_FOCUS_SEARCH }, + { app::VKEY_E, false, true, false, IDC_FOCUS_SEARCH }, + { app::VKEY_BROWSER_SEARCH, false, false, false, IDC_FOCUS_SEARCH }, + { app::VKEY_T, true, false, true, IDC_FOCUS_TOOLBAR }, + { app::VKEY_B, true, false, true, IDC_FOCUS_BOOKMARKS }, + { app::VKEY_RIGHT, false, false, true, IDC_FORWARD }, + { app::VKEY_BACK, true, false, false, IDC_FORWARD }, #if defined(OS_CHROMEOS) - { base::VKEY_F2, false, false, false, IDC_FORWARD }, + { app::VKEY_F2, false, false, false, IDC_FORWARD }, #endif #if !defined(OS_CHROMEOS) - { base::VKEY_F11, false, false, false, IDC_FULLSCREEN }, + { app::VKEY_F11, false, false, false, IDC_FULLSCREEN }, #endif #if defined(OS_CHROMEOS) - { base::VKEY_F4, false, false, false, IDC_FULLSCREEN }, + { app::VKEY_F4, false, false, false, IDC_FULLSCREEN }, #endif #if !defined(OS_CHROMEOS) - { base::VKEY_F1, false, false, false, IDC_HELP_PAGE }, -#endif - { base::VKEY_I, true, true, false, IDC_DEV_TOOLS }, - { base::VKEY_J, true, true, false, IDC_DEV_TOOLS_CONSOLE }, - { base::VKEY_C, true, true, false, IDC_DEV_TOOLS_INSPECT }, - { base::VKEY_N, true, true, false, IDC_NEW_INCOGNITO_WINDOW }, - { base::VKEY_T, false, true, false, IDC_NEW_TAB }, - { base::VKEY_N, false, true, false, IDC_NEW_WINDOW }, - { base::VKEY_O, false, true, false, IDC_OPEN_FILE }, - { base::VKEY_P, false, true, false, IDC_PRINT}, - { base::VKEY_R, false, true, false, IDC_RELOAD }, - { base::VKEY_R, true, true, false, IDC_RELOAD_IGNORING_CACHE }, + { app::VKEY_F1, false, false, false, IDC_HELP_PAGE }, +#endif + { app::VKEY_I, true, true, false, IDC_DEV_TOOLS }, + { app::VKEY_J, true, true, false, IDC_DEV_TOOLS_CONSOLE }, + { app::VKEY_C, true, true, false, IDC_DEV_TOOLS_INSPECT }, + { app::VKEY_N, true, true, false, IDC_NEW_INCOGNITO_WINDOW }, + { app::VKEY_T, false, true, false, IDC_NEW_TAB }, + { app::VKEY_N, false, true, false, IDC_NEW_WINDOW }, + { app::VKEY_O, false, true, false, IDC_OPEN_FILE }, + { app::VKEY_P, false, true, false, IDC_PRINT}, + { app::VKEY_R, false, true, false, IDC_RELOAD }, + { app::VKEY_R, true, true, false, IDC_RELOAD_IGNORING_CACHE }, #if !defined(OS_CHROMEOS) - { base::VKEY_F5, false, false, false, IDC_RELOAD }, - { base::VKEY_F5, false, true, false, IDC_RELOAD_IGNORING_CACHE }, - { base::VKEY_F5, true, false, false, IDC_RELOAD_IGNORING_CACHE }, + { app::VKEY_F5, false, false, false, IDC_RELOAD }, + { app::VKEY_F5, false, true, false, IDC_RELOAD_IGNORING_CACHE }, + { app::VKEY_F5, true, false, false, IDC_RELOAD_IGNORING_CACHE }, #endif - { base::VKEY_HOME, false, false, true, IDC_HOME }, - { base::VKEY_T, true, true, false, IDC_RESTORE_TAB }, - { base::VKEY_S, false, true, false, IDC_SAVE_PAGE }, + { app::VKEY_HOME, false, false, true, IDC_HOME }, + { app::VKEY_T, true, true, false, IDC_RESTORE_TAB }, + { app::VKEY_S, false, true, false, IDC_SAVE_PAGE }, #if defined(OS_CHROMEOS) - { base::VKEY_LWIN, false, false, false, IDC_SEARCH }, -#endif - { base::VKEY_9, false, true, false, IDC_SELECT_LAST_TAB }, - { base::VKEY_NUMPAD9, false, true, false, IDC_SELECT_LAST_TAB }, - { base::VKEY_TAB, false, true, false, IDC_SELECT_NEXT_TAB }, - { base::VKEY_NEXT, false, true, false, IDC_SELECT_NEXT_TAB }, - { base::VKEY_TAB, true, true, false, IDC_SELECT_PREVIOUS_TAB }, - { base::VKEY_PRIOR, false, true, false, IDC_SELECT_PREVIOUS_TAB }, - { base::VKEY_1, false, true, false, IDC_SELECT_TAB_0 }, - { base::VKEY_NUMPAD1, false, true, false, IDC_SELECT_TAB_0 }, - { base::VKEY_2, false, true, false, IDC_SELECT_TAB_1 }, - { base::VKEY_NUMPAD2, false, true, false, IDC_SELECT_TAB_1 }, - { base::VKEY_3, false, true, false, IDC_SELECT_TAB_2 }, - { base::VKEY_NUMPAD3, false, true, false, IDC_SELECT_TAB_2 }, - { base::VKEY_4, false, true, false, IDC_SELECT_TAB_3 }, - { base::VKEY_NUMPAD4, false, true, false, IDC_SELECT_TAB_3 }, - { base::VKEY_5, false, true, false, IDC_SELECT_TAB_4 }, - { base::VKEY_NUMPAD5, false, true, false, IDC_SELECT_TAB_4 }, - { base::VKEY_6, false, true, false, IDC_SELECT_TAB_5 }, - { base::VKEY_NUMPAD6, false, true, false, IDC_SELECT_TAB_5 }, - { base::VKEY_7, false, true, false, IDC_SELECT_TAB_6 }, - { base::VKEY_NUMPAD7, false, true, false, IDC_SELECT_TAB_6 }, - { base::VKEY_8, false, true, false, IDC_SELECT_TAB_7 }, - { base::VKEY_NUMPAD8, false, true, false, IDC_SELECT_TAB_7 }, - { base::VKEY_B, true, true, false, IDC_SHOW_BOOKMARK_BAR }, - { base::VKEY_J, false, true, false, IDC_SHOW_DOWNLOADS }, - { base::VKEY_H, false, true, false, IDC_SHOW_HISTORY }, - { base::VKEY_F, false, false, true, IDC_SHOW_APP_MENU}, - { base::VKEY_E, false, false, true, IDC_SHOW_APP_MENU}, - { base::VKEY_ESCAPE, false, false, false, IDC_STOP }, + { app::VKEY_LWIN, false, false, false, IDC_SEARCH }, +#endif + { app::VKEY_9, false, true, false, IDC_SELECT_LAST_TAB }, + { app::VKEY_NUMPAD9, false, true, false, IDC_SELECT_LAST_TAB }, + { app::VKEY_TAB, false, true, false, IDC_SELECT_NEXT_TAB }, + { app::VKEY_NEXT, false, true, false, IDC_SELECT_NEXT_TAB }, + { app::VKEY_TAB, true, true, false, IDC_SELECT_PREVIOUS_TAB }, + { app::VKEY_PRIOR, false, true, false, IDC_SELECT_PREVIOUS_TAB }, + { app::VKEY_1, false, true, false, IDC_SELECT_TAB_0 }, + { app::VKEY_NUMPAD1, false, true, false, IDC_SELECT_TAB_0 }, + { app::VKEY_2, false, true, false, IDC_SELECT_TAB_1 }, + { app::VKEY_NUMPAD2, false, true, false, IDC_SELECT_TAB_1 }, + { app::VKEY_3, false, true, false, IDC_SELECT_TAB_2 }, + { app::VKEY_NUMPAD3, false, true, false, IDC_SELECT_TAB_2 }, + { app::VKEY_4, false, true, false, IDC_SELECT_TAB_3 }, + { app::VKEY_NUMPAD4, false, true, false, IDC_SELECT_TAB_3 }, + { app::VKEY_5, false, true, false, IDC_SELECT_TAB_4 }, + { app::VKEY_NUMPAD5, false, true, false, IDC_SELECT_TAB_4 }, + { app::VKEY_6, false, true, false, IDC_SELECT_TAB_5 }, + { app::VKEY_NUMPAD6, false, true, false, IDC_SELECT_TAB_5 }, + { app::VKEY_7, false, true, false, IDC_SELECT_TAB_6 }, + { app::VKEY_NUMPAD7, false, true, false, IDC_SELECT_TAB_6 }, + { app::VKEY_8, false, true, false, IDC_SELECT_TAB_7 }, + { app::VKEY_NUMPAD8, false, true, false, IDC_SELECT_TAB_7 }, + { app::VKEY_B, true, true, false, IDC_SHOW_BOOKMARK_BAR }, + { app::VKEY_J, false, true, false, IDC_SHOW_DOWNLOADS }, + { app::VKEY_H, false, true, false, IDC_SHOW_HISTORY }, + { app::VKEY_F, false, false, true, IDC_SHOW_APP_MENU}, + { app::VKEY_E, false, false, true, IDC_SHOW_APP_MENU}, + { app::VKEY_ESCAPE, false, false, false, IDC_STOP }, #if defined(OS_CHROMEOS) - { base::VKEY_F5, false, false, false, IDC_SYSTEM_OPTIONS }, -#endif - { base::VKEY_ESCAPE, true, false, false, IDC_TASK_MANAGER }, - { base::VKEY_U, false, true, false, IDC_VIEW_SOURCE }, - { base::VKEY_OEM_MINUS, false, true, false, IDC_ZOOM_MINUS }, - { base::VKEY_OEM_MINUS, true, true, false, IDC_ZOOM_MINUS }, - { base::VKEY_SUBTRACT, false, true, false, IDC_ZOOM_MINUS }, - { base::VKEY_0, false, true, false, IDC_ZOOM_NORMAL }, - { base::VKEY_NUMPAD0, false, true, false, IDC_ZOOM_NORMAL }, - { base::VKEY_OEM_PLUS, false, true, false, IDC_ZOOM_PLUS }, - { base::VKEY_OEM_PLUS, true, true, false, IDC_ZOOM_PLUS }, - { base::VKEY_ADD, false, true, false, IDC_ZOOM_PLUS }, + { app::VKEY_F5, false, false, false, IDC_SYSTEM_OPTIONS }, +#endif + { app::VKEY_ESCAPE, true, false, false, IDC_TASK_MANAGER }, + { app::VKEY_U, false, true, false, IDC_VIEW_SOURCE }, + { app::VKEY_OEM_MINUS, false, true, false, IDC_ZOOM_MINUS }, + { app::VKEY_OEM_MINUS, true, true, false, IDC_ZOOM_MINUS }, + { app::VKEY_SUBTRACT, false, true, false, IDC_ZOOM_MINUS }, + { app::VKEY_0, false, true, false, IDC_ZOOM_NORMAL }, + { app::VKEY_NUMPAD0, false, true, false, IDC_ZOOM_NORMAL }, + { app::VKEY_OEM_PLUS, false, true, false, IDC_ZOOM_PLUS }, + { app::VKEY_OEM_PLUS, true, true, false, IDC_ZOOM_PLUS }, + { app::VKEY_ADD, false, true, false, IDC_ZOOM_PLUS }, }; const size_t kAcceleratorMapLength = arraysize(kAcceleratorMap); diff --git a/chrome/browser/views/accelerator_table_gtk.h b/chrome/browser/views/accelerator_table_gtk.h index 46abbcc..bbab634 100644 --- a/chrome/browser/views/accelerator_table_gtk.h +++ b/chrome/browser/views/accelerator_table_gtk.h @@ -8,14 +8,14 @@ #include <stdio.h> -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" // This contains the list of accelerators for the Linux toolkit_view // implementation. namespace browser { struct AcceleratorMapping { - base::KeyboardCode keycode; + app::KeyboardCode keycode; bool shift_pressed; bool ctrl_pressed; bool alt_pressed; diff --git a/chrome/browser/views/accessible_toolbar_view.cc b/chrome/browser/views/accessible_toolbar_view.cc index a06a342..7a73087 100644 --- a/chrome/browser/views/accessible_toolbar_view.cc +++ b/chrome/browser/views/accessible_toolbar_view.cc @@ -18,11 +18,11 @@ AccessibleToolbarView::AccessibleToolbarView() : toolbar_has_focus_(false), ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), focus_manager_(NULL), - home_key_(base::VKEY_HOME, false, false, false), - end_key_(base::VKEY_END, false, false, false), - escape_key_(base::VKEY_ESCAPE, false, false, false), - left_key_(base::VKEY_LEFT, false, false, false), - right_key_(base::VKEY_RIGHT, false, false, false), + home_key_(app::VKEY_HOME, false, false, false), + end_key_(app::VKEY_END, false, false, false), + escape_key_(app::VKEY_ESCAPE, false, false, false), + left_key_(app::VKEY_LEFT, false, false, false), + right_key_(app::VKEY_RIGHT, false, false, false), last_focused_view_storage_id_(-1) { focus_search_.reset(new views::FocusSearch(this, true, true)); } @@ -148,27 +148,27 @@ bool AccessibleToolbarView::AcceleratorPressed( views::View* focused_view = focus_manager_->GetFocusedView(); if ((focused_view->GetClassName() == LocationBarView::kViewClassName || focused_view->GetClassName() == views::NativeViewHost::kViewClassName) && - (accelerator.GetKeyCode() == base::VKEY_LEFT || - accelerator.GetKeyCode() == base::VKEY_RIGHT)) { + (accelerator.GetKeyCode() == app::VKEY_LEFT || + accelerator.GetKeyCode() == app::VKEY_RIGHT)) { return false; } switch (accelerator.GetKeyCode()) { - case base::VKEY_ESCAPE: + case app::VKEY_ESCAPE: RemoveToolbarFocus(); RestoreLastFocusedView(); return true; - case base::VKEY_LEFT: + case app::VKEY_LEFT: focus_manager_->AdvanceFocus(true); return true; - case base::VKEY_RIGHT: + case app::VKEY_RIGHT: focus_manager_->AdvanceFocus(false); return true; - case base::VKEY_HOME: + case app::VKEY_HOME: focus_manager_->SetFocusedViewWithReason( GetFirstFocusableChild(), views::FocusManager::kReasonFocusTraversal); return true; - case base::VKEY_END: + case app::VKEY_END: focus_manager_->SetFocusedViewWithReason( GetLastFocusableChild(), views::FocusManager::kReasonFocusTraversal); return true; diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc index d3884dd..9b7b512 100644 --- a/chrome/browser/views/bookmark_bar_view_test.cc +++ b/chrome/browser/views/bookmark_bar_view_test.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/automation/ui_controls.h" @@ -873,7 +873,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { // Send a down event, which should select the first item. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_DOWN, false, false, false, false, + NULL, app::VKEY_DOWN, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest10::Step3)); } @@ -886,7 +886,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { // Send a key down event, which should select the next item. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_DOWN, false, false, false, false, + NULL, app::VKEY_DOWN, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest10::Step4)); } @@ -899,7 +899,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { // Send a right arrow to force the menu to open. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_RIGHT, false, false, false, false, + NULL, app::VKEY_RIGHT, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest10::Step5)); } @@ -915,7 +915,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { // Send a left arrow to close the submenu. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_LEFT, false, false, false, false, + NULL, app::VKEY_LEFT, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest10::Step6)); } @@ -930,7 +930,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { // Send a down arrow to wrap back to f1a ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_DOWN, false, false, false, false, + NULL, app::VKEY_DOWN, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest10::Step7)); } @@ -943,7 +943,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { // Send enter, which should select the item. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_RETURN, false, false, false, false, + NULL, app::VKEY_RETURN, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest10::Step8)); } @@ -998,7 +998,7 @@ class BookmarkBarViewTest11 : public BookmarkBarViewEventTestBase { void Step3() { // Send escape so that the context menu hides. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_ESCAPE, false, false, false, false, + NULL, app::VKEY_ESCAPE, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest11::Step4)); } @@ -1087,7 +1087,7 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase { void Step4() { // Press tab to give focus to the cancel button. - ui_controls::SendKeyPress(NULL, base::VKEY_TAB, false, false, false, false); + ui_controls::SendKeyPress(NULL, app::VKEY_TAB, false, false, false, false); // For some reason return isn't processed correctly unless we delay. MessageLoop::current()->PostDelayedTask(FROM_HERE, @@ -1097,7 +1097,7 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase { void Step5() { // And press enter so that the cancel button is selected. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_RETURN, false, false, false, false, + NULL, app::VKEY_RETURN, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest12::Step6)); } @@ -1226,7 +1226,7 @@ class BookmarkBarViewTest14 : public BookmarkBarViewEventTestBase { // Send escape so that the context menu hides. ui_controls::SendKeyPressNotifyWhenDone( - NULL, base::VKEY_ESCAPE, false, false, false, false, + NULL, app::VKEY_ESCAPE, false, false, false, false, CreateEventTask(this, &BookmarkBarViewTest14::Step3)); } diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc index 96065eb..c13f53f 100644 --- a/chrome/browser/views/bookmark_bubble_view.cc +++ b/chrome/browser/views/bookmark_bubble_view.cc @@ -4,9 +4,9 @@ #include "chrome/browser/views/bookmark_bubble_view.h" +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "base/keyboard_codes.h" #include "base/string16.h" #include "base/string_util.h" #include "chrome/app/chrome_dll_resource.h" @@ -129,7 +129,7 @@ void BookmarkBubbleView::DidChangeBounds(const gfx::Rect& previous, void BookmarkBubbleView::BubbleShown() { DCHECK(GetWidget()); GetFocusManager()->RegisterAccelerator( - views::Accelerator(base::VKEY_RETURN, false, false, false), this); + views::Accelerator(app::VKEY_RETURN, false, false, false), this); title_tf_->RequestFocus(); title_tf_->SelectAll(); @@ -137,7 +137,7 @@ void BookmarkBubbleView::BubbleShown() { bool BookmarkBubbleView::AcceleratorPressed( const views::Accelerator& accelerator) { - if (accelerator.GetKeyCode() != base::VKEY_RETURN) + if (accelerator.GetKeyCode() != app::VKEY_RETURN) return false; if (edit_button_->HasFocus()) diff --git a/chrome/browser/views/browser_keyboard_accessibility_test_win.cc b/chrome/browser/views/browser_keyboard_accessibility_test_win.cc index f5b942f..1218367 100644 --- a/chrome/browser/views/browser_keyboard_accessibility_test_win.cc +++ b/chrome/browser/views/browser_keyboard_accessibility_test_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "chrome/browser/automation/ui_controls.h" #include "chrome/browser/views/chrome_views_delegate.h" #include "chrome/browser/views/frame/browser_view.h" @@ -119,7 +119,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyboardAccessibility, // TODO(phajdan.jr): remove logging after fixing http://crbug.com/50663. LOG(ERROR) << "Sending TAB key event..."; ui_controls::SendKeyPressNotifyWhenDone(current_view_native_window(), - base::VKEY_TAB, + app::VKEY_TAB, true, false, false, false, new MessageLoop::QuitTask()); set_waiting(true); @@ -153,7 +153,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyboardAccessibility, DISABLED_TabInToolbar) { gfx::NativeWindow native_window = browser()->window()->GetNativeHandle(); ui_controls::SendKeyPressNotifyWhenDone(native_window, - base::VKEY_T, + app::VKEY_T, false, true, true, false, new MessageLoop::QuitTask()); set_waiting(true); @@ -197,7 +197,7 @@ void BrowserKeyboardAccessibility::TabCycler(gfx::NativeWindow hwnd, do { // TODO(phajdan.jr): remove logging after fixing http://crbug.com/50663. LOG(ERROR) << "Sending TAB key event."; - ui_controls::SendKeyPressNotifyWhenDone(hwnd, base::VKEY_TAB, + ui_controls::SendKeyPressNotifyWhenDone(hwnd, app::VKEY_TAB, false, !forward_tab, false, false, new MessageLoop::QuitTask()); set_waiting(true); ui_test_utils::RunMessageLoop(); diff --git a/chrome/browser/views/dropdown_bar_host.cc b/chrome/browser/views/dropdown_bar_host.cc index f756cb2..e55365b 100644 --- a/chrome/browser/views/dropdown_bar_host.cc +++ b/chrome/browser/views/dropdown_bar_host.cc @@ -4,8 +4,8 @@ #include "chrome/browser/views/dropdown_bar_host.h" +#include "app/keyboard_codes.h" #include "app/slide_animation.h" -#include "base/keyboard_codes.h" #include "base/scoped_handle.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" @@ -297,14 +297,14 @@ void DropdownBarHost::UpdateWindowEdges(const gfx::Rect& new_pos) { void DropdownBarHost::RegisterAccelerators() { DCHECK(!esc_accel_target_registered_); - views::Accelerator escape(base::VKEY_ESCAPE, false, false, false); + views::Accelerator escape(app::VKEY_ESCAPE, false, false, false); focus_manager_->RegisterAccelerator(escape, this); esc_accel_target_registered_ = true; } void DropdownBarHost::UnregisterAccelerators() { DCHECK(esc_accel_target_registered_); - views::Accelerator escape(base::VKEY_ESCAPE, false, false, false); + views::Accelerator escape(app::VKEY_ESCAPE, false, false, false); focus_manager_->UnregisterAccelerator(escape, this); esc_accel_target_registered_ = false; } diff --git a/chrome/browser/views/extensions/extension_view.cc b/chrome/browser/views/extensions/extension_view.cc index 4e7f1ae..062bc00 100644 --- a/chrome/browser/views/extensions/extension_view.cc +++ b/chrome/browser/views/extensions/extension_view.cc @@ -173,7 +173,7 @@ void ExtensionView::PreferredSizeChanged() { bool ExtensionView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { // Let the tab key event be processed by the renderer (instead of moving the // focus to the next focusable view). - return (e.GetKeyCode() == base::VKEY_TAB); + return (e.GetKeyCode() == app::VKEY_TAB); } void ExtensionView::HandleMouseMove() { diff --git a/chrome/browser/views/find_bar_host.cc b/chrome/browser/views/find_bar_host.cc index 21dcf8b..3926e70 100644 --- a/chrome/browser/views/find_bar_host.cc +++ b/chrome/browser/views/find_bar_host.cc @@ -4,7 +4,7 @@ #include "chrome/browser/views/find_bar_host.h" -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/find_bar_controller.h" @@ -48,13 +48,13 @@ bool FindBarHost::MaybeForwardKeystrokeToWebpage( } switch (key_stroke.GetKeyboardCode()) { - case base::VKEY_DOWN: - case base::VKEY_UP: - case base::VKEY_PRIOR: - case base::VKEY_NEXT: + case app::VKEY_DOWN: + case app::VKEY_UP: + case app::VKEY_PRIOR: + case app::VKEY_NEXT: break; - case base::VKEY_HOME: - case base::VKEY_END: + case app::VKEY_HOME: + case app::VKEY_END: if (key_stroke.IsControlHeld()) break; // Fall through. @@ -161,11 +161,11 @@ FindBarTesting* FindBarHost::GetFindBarTesting() { // FindBarWin, views::AcceleratorTarget implementation: bool FindBarHost::AcceleratorPressed(const views::Accelerator& accelerator) { - base::KeyboardCode key = accelerator.GetKeyCode(); - if (key == base::VKEY_RETURN && accelerator.IsCtrlDown()) { + app::KeyboardCode key = accelerator.GetKeyCode(); + if (key == app::VKEY_RETURN && accelerator.IsCtrlDown()) { // Ctrl+Enter closes the Find session and navigates any link that is active. find_bar_controller_->EndFindSession(FindBarController::kActivateSelection); - } else if (key == base::VKEY_ESCAPE) { + } else if (key == app::VKEY_ESCAPE) { // This will end the Find session and hide the window, causing it to loose // focus and in the process unregister us as the handler for the Escape // accelerator through the FocusWillChange event. @@ -277,13 +277,13 @@ void FindBarHost::RegisterAccelerators() { DropdownBarHost::RegisterAccelerators(); // Register for Ctrl+Return. - views::Accelerator escape(base::VKEY_RETURN, false, true, false); + views::Accelerator escape(app::VKEY_RETURN, false, true, false); focus_manager()->RegisterAccelerator(escape, this); } void FindBarHost::UnregisterAccelerators() { // Unregister Ctrl+Return. - views::Accelerator escape(base::VKEY_RETURN, false, true, false); + views::Accelerator escape(app::VKEY_RETURN, false, true, false); focus_manager()->UnregisterAccelerator(escape, this); DropdownBarHost::UnregisterAccelerators(); diff --git a/chrome/browser/views/find_bar_host_interactive_uitest.cc b/chrome/browser/views/find_bar_host_interactive_uitest.cc index 69d7284..baf9cf44 100644 --- a/chrome/browser/views/find_bar_host_interactive_uitest.cc +++ b/chrome/browser/views/find_bar_host_interactive_uitest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/message_loop.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -121,7 +121,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) { // This used to crash until bug 1303709 was fixed. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - browser()->window()->GetNativeHandle(), base::VKEY_ESCAPE, + browser()->window()->GetNativeHandle(), app::VKEY_ESCAPE, false, false, false, false)); } @@ -187,21 +187,21 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { // Search for "a". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_A, false, false, false, false)); // No modifiers + window, app::VKEY_A, false, false, false, false)); // No modifiers // We should find "a" here. EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarText()); // Delete "a". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_BACK, false, false, false, false)); // No modifiers. + window, app::VKEY_BACK, false, false, false, false)); // No modifiers. // Validate we have cleared the text. EXPECT_EQ(string16(), GetFindBarText()); // Close the Find box. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_ESCAPE, false, false, false, false)); // No modifiers. + window, app::VKEY_ESCAPE, false, false, false, false)); // No modifiers. // Show the Find bar. browser()->GetFindBarController()->Show(); @@ -212,11 +212,11 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { // Close the Find box. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_ESCAPE, false, false, false, false)); // No modifiers. + window, app::VKEY_ESCAPE, false, false, false, false)); // No modifiers. // Press F3 to trigger FindNext. ASSERT_TRUE(ui_test_utils::SendKeyPressSync( - window, base::VKEY_F3, false, false, false, false)); // No modifiers. + window, app::VKEY_F3, false, false, false, false)); // No modifiers. // After the Find box has been reopened, it should still have no prepopulate // value. diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc index 0007d9c..7132553 100644 --- a/chrome/browser/views/find_bar_view.cc +++ b/chrome/browser/views/find_bar_view.cc @@ -475,7 +475,7 @@ bool FindBarView::HandleKeystroke(views::Textfield* sender, if (find_bar_host()->MaybeForwardKeystrokeToWebpage(key)) return true; // Handled, we are done! - if (key.GetKeyboardCode() == base::VKEY_RETURN) { + if (key.GetKeyboardCode() == app::VKEY_RETURN) { // Pressing Return/Enter starts the search (unless text box is empty). string16 find_string = find_text_->text(); if (!find_string.empty()) { diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 819fb75..28d187a 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -688,13 +688,13 @@ bool BrowserView::GetAccelerator(int cmd_id, menus::Accelerator* accelerator) { // anywhere so we need to check for them explicitly here. switch (cmd_id) { case IDC_CUT: - *accelerator = views::Accelerator(base::VKEY_X, false, true, false); + *accelerator = views::Accelerator(app::VKEY_X, false, true, false); return true; case IDC_COPY: - *accelerator = views::Accelerator(base::VKEY_C, false, true, false); + *accelerator = views::Accelerator(app::VKEY_C, false, true, false); return true; case IDC_PASTE: - *accelerator = views::Accelerator(base::VKEY_V, false, true, false); + *accelerator = views::Accelerator(app::VKEY_V, false, true, false); return true; } // Else, we retrieve the accelerator information from the accelerator table. @@ -1293,7 +1293,7 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, #if defined(OS_WIN) // As Alt+F4 is the close-app keyboard shortcut, it needs processing // immediately. - if (event.windowsKeyCode == base::VKEY_F4 && + if (event.windowsKeyCode == app::VKEY_F4 && event.modifiers == NativeWebKeyboardEvent::AltKey) { DefWindowProc(event.os_event.hwnd, event.os_event.message, event.os_event.wParam, event.os_event.lParam); @@ -1305,7 +1305,7 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, DCHECK(focus_manager); views::Accelerator accelerator( - static_cast<base::KeyboardCode>(event.windowsKeyCode), + static_cast<app::KeyboardCode>(event.windowsKeyCode), (event.modifiers & NativeWebKeyboardEvent::ShiftKey) == NativeWebKeyboardEvent::ShiftKey, (event.modifiers & NativeWebKeyboardEvent::ControlKey) == @@ -1371,34 +1371,34 @@ void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { // manager to do that. #if !defined(OS_MACOSX) void BrowserView::Cut() { - ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_X, + ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_X, true, false, false, false); } void BrowserView::Copy() { - ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_C, + ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_C, true, false, false, false); } void BrowserView::Paste() { - ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_V, + ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_V, true, false, false, false); } #else // Mac versions. Not tested by antyhing yet; // don't assume written == works. void BrowserView::Cut() { - ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_X, + ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_X, false, false, false, true); } void BrowserView::Copy() { - ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_C, + ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_C, false, false, false, true); } void BrowserView::Paste() { - ui_controls::SendKeyPress(GetNativeHandle(), base::VKEY_V, + ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_V, false, false, false, true); } #endif @@ -2304,7 +2304,7 @@ void BrowserView::LoadAccelerators() { bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; views::Accelerator accelerator( - static_cast<base::KeyboardCode>(accelerators[i].key), + static_cast<app::KeyboardCode>(accelerators[i].key), shift_down, ctrl_down, alt_down); accelerator_table_[accelerator] = accelerators[i].cmd; diff --git a/chrome/browser/views/fullscreen_exit_bubble.cc b/chrome/browser/views/fullscreen_exit_bubble.cc index e44b4d7..4777f51 100644 --- a/chrome/browser/views/fullscreen_exit_bubble.cc +++ b/chrome/browser/views/fullscreen_exit_bubble.cc @@ -4,9 +4,9 @@ #include "chrome/browser/views/fullscreen_exit_bubble.h" +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "base/keyboard_codes.h" #include "chrome/app/chrome_dll_resource.h" #include "gfx/canvas_skia.h" #include "grit/generated_resources.h" @@ -142,7 +142,7 @@ FullscreenExitBubble::FullscreenExitBubble( size_animation_->Reset(1); // Create the contents view. - views::Accelerator accelerator(base::VKEY_UNKNOWN, false, false, false); + views::Accelerator accelerator(app::VKEY_UNKNOWN, false, false, false); bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); DCHECK(got_accelerator); view_ = new FullscreenExitView(this, accelerator.GetShortcutText()); diff --git a/chrome/browser/views/html_dialog_view.cc b/chrome/browser/views/html_dialog_view.cc index 3fd6157..d2f4c04 100644 --- a/chrome/browser/views/html_dialog_view.cc +++ b/chrome/browser/views/html_dialog_view.cc @@ -4,7 +4,7 @@ #include "chrome/browser/views/html_dialog_view.h" -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "chrome/browser/browser.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/native_web_keyboard_event.h" @@ -55,7 +55,7 @@ gfx::Size HtmlDialogView::GetPreferredSize() { bool HtmlDialogView::AcceleratorPressed(const views::Accelerator& accelerator) { // Pressing ESC closes the dialog. - DCHECK_EQ(base::VKEY_ESCAPE, accelerator.GetKeyCode()); + DCHECK_EQ(app::VKEY_ESCAPE, accelerator.GetKeyCode()); OnDialogClosed(std::string()); return true; } @@ -201,7 +201,7 @@ void HtmlDialogView::InitDialog() { this); // Pressing the ESC key will close the dialog. - AddAccelerator(views::Accelerator(base::VKEY_ESCAPE, false, false, false)); + AddAccelerator(views::Accelerator(app::VKEY_ESCAPE, false, false, false)); DOMView::LoadURL(GetDialogContentURL()); } diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index 48b7626..3ee1317 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -4,7 +4,7 @@ #include "chrome/browser/views/info_bubble.h" -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "chrome/browser/window_sizer.h" #include "chrome/common/notification_service.h" #include "gfx/canvas_skia.h" @@ -426,7 +426,7 @@ void InfoBubble::Init(views::Widget* parent, // Register the Escape accelerator for closing. GetFocusManager()->RegisterAccelerator( - views::Accelerator(base::VKEY_ESCAPE, false, false, false), this); + views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); // Done creating the bubble. NotificationService::current()->Notify(NotificationType::INFO_BUBBLE_CREATED, @@ -491,7 +491,7 @@ void InfoBubble::DoClose(bool closed_by_escape) { return; GetFocusManager()->UnregisterAccelerator( - views::Accelerator(base::VKEY_ESCAPE, false, false, false), this); + views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); if (delegate_) delegate_->InfoBubbleClosing(this, closed_by_escape); show_status_ = kClosed; diff --git a/chrome/browser/views/jsmessage_box_dialog.cc b/chrome/browser/views/jsmessage_box_dialog.cc index 5d8049a..f51116b 100644 --- a/chrome/browser/views/jsmessage_box_dialog.cc +++ b/chrome/browser/views/jsmessage_box_dialog.cc @@ -4,9 +4,9 @@ #include "chrome/browser/views/jsmessage_box_dialog.h" +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/message_box_flags.h" -#include "base/keyboard_codes.h" #include "chrome/browser/app_modal_dialog.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" @@ -25,7 +25,7 @@ JavaScriptMessageBoxDialog::JavaScriptMessageBoxDialog( DCHECK(message_box_view_); message_box_view_->AddAccelerator( - views::Accelerator(base::VKEY_C, false, true, false)); + views::Accelerator(app::VKEY_C, false, true, false)); if (display_suppress_checkbox) { message_box_view_->SetCheckBoxLabel( l10n_util::GetString(IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION)); diff --git a/chrome/browser/views/keyword_editor_view.cc b/chrome/browser/views/keyword_editor_view.cc index 5815843..b3b4974 100644 --- a/chrome/browser/views/keyword_editor_view.cc +++ b/chrome/browser/views/keyword_editor_view.cc @@ -169,7 +169,7 @@ void KeywordEditorView::Init() { this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON)); add_button_->SetEnabled(controller_->loaded()); add_button_->AddAccelerator( - views::Accelerator(base::VKEY_A, false, false, true)); + views::Accelerator(app::VKEY_A, false, false, true)); add_button_->SetAccessibleKeyboardShortcut(L"A"); edit_button_ = new views::NativeButton( @@ -180,7 +180,7 @@ void KeywordEditorView::Init() { this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON)); remove_button_->SetEnabled(false); remove_button_->AddAccelerator( - views::Accelerator(base::VKEY_R, false, false, true)); + views::Accelerator(app::VKEY_R, false, false, true)); remove_button_->SetAccessibleKeyboardShortcut(L"R"); make_default_button_ = new views::NativeButton( diff --git a/chrome/browser/views/location_bar/location_bar_view.cc b/chrome/browser/views/location_bar/location_bar_view.cc index 9cf40a1..b3d1e7f 100644 --- a/chrome/browser/views/location_bar/location_bar_view.cc +++ b/chrome/browser/views/location_bar/location_bar_view.cc @@ -943,7 +943,7 @@ bool LocationBarView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { // it can be shared between Windows and Linux. // For now, we just override back-space and tab keys, as back-space is the // accelerator for back navigation and tab key is used by some input methods. - if (e.GetKeyCode() == base::VKEY_BACK || + if (e.GetKeyCode() == app::VKEY_BACK || views::FocusManager::IsTabTraversalKeyEvent(e)) return true; return false; diff --git a/chrome/browser/views/location_bar/page_action_image_view.cc b/chrome/browser/views/location_bar/page_action_image_view.cc index c2d72e3..058100c 100644 --- a/chrome/browser/views/location_bar/page_action_image_view.cc +++ b/chrome/browser/views/location_bar/page_action_image_view.cc @@ -137,8 +137,8 @@ void PageActionImageView::OnMouseReleased(const views::MouseEvent& event, } bool PageActionImageView::OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == base::VKEY_SPACE || - e.GetKeyCode() == base::VKEY_RETURN) { + if (e.GetKeyCode() == app::VKEY_SPACE || + e.GetKeyCode() == app::VKEY_RETURN) { ExecuteAction(1, false); return true; } diff --git a/chrome/browser/views/location_bar/star_view.cc b/chrome/browser/views/location_bar/star_view.cc index 06bb843..9b4f2c5 100644 --- a/chrome/browser/views/location_bar/star_view.cc +++ b/chrome/browser/views/location_bar/star_view.cc @@ -59,8 +59,8 @@ void StarView::OnMouseReleased(const views::MouseEvent& event, bool canceled) { } bool StarView::OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == base::VKEY_SPACE || - e.GetKeyCode() == base::VKEY_RETURN) { + if (e.GetKeyCode() == app::VKEY_SPACE || + e.GetKeyCode() == app::VKEY_RETURN) { command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); return true; } diff --git a/chrome/browser/views/options/cookies_view.cc b/chrome/browser/views/options/cookies_view.cc index 48de80f..2bba860 100644 --- a/chrome/browser/views/options/cookies_view.cc +++ b/chrome/browser/views/options/cookies_view.cc @@ -145,9 +145,9 @@ void CookiesView::ContentsChanged(views::Textfield* sender, bool CookiesView::HandleKeystroke(views::Textfield* sender, const views::Textfield::Keystroke& key) { - if (key.GetKeyboardCode() == base::VKEY_ESCAPE) { + if (key.GetKeyboardCode() == app::VKEY_ESCAPE) { ResetSearchQuery(); - } else if (key.GetKeyboardCode() == base::VKEY_RETURN) { + } else if (key.GetKeyboardCode() == app::VKEY_RETURN) { search_update_factory_.RevokeAll(); UpdateSearchResults(); } @@ -235,8 +235,8 @@ void CookiesView::OnTreeViewSelectionChanged(views::TreeView* tree_view) { } } -void CookiesView::OnTreeViewKeyDown(base::KeyboardCode keycode) { - if (keycode == base::VKEY_DELETE) +void CookiesView::OnTreeViewKeyDown(app::KeyboardCode keycode) { + if (keycode == app::VKEY_DELETE) cookies_tree_->RemoveSelectedItems(); } diff --git a/chrome/browser/views/options/cookies_view.h b/chrome/browser/views/options/cookies_view.h index ce51933..121affd 100644 --- a/chrome/browser/views/options/cookies_view.h +++ b/chrome/browser/views/options/cookies_view.h @@ -71,7 +71,7 @@ class CookiesView : public CookiesTreeModel::Observer, virtual void OnTreeViewSelectionChanged(views::TreeView* tree_view); // views::TreeViewController implementation. - virtual void OnTreeViewKeyDown(base::KeyboardCode keycode); + virtual void OnTreeViewKeyDown(app::KeyboardCode keycode); // views::Textfield::Controller implementation. virtual void ContentsChanged(views::Textfield* sender, diff --git a/chrome/browser/views/tab_contents/render_view_context_menu_views.cc b/chrome/browser/views/tab_contents/render_view_context_menu_views.cc index f2092c5..8efb30b 100644 --- a/chrome/browser/views/tab_contents/render_view_context_menu_views.cc +++ b/chrome/browser/views/tab_contents/render_view_context_menu_views.cc @@ -4,8 +4,8 @@ #include "chrome/browser/views/tab_contents/render_view_context_menu_views.h" +#include "app/keyboard_codes.h" #include "base/compiler_specific.h" -#include "base/keyboard_codes.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/profile.h" #include "grit/generated_resources.h" @@ -68,28 +68,28 @@ bool RenderViewContextMenuViews::GetAcceleratorForCommandId( // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { case IDC_CONTENT_CONTEXT_UNDO: - *accel = views::Accelerator(base::VKEY_Z, false, true, false); + *accel = views::Accelerator(app::VKEY_Z, false, true, false); return true; case IDC_CONTENT_CONTEXT_REDO: // TODO(jcampan): should it be Ctrl-Y? - *accel = views::Accelerator(base::VKEY_Z, true, true, false); + *accel = views::Accelerator(app::VKEY_Z, true, true, false); return true; case IDC_CONTENT_CONTEXT_CUT: - *accel = views::Accelerator(base::VKEY_X, false, true, false); + *accel = views::Accelerator(app::VKEY_X, false, true, false); return true; case IDC_CONTENT_CONTEXT_COPY: - *accel = views::Accelerator(base::VKEY_C, false, true, false); + *accel = views::Accelerator(app::VKEY_C, false, true, false); return true; case IDC_CONTENT_CONTEXT_PASTE: - *accel = views::Accelerator(base::VKEY_V, false, true, false); + *accel = views::Accelerator(app::VKEY_V, false, true, false); return true; case IDC_CONTENT_CONTEXT_SELECTALL: - *accel = views::Accelerator(base::VKEY_A, false, true, false); + *accel = views::Accelerator(app::VKEY_A, false, true, false); return true; default: diff --git a/chrome/browser/views/task_manager_view.cc b/chrome/browser/views/task_manager_view.cc index d4bdbce..9a3e923 100644 --- a/chrome/browser/views/task_manager_view.cc +++ b/chrome/browser/views/task_manager_view.cc @@ -222,7 +222,7 @@ class TaskManagerView : public views::View, // views::TableViewObserver implementation. virtual void OnSelectionChanged(); virtual void OnDoubleClick(); - virtual void OnKeyDown(base::KeyboardCode keycode); + virtual void OnKeyDown(app::KeyboardCode keycode); // views::LinkController implementation. virtual void LinkActivated(views::Link* source, int event_flags); @@ -372,7 +372,7 @@ void TaskManagerView::Init() { } kill_button_ = new views::NativeButton( this, l10n_util::GetString(IDS_TASK_MANAGER_KILL)); - kill_button_->AddAccelerator(views::Accelerator(base::VKEY_E, + kill_button_->AddAccelerator(views::Accelerator(app::VKEY_E, false, false, false)); kill_button_->SetAccessibleKeyboardShortcut(L"E"); about_memory_link_ = new views::Link( @@ -588,8 +588,8 @@ void TaskManagerView::OnDoubleClick() { ActivateFocusedTab(); } -void TaskManagerView::OnKeyDown(base::KeyboardCode keycode) { - if (keycode == base::VKEY_RETURN) +void TaskManagerView::OnKeyDown(app::KeyboardCode keycode) { + if (keycode == app::VKEY_RETURN) ActivateFocusedTab(); } diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index baa4fdd..ccdc7e2 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -353,13 +353,13 @@ bool ToolbarView::GetAcceleratorForCommandId(int command_id, // TODO(cpu) Bug 1109102. Query WebKit land for the actual bindings. switch (command_id) { case IDC_CUT: - *accelerator = views::Accelerator(base::VKEY_X, false, true, false); + *accelerator = views::Accelerator(app::VKEY_X, false, true, false); return true; case IDC_COPY: - *accelerator = views::Accelerator(base::VKEY_C, false, true, false); + *accelerator = views::Accelerator(app::VKEY_C, false, true, false); return true; case IDC_PASTE: - *accelerator = views::Accelerator(base::VKEY_V, false, true, false); + *accelerator = views::Accelerator(app::VKEY_V, false, true, false); return true; } // Else, we retrieve the accelerator information from the frame. diff --git a/chrome/browser/views/unhandled_keyboard_event_handler.cc b/chrome/browser/views/unhandled_keyboard_event_handler.cc index cc29354..9da60ee2 100644 --- a/chrome/browser/views/unhandled_keyboard_event_handler.cc +++ b/chrome/browser/views/unhandled_keyboard_event_handler.cc @@ -38,7 +38,7 @@ void UnhandledKeyboardEventHandler::HandleKeyboardEvent( if (event.type == WebKit::WebInputEvent::RawKeyDown) { views::Accelerator accelerator( - static_cast<base::KeyboardCode>(event.windowsKeyCode), + static_cast<app::KeyboardCode>(event.windowsKeyCode), (event.modifiers & NativeWebKeyboardEvent::ShiftKey) == NativeWebKeyboardEvent::ShiftKey, (event.modifiers & NativeWebKeyboardEvent::ControlKey) == diff --git a/chrome/browser/views/url_picker.cc b/chrome/browser/views/url_picker.cc index 3b9ac40..4051e63 100644 --- a/chrome/browser/views/url_picker.cc +++ b/chrome/browser/views/url_picker.cc @@ -4,10 +4,10 @@ #include "chrome/browser/views/url_picker.h" +#include "app/keyboard_codes.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "app/table_model.h" -#include "base/keyboard_codes.h" #include "base/stl_util-inl.h" #include "base/string16.h" #include "base/utf_string_conversions.h" @@ -113,7 +113,7 @@ UrlPicker::UrlPicker(UrlPickerDelegate* delegate, layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - AddAccelerator(views::Accelerator(base::VKEY_RETURN, false, false, false)); + AddAccelerator(views::Accelerator(app::VKEY_RETURN, false, false, false)); } UrlPicker::~UrlPicker() { diff --git a/chrome/renderer/password_autocomplete_manager.cc b/chrome/renderer/password_autocomplete_manager.cc index b74d357..c460db4 100644 --- a/chrome/renderer/password_autocomplete_manager.cc +++ b/chrome/renderer/password_autocomplete_manager.cc @@ -4,7 +4,7 @@ #include "chrome/renderer/password_autocomplete_manager.h" -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "chrome/common/render_messages.h" @@ -302,7 +302,7 @@ void PasswordAutocompleteManager::TextFieldHandlingKeyDown( int win_key_code = event.windowsKeyCode; iter->second.backspace_pressed_last = - (win_key_code == base::VKEY_BACK || win_key_code == base::VKEY_DELETE); + (win_key_code == app::VKEY_BACK || win_key_code == app::VKEY_DELETE); } bool PasswordAutocompleteManager::InputElementClicked( diff --git a/chrome/renderer/password_autocomplete_manager_unittest.cc b/chrome/renderer/password_autocomplete_manager_unittest.cc index a799365..8b1f451 100644 --- a/chrome/renderer/password_autocomplete_manager_unittest.cc +++ b/chrome/renderer/password_autocomplete_manager_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/renderer/password_autocomplete_manager.h" @@ -116,7 +116,7 @@ class PasswordAutocompleteManagerTest : public RenderViewTest { } void SimulateKeyDownEvent(const WebInputElement& element, - base::KeyboardCode key_code) { + app::KeyboardCode key_code) { WebKit::WebKeyboardEvent key_event; key_event.windowsKeyCode = key_code; view_->textFieldDidReceiveKeyDown(element, key_event); @@ -288,12 +288,12 @@ TEST_F(PasswordAutocompleteManagerTest, MAYBE_InlineAutocomplete) { CheckUsernameSelection(2, 5); // Test that deleting does not trigger autocomplete. - SimulateKeyDownEvent(username_element_, base::VKEY_BACK); + SimulateKeyDownEvent(username_element_, app::VKEY_BACK); SimulateUsernameChange("alic", true); CheckTextFieldsState("alic", false, "", false); CheckUsernameSelection(4, 4); // No selection. // Reset the last pressed key to something other than backspace. - SimulateKeyDownEvent(username_element_, base::VKEY_A); + SimulateKeyDownEvent(username_element_, app::VKEY_A); // Now lets say the user goes astray from the stored username and types the // letter 'f', spelling 'alf'. We don't know alf (that's just sad), so in diff --git a/chrome/renderer/render_view_browsertest.cc b/chrome/renderer/render_view_browsertest.cc index 35cdb6d..531aae7 100644 --- a/chrome/renderer/render_view_browsertest.cc +++ b/chrome/renderer/render_view_browsertest.cc @@ -4,8 +4,8 @@ #include "base/basictypes.h" +#include "app/keyboard_codes.h" #include "base/file_util.h" -#include "base/keyboard_codes.h" #include "base/shared_memory.h" #include "base/utf_string_conversions.h" #include "chrome/common/content_settings.h" @@ -578,20 +578,20 @@ TEST_F(RenderViewTest, OnHandleKeyboardEvent) { 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - base::VKEY_OEM_1, - base::VKEY_OEM_PLUS, - base::VKEY_OEM_COMMA, - base::VKEY_OEM_MINUS, - base::VKEY_OEM_PERIOD, - base::VKEY_OEM_2, - base::VKEY_OEM_3, - base::VKEY_OEM_4, - base::VKEY_OEM_5, - base::VKEY_OEM_6, - base::VKEY_OEM_7, + app::VKEY_OEM_1, + app::VKEY_OEM_PLUS, + app::VKEY_OEM_COMMA, + app::VKEY_OEM_MINUS, + app::VKEY_OEM_PERIOD, + app::VKEY_OEM_2, + app::VKEY_OEM_3, + app::VKEY_OEM_4, + app::VKEY_OEM_5, + app::VKEY_OEM_6, + app::VKEY_OEM_7, #if defined(OS_WIN) // Not sure how to handle this key on Linux. - base::VKEY_OEM_8, + app::VKEY_OEM_8, #endif }; @@ -817,20 +817,20 @@ TEST_F(RenderViewTest, InsertCharacters) { 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - base::VKEY_OEM_1, - base::VKEY_OEM_PLUS, - base::VKEY_OEM_COMMA, - base::VKEY_OEM_MINUS, - base::VKEY_OEM_PERIOD, - base::VKEY_OEM_2, - base::VKEY_OEM_3, - base::VKEY_OEM_4, - base::VKEY_OEM_5, - base::VKEY_OEM_6, - base::VKEY_OEM_7, + app::VKEY_OEM_1, + app::VKEY_OEM_PLUS, + app::VKEY_OEM_COMMA, + app::VKEY_OEM_MINUS, + app::VKEY_OEM_PERIOD, + app::VKEY_OEM_2, + app::VKEY_OEM_3, + app::VKEY_OEM_4, + app::VKEY_OEM_5, + app::VKEY_OEM_6, + app::VKEY_OEM_7, #if defined(OS_WIN) // Unclear how to handle this on Linux. - base::VKEY_OEM_8, + app::VKEY_OEM_8, #endif }; diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 1aad575..759c84c7 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -6,10 +6,10 @@ #include <string> #include <vector> +#include "app/keyboard_codes.h" #include "base/command_line.h" #include "base/environment.h" #include "base/file_util.h" -#include "base/keyboard_codes.h" #include "base/logging.h" #include "base/path_service.h" #include "base/rand_util.h" @@ -486,35 +486,35 @@ bool AutomatedUITest::Options() { } bool AutomatedUITest::PressDownArrow() { - return SimulateKeyPressInActiveWindow(base::VKEY_DOWN, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_DOWN, 0); } bool AutomatedUITest::PressEnterKey() { - return SimulateKeyPressInActiveWindow(base::VKEY_RETURN, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_RETURN, 0); } bool AutomatedUITest::PressEscapeKey() { - return SimulateKeyPressInActiveWindow(base::VKEY_ESCAPE, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_ESCAPE, 0); } bool AutomatedUITest::PressPageDown() { - return SimulateKeyPressInActiveWindow(base::VKEY_PRIOR, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_PRIOR, 0); } bool AutomatedUITest::PressPageUp() { - return SimulateKeyPressInActiveWindow(base::VKEY_NEXT, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_NEXT, 0); } bool AutomatedUITest::PressSpaceBar() { - return SimulateKeyPressInActiveWindow(base::VKEY_SPACE, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_SPACE, 0); } bool AutomatedUITest::PressTabKey() { - return SimulateKeyPressInActiveWindow(base::VKEY_TAB, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_TAB, 0); } bool AutomatedUITest::PressUpArrow() { - return SimulateKeyPressInActiveWindow(base::VKEY_UP, 0); + return SimulateKeyPressInActiveWindow(app::VKEY_UP, 0); } bool AutomatedUITest::StarPage() { @@ -604,7 +604,7 @@ bool AutomatedUITest::ForceCrash() { return true; } -bool AutomatedUITest::SimulateKeyPressInActiveWindow(base::KeyboardCode key, +bool AutomatedUITest::SimulateKeyPressInActiveWindow(app::KeyboardCode key, int flags) { scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); if (window.get() == NULL) { diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.h b/chrome/test/automated_ui_tests/automated_ui_tests.h index d26675c..ef7b1f3 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.h +++ b/chrome/test/automated_ui_tests/automated_ui_tests.h @@ -103,7 +103,7 @@ #include <string> -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" #include "chrome/test/ui/ui_test.h" @@ -295,7 +295,7 @@ class AutomatedUITest : public AutomatedUITestBase { // Calls SimulateOSKeyPress on the active window. Simulates a key press at // the OS level. |key| is the key pressed and |flags| specifies which // modifiers keys are also pressed (as defined in chrome/views/event.h). - bool SimulateKeyPressInActiveWindow(base::KeyboardCode key, int flags); + bool SimulateKeyPressInActiveWindow(app::KeyboardCode key, int flags); // Opens init file, reads it into the reader, and closes the file. // Returns false if there are any errors. diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index b08529b..0ef68ad 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -419,7 +419,7 @@ IPC_BEGIN_MESSAGES(Automation) // This message requests that a key press be performed. // Request: // int - the handle of the window that's the context for this click - // int - the base::KeyboardCode of the key that was pressed. + // int - the app::KeyboardCode of the key that was pressed. // int - the flags which identify the modifiers (shift, ctrl, alt) // associated for, as defined in chrome/views/event.h IPC_MESSAGE_ROUTED3(AutomationMsg_WindowKeyPress, int, int, int) diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc index c098abd..1a66edc 100644 --- a/chrome/test/automation/window_proxy.cc +++ b/chrome/test/automation/window_proxy.cc @@ -41,7 +41,7 @@ bool WindowProxy::GetWindowTitle(string16* text) { return sender_->Send(new AutomationMsg_WindowTitle(0, handle_, text)); } -bool WindowProxy::SimulateOSKeyPress(base::KeyboardCode key, int flags) { +bool WindowProxy::SimulateOSKeyPress(app::KeyboardCode key, int flags) { if (!is_valid()) return false; return sender_->Send( diff --git a/chrome/test/automation/window_proxy.h b/chrome/test/automation/window_proxy.h index cb7b022..f0a9ac5 100644 --- a/chrome/test/automation/window_proxy.h +++ b/chrome/test/automation/window_proxy.h @@ -12,7 +12,7 @@ #include <windows.h> #endif -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "base/string16.h" #include "base/thread.h" #include "chrome/test/automation/automation_handle_tracker.h" @@ -54,7 +54,7 @@ class WindowProxy : public AutomationResourceProxy { // key pressed and |flags| specifies which modifiers keys are also pressed (as // defined in chrome/views/event.h). Note that this actually sends the event // to the window that has focus. - bool SimulateOSKeyPress(base::KeyboardCode key, int flags); + bool SimulateOSKeyPress(app::KeyboardCode key, int flags); // Shows/hides the window and as a result makes it active/inactive. // Returns true if the call was successful. diff --git a/chrome/test/interactive_ui/keyboard_access_uitest.cc b/chrome/test/interactive_ui/keyboard_access_uitest.cc index 2fdd3e8..d002a3e 100644 --- a/chrome/test/interactive_ui/keyboard_access_uitest.cc +++ b/chrome/test/interactive_ui/keyboard_access_uitest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" @@ -59,12 +59,12 @@ void KeyboardAccessTest::TestMenuKeyboardAccess(bool alternate_key_sequence) { int original_view_id = -1; ASSERT_TRUE(window->GetFocusedViewID(&original_view_id)); - base::KeyboardCode menu_key = - alternate_key_sequence ? base::VKEY_MENU : base::VKEY_F10; + app::KeyboardCode menu_key = + alternate_key_sequence ? app::VKEY_MENU : app::VKEY_F10; #if defined(OS_CHROMEOS) // Chrome OS has different function key accelerators, so we always use the // menu key there. - menu_key = base::VKEY_MENU; + menu_key = app::VKEY_MENU; #endif ASSERT_TRUE(window->SimulateOSKeyPress(menu_key, 0)); @@ -75,16 +75,16 @@ void KeyboardAccessTest::TestMenuKeyboardAccess(bool alternate_key_sequence) { ASSERT_TRUE(browser->StartTrackingPopupMenus()); if (alternate_key_sequence) - ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_DOWN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_DOWN, 0)); else - ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_RETURN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_RETURN, 0)); // Wait until the popup menu actually opens. ASSERT_TRUE(browser->WaitForPopupMenuToOpen()); // Press DOWN to select the first item, then RETURN to select it. - ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_DOWN, 0)); - ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_RETURN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_DOWN, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_RETURN, 0)); // Wait for the new tab to appear. ASSERT_TRUE(browser->WaitForTabCountToBecome(2, action_timeout_ms())); @@ -125,13 +125,13 @@ TEST_F(KeyboardAccessTest, FAILS_ReserveKeyboardAccelerators) { scoped_refptr<WindowProxy> window(browser->GetWindow()); ASSERT_TRUE(window); ASSERT_TRUE(window->SimulateOSKeyPress( - base::VKEY_TAB, views::Event::EF_CONTROL_DOWN)); + app::VKEY_TAB, views::Event::EF_CONTROL_DOWN)); ASSERT_TRUE(browser->WaitForTabToBecomeActive(0, action_max_timeout_ms())); #if !defined(OS_MACOSX) // see BrowserWindowCocoa::GetCommandId ASSERT_TRUE(browser->ActivateTab(1)); ASSERT_TRUE(window->SimulateOSKeyPress( - base::VKEY_F4, views::Event::EF_CONTROL_DOWN)); + app::VKEY_F4, views::Event::EF_CONTROL_DOWN)); ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_max_timeout_ms())); #endif } diff --git a/chrome/test/interactive_ui/npapi_interactive_test.cc b/chrome/test/interactive_ui/npapi_interactive_test.cc index 7965151..7a867d2 100644 --- a/chrome/test/interactive_ui/npapi_interactive_test.cc +++ b/chrome/test/interactive_ui/npapi_interactive_test.cc @@ -31,8 +31,8 @@ // NPAPI interactive UI tests. // +#include "app/keyboard_codes.h" #include "base/file_path.h" -#include "base/keyboard_codes.h" #include "chrome/browser/net/url_request_mock_http_job.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" @@ -95,7 +95,7 @@ TEST_F(NPAPIVisiblePluginTester, GetURLRequest404Response) { automation()->WaitForAppModalDialog(); scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); ASSERT_TRUE(window.get()); - ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_ESCAPE, 0)); WaitForFinish("geturl_404_response", "1", url, kTestCompleteCookie, kTestCompleteSuccess, action_max_timeout_ms()); @@ -114,7 +114,7 @@ TEST_F(NPAPIVisiblePluginTester, DISABLED_SelfDeletePluginInvokeAlert) { ASSERT_TRUE(automation()->WaitForAppModalDialog()); scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); ASSERT_TRUE(window.get()); - ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); + ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_ESCAPE, 0)); WaitForFinish("self_delete_plugin_invoke_alert", "1", url, kTestCompleteCookie, kTestCompleteSuccess, diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index a903032..6289b56 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -36,11 +36,11 @@ #include <fstream> +#include "app/keyboard_codes.h" #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/file_version_info.h" -#include "base/keyboard_codes.h" #include "base/i18n/time_formatting.h" #include "base/path_service.h" #include "base/string_number_conversions.h" @@ -209,9 +209,9 @@ class PageLoadTest : public UITest { scoped_refptr<WindowProxy> window(browser->GetWindow()); if (window.get()) { if (browser->BringToFront()) { - window->SimulateOSKeyPress(base::VKEY_NEXT, 0); + window->SimulateOSKeyPress(app::VKEY_NEXT, 0); PlatformThread::Sleep(sleep_timeout_ms()); - window->SimulateOSKeyPress(base::VKEY_NEXT, 0); + window->SimulateOSKeyPress(app::VKEY_NEXT, 0); PlatformThread::Sleep(sleep_timeout_ms()); } } diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc index 9094525..848f440 100644 --- a/chrome/test/render_view_test.cc +++ b/chrome/test/render_view_test.cc @@ -26,7 +26,7 @@ #include "webkit/glue/webkit_glue.h" #if defined(OS_LINUX) -#include "base/event_synthesis_gtk.h" +#include "app/event_synthesis_gtk.h" #endif using WebKit::WebFrame; @@ -188,8 +188,8 @@ int RenderViewTest::SendKeyEvent(MockKeyboard::Layout layout, // We ignore |layout|, which means we are only testing the layout of the // current locale. TODO(estade): fix this to respect |layout|. std::vector<GdkEvent*> events; - base::SynthesizeKeyPressEvents( - NULL, static_cast<base::KeyboardCode>(key_code), + app::SynthesizeKeyPressEvents( + NULL, static_cast<app::KeyboardCode>(key_code), modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index 9c86038..ad0d3a7 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -551,7 +551,7 @@ void WaitForBookmarkModelToLoad(BookmarkModel* model) { } bool SendKeyPressSync(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h index 8ca8b02..28552d8 100644 --- a/chrome/test/ui_test_utils.h +++ b/chrome/test/ui_test_utils.h @@ -10,8 +10,8 @@ #include <string> #include <set> +#include "app/keyboard_codes.h" #include "base/basictypes.h" -#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "base/scoped_temp_dir.h" #include "base/string16.h" @@ -193,7 +193,7 @@ void WaitForBookmarkModelToLoad(BookmarkModel* model); // out. This uses ui_controls::SendKeyPress, see it for details. Returns true // if the event was successfully sent and received. bool SendKeyPressSync(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, diff --git a/chrome/test/webdriver/keymap.cc b/chrome/test/webdriver/keymap.cc index 6c3eac6..640bf45 100644 --- a/chrome/test/webdriver/keymap.cc +++ b/chrome/test/webdriver/keymap.cc @@ -14,132 +14,132 @@ KeyMap::KeyMap() { // 0xE000-0xF8FF. // Special WebDriver NULL key; clears all modifiers. - keys_[L'\uE000'] = base::VKEY_UNKNOWN; - - keys_[L'\uE001'] = base::VKEY_UNKNOWN; // TODO(jmikhail): CANCEL - keys_[L'\uE002'] = base::VKEY_HELP; - keys_[L'\uE003'] = base::VKEY_BACK; // BACKSPACE - keys_[L'\uE004'] = base::VKEY_TAB; - keys_[L'\uE005'] = base::VKEY_CLEAR; - keys_[L'\uE006'] = base::VKEY_RETURN; - keys_[L'\uE007'] = base::VKEY_UNKNOWN; // TODO(jmikhail): ENTER - keys_[L'\uE008'] = base::VKEY_SHIFT; - keys_[L'\uE009'] = base::VKEY_CONTROL; - keys_[L'\uE00A'] = base::VKEY_MENU; // ALT - keys_[L'\uE00B'] = base::VKEY_PAUSE; - keys_[L'\uE00C'] = base::VKEY_ESCAPE; - keys_[L'\uE00D'] = base::VKEY_SPACE; - keys_[L'\uE00E'] = base::VKEY_PRIOR; // PAGEUP - keys_[L'\uE00F'] = base::VKEY_NEXT; // PAGEDOWN - keys_[L'\uE010'] = base::VKEY_END; - keys_[L'\uE011'] = base::VKEY_HOME; - keys_[L'\uE012'] = base::VKEY_LEFT; - keys_[L'\uE013'] = base::VKEY_UP; - keys_[L'\uE014'] = base::VKEY_RIGHT; - keys_[L'\uE015'] = base::VKEY_DOWN; - keys_[L'\uE016'] = base::VKEY_INSERT; - keys_[L'\uE017'] = base::VKEY_DELETE; - - keys_[L'\uE01A'] = base::VKEY_NUMPAD0; - keys_[L'\uE01B'] = base::VKEY_NUMPAD1; - keys_[L'\uE01C'] = base::VKEY_NUMPAD2; - keys_[L'\uE01D'] = base::VKEY_NUMPAD3; - keys_[L'\uE01E'] = base::VKEY_NUMPAD4; - keys_[L'\uE01F'] = base::VKEY_NUMPAD5; - keys_[L'\uE020'] = base::VKEY_NUMPAD6; - keys_[L'\uE021'] = base::VKEY_NUMPAD7; - keys_[L'\uE022'] = base::VKEY_NUMPAD8; - keys_[L'\uE023'] = base::VKEY_NUMPAD9; - keys_[L'\uE024'] = base::VKEY_MULTIPLY; - keys_[L'\uE025'] = base::VKEY_ADD; - keys_[L'\uE026'] = base::VKEY_SEPARATOR; - keys_[L'\uE027'] = base::VKEY_SUBTRACT; - keys_[L'\uE028'] = base::VKEY_DECIMAL; - keys_[L'\uE029'] = base::VKEY_DIVIDE; - - keys_[L'\uE031'] = base::VKEY_F1; - keys_[L'\uE032'] = base::VKEY_F2; - keys_[L'\uE033'] = base::VKEY_F3; - keys_[L'\uE034'] = base::VKEY_F4; - keys_[L'\uE035'] = base::VKEY_F5; - keys_[L'\uE036'] = base::VKEY_F6; - keys_[L'\uE037'] = base::VKEY_F7; - keys_[L'\uE038'] = base::VKEY_F8; - keys_[L'\uE039'] = base::VKEY_F9; - keys_[L'\uE03A'] = base::VKEY_F10; - keys_[L'\uE03B'] = base::VKEY_F11; - keys_[L'\uE03C'] = base::VKEY_F12; + keys_[L'\uE000'] = app::VKEY_UNKNOWN; + + keys_[L'\uE001'] = app::VKEY_UNKNOWN; // TODO(jmikhail): CANCEL + keys_[L'\uE002'] = app::VKEY_HELP; + keys_[L'\uE003'] = app::VKEY_BACK; // BACKSPACE + keys_[L'\uE004'] = app::VKEY_TAB; + keys_[L'\uE005'] = app::VKEY_CLEAR; + keys_[L'\uE006'] = app::VKEY_RETURN; + keys_[L'\uE007'] = app::VKEY_UNKNOWN; // TODO(jmikhail): ENTER + keys_[L'\uE008'] = app::VKEY_SHIFT; + keys_[L'\uE009'] = app::VKEY_CONTROL; + keys_[L'\uE00A'] = app::VKEY_MENU; // ALT + keys_[L'\uE00B'] = app::VKEY_PAUSE; + keys_[L'\uE00C'] = app::VKEY_ESCAPE; + keys_[L'\uE00D'] = app::VKEY_SPACE; + keys_[L'\uE00E'] = app::VKEY_PRIOR; // PAGEUP + keys_[L'\uE00F'] = app::VKEY_NEXT; // PAGEDOWN + keys_[L'\uE010'] = app::VKEY_END; + keys_[L'\uE011'] = app::VKEY_HOME; + keys_[L'\uE012'] = app::VKEY_LEFT; + keys_[L'\uE013'] = app::VKEY_UP; + keys_[L'\uE014'] = app::VKEY_RIGHT; + keys_[L'\uE015'] = app::VKEY_DOWN; + keys_[L'\uE016'] = app::VKEY_INSERT; + keys_[L'\uE017'] = app::VKEY_DELETE; + + keys_[L'\uE01A'] = app::VKEY_NUMPAD0; + keys_[L'\uE01B'] = app::VKEY_NUMPAD1; + keys_[L'\uE01C'] = app::VKEY_NUMPAD2; + keys_[L'\uE01D'] = app::VKEY_NUMPAD3; + keys_[L'\uE01E'] = app::VKEY_NUMPAD4; + keys_[L'\uE01F'] = app::VKEY_NUMPAD5; + keys_[L'\uE020'] = app::VKEY_NUMPAD6; + keys_[L'\uE021'] = app::VKEY_NUMPAD7; + keys_[L'\uE022'] = app::VKEY_NUMPAD8; + keys_[L'\uE023'] = app::VKEY_NUMPAD9; + keys_[L'\uE024'] = app::VKEY_MULTIPLY; + keys_[L'\uE025'] = app::VKEY_ADD; + keys_[L'\uE026'] = app::VKEY_SEPARATOR; + keys_[L'\uE027'] = app::VKEY_SUBTRACT; + keys_[L'\uE028'] = app::VKEY_DECIMAL; + keys_[L'\uE029'] = app::VKEY_DIVIDE; + + keys_[L'\uE031'] = app::VKEY_F1; + keys_[L'\uE032'] = app::VKEY_F2; + keys_[L'\uE033'] = app::VKEY_F3; + keys_[L'\uE034'] = app::VKEY_F4; + keys_[L'\uE035'] = app::VKEY_F5; + keys_[L'\uE036'] = app::VKEY_F6; + keys_[L'\uE037'] = app::VKEY_F7; + keys_[L'\uE038'] = app::VKEY_F8; + keys_[L'\uE039'] = app::VKEY_F9; + keys_[L'\uE03A'] = app::VKEY_F10; + keys_[L'\uE03B'] = app::VKEY_F11; + keys_[L'\uE03C'] = app::VKEY_F12; // Common aliases. - keys_[L'\t'] = base::VKEY_TAB; - keys_[L'\n'] = base::VKEY_RETURN; - keys_[L'\r'] = base::VKEY_RETURN; - keys_[L'\b'] = base::VKEY_BACK; + keys_[L'\t'] = app::VKEY_TAB; + keys_[L'\n'] = app::VKEY_RETURN; + keys_[L'\r'] = app::VKEY_RETURN; + keys_[L'\b'] = app::VKEY_BACK; - keys_[L' '] = base::VKEY_SPACE; + keys_[L' '] = app::VKEY_SPACE; // Alpha keys match their ASCII values for (int i = 0; i < 26; ++i) { keys_[static_cast<wchar_t>(L'a' + i)] = \ - static_cast<base::KeyboardCode>(base::VKEY_A + i); + static_cast<app::KeyboardCode>(app::VKEY_A + i); shifted_keys_[static_cast<wchar_t>(L'A' + i)] = \ - static_cast<base::KeyboardCode>(base::VKEY_A + i); + static_cast<app::KeyboardCode>(app::VKEY_A + i); } // Numeric keys match their ASCII values for (int i = 0; i < 10; ++i) { keys_[static_cast<wchar_t>(L'0' + i)] = \ - static_cast<base::KeyboardCode>(base::VKEY_0 + i); + static_cast<app::KeyboardCode>(app::VKEY_0 + i); } // The following all assumes the standard US keyboard. // TODO(jmikhail): Lookup correct keycode based on the current system keyboard // layout. Right now it's fixed assuming standard ANSI - keys_[L'='] = shifted_keys_[L'+'] = base::VKEY_OEM_PLUS; - keys_[L'-'] = shifted_keys_[L'_'] = base::VKEY_OEM_MINUS; - keys_[L';'] = shifted_keys_[L':'] = base::VKEY_OEM_1; - keys_[L'/'] = shifted_keys_[L'?'] = base::VKEY_OEM_2; - keys_[L'`'] = shifted_keys_[L'~'] = base::VKEY_OEM_3; - keys_[L'['] = shifted_keys_[L'{'] = base::VKEY_OEM_4; - keys_[L'\\'] = shifted_keys_[L'|'] = base::VKEY_OEM_5; - keys_[L']'] = shifted_keys_[L'}'] = base::VKEY_OEM_6; - keys_[L'\''] = shifted_keys_[L'"'] = base::VKEY_OEM_7; - keys_[L','] = shifted_keys_[L'<'] = base::VKEY_OEM_COMMA; - keys_[L'.'] = shifted_keys_[L'>'] = base::VKEY_OEM_PERIOD; - shifted_keys_[L'!'] = base::VKEY_1; - shifted_keys_[L'@'] = base::VKEY_2; - shifted_keys_[L'#'] = base::VKEY_3; - shifted_keys_[L'$'] = base::VKEY_4; - shifted_keys_[L'%'] = base::VKEY_5; - shifted_keys_[L'^'] = base::VKEY_6; - shifted_keys_[L'&'] = base::VKEY_7; - shifted_keys_[L'*'] = base::VKEY_8; - shifted_keys_[L'('] = base::VKEY_9; - shifted_keys_[L')'] = base::VKEY_0; + keys_[L'='] = shifted_keys_[L'+'] = app::VKEY_OEM_PLUS; + keys_[L'-'] = shifted_keys_[L'_'] = app::VKEY_OEM_MINUS; + keys_[L';'] = shifted_keys_[L':'] = app::VKEY_OEM_1; + keys_[L'/'] = shifted_keys_[L'?'] = app::VKEY_OEM_2; + keys_[L'`'] = shifted_keys_[L'~'] = app::VKEY_OEM_3; + keys_[L'['] = shifted_keys_[L'{'] = app::VKEY_OEM_4; + keys_[L'\\'] = shifted_keys_[L'|'] = app::VKEY_OEM_5; + keys_[L']'] = shifted_keys_[L'}'] = app::VKEY_OEM_6; + keys_[L'\''] = shifted_keys_[L'"'] = app::VKEY_OEM_7; + keys_[L','] = shifted_keys_[L'<'] = app::VKEY_OEM_COMMA; + keys_[L'.'] = shifted_keys_[L'>'] = app::VKEY_OEM_PERIOD; + shifted_keys_[L'!'] = app::VKEY_1; + shifted_keys_[L'@'] = app::VKEY_2; + shifted_keys_[L'#'] = app::VKEY_3; + shifted_keys_[L'$'] = app::VKEY_4; + shifted_keys_[L'%'] = app::VKEY_5; + shifted_keys_[L'^'] = app::VKEY_6; + shifted_keys_[L'&'] = app::VKEY_7; + shifted_keys_[L'*'] = app::VKEY_8; + shifted_keys_[L'('] = app::VKEY_9; + shifted_keys_[L')'] = app::VKEY_0; } -base::KeyboardCode KeyMap::Get(const wchar_t& key) const { - std::map<wchar_t, base::KeyboardCode>::const_iterator it; +app::KeyboardCode KeyMap::Get(const wchar_t& key) const { + std::map<wchar_t, app::KeyboardCode>::const_iterator it; it = keys_.find(key); if (it == keys_.end()) { it = shifted_keys_.find(key); if (it == shifted_keys_.end()) { - return base::VKEY_UNKNOWN; + return app::VKEY_UNKNOWN; } } return it->second; } bool KeyMap::Press(const scoped_refptr<WindowProxy>& window, - const base::KeyboardCode key_code, + const app::KeyboardCode key_code, const wchar_t& key) { - if (key_code == base::VKEY_SHIFT) { + if (key_code == app::VKEY_SHIFT) { shift_ = !shift_; - } else if (key_code == base::VKEY_CONTROL) { + } else if (key_code == app::VKEY_CONTROL) { control_ = !control_; - } else if (key_code == base::VKEY_MENU) { // ALT + } else if (key_code == app::VKEY_MENU) { // ALT alt_ = !alt_; - } else if (key_code == base::VKEY_COMMAND) { + } else if (key_code == app::VKEY_COMMAND) { command_ = !command_; } diff --git a/chrome/test/webdriver/keymap.h b/chrome/test/webdriver/keymap.h index 688ffa7..e4b1594 100644 --- a/chrome/test/webdriver/keymap.h +++ b/chrome/test/webdriver/keymap.h @@ -7,7 +7,7 @@ #include <map> -#include "base/keyboard_codes.h" +#include "app/keyboard_codes.h" #include "chrome/test/automation/window_proxy.h" namespace webdriver { @@ -16,10 +16,10 @@ namespace webdriver { class KeyMap { public: KeyMap(); - base::KeyboardCode Get(const wchar_t& key) const; + app::KeyboardCode Get(const wchar_t& key) const; bool Press(const scoped_refptr<WindowProxy>& window, - const base::KeyboardCode key_code, + const app::KeyboardCode key_code, const wchar_t& key); // Sets the Shift, Alt, Cntl, and Cmd keys to not pressed @@ -30,8 +30,8 @@ class KeyMap { bool alt_; bool control_; bool command_; - std::map<wchar_t, base::KeyboardCode> keys_; - std::map<wchar_t, base::KeyboardCode> shifted_keys_; + std::map<wchar_t, app::KeyboardCode> keys_; + std::map<wchar_t, app::KeyboardCode> shifted_keys_; DISALLOW_COPY_AND_ASSIGN(KeyMap); }; } // namespace webdriver |