diff options
Diffstat (limited to 'chrome')
57 files changed, 218 insertions, 229 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc index c030c57..80baa0d 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc @@ -165,21 +165,21 @@ bool AutocompleteEditViewViews::HandleAfterKeyEvent( if (content_maybe_changed_by_key_press_) OnAfterPossibleChange(); - if (event.GetKeyCode() == ui::VKEY_RETURN) { + if (event.key_code() == ui::VKEY_RETURN) { bool alt_held = event.IsAltDown(); model_->AcceptInput(alt_held ? NEW_FOREGROUND_TAB : CURRENT_TAB, false); handled = true; - } else if (!handled && event.GetKeyCode() == ui::VKEY_ESCAPE) { + } else if (!handled && event.key_code() == ui::VKEY_ESCAPE) { // We can handle the Escape key if textfield did not handle it. // If it's not handled by us, then we need to propagate it up to the parent // widgets, so that Escape accelerator can still work. handled = model_->OnEscapeKeyPressed(); - } else if (event.GetKeyCode() == ui::VKEY_CONTROL) { + } else if (event.key_code() == ui::VKEY_CONTROL) { // Omnibox2 can switch its contents while pressing a control key. To switch // the contents of omnibox2, we notify the AutocompleteEditModel class when // the control-key state is changed. model_->OnControlKeyChanged(true); - } else if (!text_changed_ && event.GetKeyCode() == ui::VKEY_DELETE && + } else if (!text_changed_ && event.key_code() == ui::VKEY_DELETE && event.IsShiftDown()) { // If shift+del didn't change the text, we let this delete an entry from // the popup. We can't check to see if the IME handled it because even if @@ -187,14 +187,14 @@ bool AutocompleteEditViewViews::HandleAfterKeyEvent( AutocompletePopupModel* popup_model = popup_view_->GetModel(); if (popup_model->IsOpen()) popup_model->TryDeletingCurrentItem(); - } else if (!handled && event.GetKeyCode() == ui::VKEY_UP) { + } else if (!handled && event.key_code() == ui::VKEY_UP) { model_->OnUpOrDownKeyPressed(-1); handled = true; - } else if (!handled && event.GetKeyCode() == ui::VKEY_DOWN) { + } else if (!handled && event.key_code() == ui::VKEY_DOWN) { model_->OnUpOrDownKeyPressed(1); handled = true; } else if (!handled && - event.GetKeyCode() == ui::VKEY_TAB && + event.key_code() == ui::VKEY_TAB && !event.IsShiftDown() && !event.IsControlDown()) { if (model_->is_keyword_hint()) { @@ -224,7 +224,7 @@ bool AutocompleteEditViewViews::HandleKeyReleaseEvent( // Omnibox2 can switch its contents while pressing a control key. To switch // the contents of omnibox2, we notify the AutocompleteEditModel class when // the control-key state is changed. - if (event.GetKeyCode() == ui::VKEY_CONTROL) { + if (event.key_code() == ui::VKEY_CONTROL) { // TODO(oshima): investigate if we need to support keyboard with two // controls. See autocomplete_edit_view_gtk.cc. model_->OnControlKeyChanged(false); @@ -583,7 +583,7 @@ void AutocompleteEditViewViews::ContentsChanged(views::Textfield* sender, bool AutocompleteEditViewViews::HandleKeyEvent( views::Textfield* textfield, const views::KeyEvent& event) { - delete_was_pressed_ = event.GetKeyCode() == ui::VKEY_DELETE; + delete_was_pressed_ = event.key_code() == ui::VKEY_DELETE; // Reset |text_changed_| before passing the key event on to the text view. text_changed_ = false; @@ -591,7 +591,7 @@ bool AutocompleteEditViewViews::HandleKeyEvent( handling_key_press_ = true; content_maybe_changed_by_key_press_ = false; - if (event.GetKeyCode() == ui::VKEY_BACK) { + if (event.key_code() == ui::VKEY_BACK) { // Checks if it's currently in keyword search mode. if (model_->is_keyword_hint() || model_->keyword().empty()) return false; diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index 6366873..889d682 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -969,7 +969,7 @@ void AutocompleteEditViewWin::PasteAndGo(const string16& text) { bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing( const views::KeyEvent& e) { - ui::KeyboardCode key = e.GetKeyCode(); + ui::KeyboardCode key = e.key_code(); // 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 != ui::VKEY_HOME) && diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 9175049..255781ba 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -99,7 +99,6 @@ #include "net/proxy/proxy_config_service_fixed.h" #include "net/url_request/url_request_context.h" #include "chrome/browser/automation/ui_controls.h" -#include "views/events/event.h" #include "webkit/glue/password_form.h" #if defined(OS_WIN) diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 5646c75..e0f76c9 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -79,7 +79,7 @@ BOOL CALLBACK EnumThreadWndProc(HWND hwnd, LPARAM l_param) { class MouseEventTask : public Task { public: MouseEventTask(views::View* view, - views::Event::EventType type, + ui::EventType type, const gfx::Point& point, int flags) : view_(view), type_(type), point_(point), flags_(flags) {} @@ -97,15 +97,15 @@ class MouseEventTask : public Task { view_->ConvertPointToScreen(view_, &screen_location); MoveMouse(screen_location.ToPOINT()); switch (type_) { - case views::Event::ET_MOUSE_PRESSED: + case ui::ET_MOUSE_PRESSED: view_->OnMousePressed(event); break; - case views::Event::ET_MOUSE_DRAGGED: + case ui::ET_MOUSE_DRAGGED: view_->OnMouseDragged(event); break; - case views::Event::ET_MOUSE_RELEASED: + case ui::ET_MOUSE_RELEASED: view_->OnMouseReleased(event, false); break; @@ -116,7 +116,7 @@ class MouseEventTask : public Task { private: views::View* view_; - views::Event::EventType type_; + ui::EventType type_; gfx::Point point_; int flags_; @@ -159,21 +159,21 @@ void AutomationProvider::WindowSimulateDrag(int handle, UINT down_message = 0; UINT up_message = 0; WPARAM wparam_flags = 0; - if (flags & views::Event::EF_SHIFT_DOWN) + if (flags & ui::EF_SHIFT_DOWN) wparam_flags |= MK_SHIFT; - if (flags & views::Event::EF_CONTROL_DOWN) + if (flags & ui::EF_CONTROL_DOWN) wparam_flags |= MK_CONTROL; - if (flags & views::Event::EF_LEFT_BUTTON_DOWN) { + if (flags & ui::EF_LEFT_BUTTON_DOWN) { wparam_flags |= MK_LBUTTON; down_message = WM_LBUTTONDOWN; up_message = WM_LBUTTONUP; } - if (flags & views::Event::EF_MIDDLE_BUTTON_DOWN) { + if (flags & ui::EF_MIDDLE_BUTTON_DOWN) { wparam_flags |= MK_MBUTTON; down_message = WM_MBUTTONDOWN; up_message = WM_MBUTTONUP; } - if (flags & views::Event::EF_RIGHT_BUTTON_DOWN) { + if (flags & ui::EF_RIGHT_BUTTON_DOWN) { wparam_flags |= MK_RBUTTON; down_message = WM_LBUTTONDOWN; up_message = WM_LBUTTONUP; @@ -204,11 +204,11 @@ void AutomationProvider::WindowSimulateDrag(int handle, // TODO(phajdan.jr): make this use ui_test_utils::SendKeyPressSync. ui_controls::SendKeyPressNotifyWhenDone( window, ui::VKEY_ESCAPE, - ((flags & views::Event::EF_CONTROL_DOWN) == - views::Event::EF_CONTROL_DOWN), - ((flags & views::Event::EF_SHIFT_DOWN) == - views::Event::EF_SHIFT_DOWN), - ((flags & views::Event::EF_ALT_DOWN) == views::Event::EF_ALT_DOWN), + ((flags & ui::EF_CONTROL_DOWN) == + ui::EF_CONTROL_DOWN), + ((flags & ui::EF_SHIFT_DOWN) == + ui::EF_SHIFT_DOWN), + ((flags & ui::EF_ALT_DOWN) == ui::EF_ALT_DOWN), false, new MessageLoop::QuitTask()); MessageLoopForUI* loop = MessageLoopForUI::current(); diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 529a052..6e718cb 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -79,8 +79,8 @@ #include "net/base/cookie_store.h" #include "net/url_request/url_request_context.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" +#include "ui/base/events.h" #include "ui/base/message_box_flags.h" -#include "views/events/event.h" #include "webkit/plugins/npapi/plugin_list.h" namespace { @@ -115,14 +115,14 @@ void DeleteCookieOnIOThread( void SendMouseClick(int flags) { ui_controls::MouseButton button = ui_controls::LEFT; - if ((flags & views::Event::EF_LEFT_BUTTON_DOWN) == - views::Event::EF_LEFT_BUTTON_DOWN) { + if ((flags & ui::EF_LEFT_BUTTON_DOWN) == + ui::EF_LEFT_BUTTON_DOWN) { button = ui_controls::LEFT; - } else if ((flags & views::Event::EF_RIGHT_BUTTON_DOWN) == - views::Event::EF_RIGHT_BUTTON_DOWN) { + } else if ((flags & ui::EF_RIGHT_BUTTON_DOWN) == + ui::EF_RIGHT_BUTTON_DOWN) { button = ui_controls::RIGHT; - } else if ((flags & views::Event::EF_MIDDLE_BUTTON_DOWN) == - views::Event::EF_MIDDLE_BUTTON_DOWN) { + } else if ((flags & ui::EF_MIDDLE_BUTTON_DOWN) == + ui::EF_MIDDLE_BUTTON_DOWN) { button = ui_controls::MIDDLE; } else { NOTREACHED(); @@ -879,14 +879,14 @@ 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<ui::KeyboardCode>(key), - ((flags & views::Event::EF_CONTROL_DOWN) == - views::Event::EF_CONTROL_DOWN), - ((flags & views::Event::EF_SHIFT_DOWN) == - views::Event::EF_SHIFT_DOWN), - ((flags & views::Event::EF_ALT_DOWN) == - views::Event::EF_ALT_DOWN), - ((flags & views::Event::EF_COMMAND_DOWN) == - views::Event::EF_COMMAND_DOWN)); + ((flags & ui::EF_CONTROL_DOWN) == + ui::EF_CONTROL_DOWN), + ((flags & ui::EF_SHIFT_DOWN) == + ui::EF_SHIFT_DOWN), + ((flags & ui::EF_ALT_DOWN) == + ui::EF_ALT_DOWN), + ((flags & ui::EF_COMMAND_DOWN) == + ui::EF_COMMAND_DOWN)); } void TestingAutomationProvider::GetTabCount(int handle, int* tab_count) { diff --git a/chrome/browser/bookmarks/bookmark_drop_info.cc b/chrome/browser/bookmarks/bookmark_drop_info.cc index ba9d7a0..30d1f03 100644 --- a/chrome/browser/bookmarks/bookmark_drop_info.cc +++ b/chrome/browser/bookmarks/bookmark_drop_info.cc @@ -26,7 +26,7 @@ BookmarkDropInfo::~BookmarkDropInfo() { } void BookmarkDropInfo::Update(const views::DropTargetEvent& event) { - source_operations_ = event.GetSourceOperations(); + source_operations_ = event.source_operations(); is_control_down_ = event.IsControlDown(); last_y_ = event.y(); diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 6e26e9b..898e5a9 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -35,11 +35,11 @@ #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/models/tree_node_iterator.h" -#include "views/events/event.h" #if defined(TOOLKIT_VIEWS) #include "ui/base/dragdrop/os_exchange_data.h" #include "views/drag_utils.h" +#include "views/events/event.h" #include "views/widget/root_view.h" #include "views/widget/widget.h" #elif defined(TOOLKIT_GTK) @@ -227,6 +227,7 @@ int BookmarkDragOperation(const BookmarkNode* node) { return ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE; } +#if defined(TOOLKIT_VIEWS) int BookmarkDropOperation(Profile* profile, const views::DropTargetEvent& event, const BookmarkNodeData& data, @@ -244,9 +245,10 @@ int BookmarkDropOperation(Profile* profile, return ui::DragDropTypes::DRAG_MOVE; } // User is dragging from another app, copy. - return PreferredDropOperation(event.GetSourceOperations(), + return PreferredDropOperation(event.source_operations(), ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); } +#endif // defined(TOOLKIT_VIEWS) int PerformBookmarkDrop(Profile* profile, const BookmarkNodeData& data, diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc index 3490e9b..dae33363 100644 --- a/chrome/browser/chromeos/login/background_view.cc +++ b/chrome/browser/chromeos/login/background_view.cc @@ -83,7 +83,7 @@ class TextButtonWithHandCursorOver : public views::TextButton { virtual ~TextButtonWithHandCursorOver() {} virtual gfx::NativeCursor GetCursorForPoint( - views::Event::EventType event_type, + ui::EventType event_type, const gfx::Point& p) { if (!IsEnabled()) { return NULL; diff --git a/chrome/browser/chromeos/login/captcha_view.cc b/chrome/browser/chromeos/login/captcha_view.cc index 4126832..c4c295b 100644 --- a/chrome/browser/chromeos/login/captcha_view.cc +++ b/chrome/browser/chromeos/login/captcha_view.cc @@ -123,7 +123,7 @@ void CaptchaView::ViewHierarchyChanged(bool is_add, bool CaptchaView::HandleKeyEvent(views::Textfield* sender, const views::KeyEvent& key_event) { if (sender == captcha_textfield_ && - key_event.GetKeyCode() == ui::VKEY_RETURN) { + key_event.key_code() == ui::VKEY_RETURN) { if (is_standalone_) { Accept(); } else { diff --git a/chrome/browser/chromeos/login/existing_user_view.cc b/chrome/browser/chromeos/login/existing_user_view.cc index dcf100f..8655351 100644 --- a/chrome/browser/chromeos/login/existing_user_view.cc +++ b/chrome/browser/chromeos/login/existing_user_view.cc @@ -33,13 +33,13 @@ class UserEntryTextfield : public TextfieldWithMargin { // Overridden from views::View: virtual bool OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_TAB) { + if (e.key_code() == ui::VKEY_TAB) { controller_->SelectUserRelative(e.IsShiftDown() ? -1 : 1); return true; - } else if (e.GetKeyCode() == ui::VKEY_LEFT) { + } else if (e.key_code() == ui::VKEY_LEFT) { controller_->SelectUserRelative(-1); return true; - } else if (e.GetKeyCode() == ui::VKEY_RIGHT) { + } else if (e.key_code() == ui::VKEY_RIGHT) { controller_->SelectUserRelative(1); return true; } else { @@ -48,7 +48,7 @@ class UserEntryTextfield : public TextfieldWithMargin { } virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_TAB) + if (e.key_code() == ui::VKEY_TAB) return true; else return views::Textfield::SkipDefaultKeyEventProcessing(e); @@ -104,7 +104,7 @@ bool ExistingUserView::AcceleratorPressed( bool ExistingUserView::HandleKeyEvent(views::Textfield* sender, const views::KeyEvent& key_event) { - if (key_event.GetKeyCode() == ui::VKEY_RETURN) { + if (key_event.key_code() == ui::VKEY_RETURN) { if (!password_field_->text().empty()) user_controller_->OnLogin("", UTF16ToUTF8(password_field_->text())); } else { diff --git a/chrome/browser/chromeos/login/guest_user_view.cc b/chrome/browser/chromeos/login/guest_user_view.cc index 5f9b9b5..02978e2 100644 --- a/chrome/browser/chromeos/login/guest_user_view.cc +++ b/chrome/browser/chromeos/login/guest_user_view.cc @@ -23,7 +23,7 @@ class UserEntryButton : public login::WideButton { // Overridden from views::View: virtual bool OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_TAB) { + if (e.key_code() == ui::VKEY_TAB) { user_controller_->SelectUserRelative(e.IsShiftDown() ? -1 : 1); return true; } @@ -31,7 +31,7 @@ class UserEntryButton : public login::WideButton { } virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_TAB) + if (e.key_code() == ui::VKEY_TAB) return true; return WideButton::SkipDefaultKeyEventProcessing(e); } diff --git a/chrome/browser/chromeos/login/network_screen_browsertest.cc b/chrome/browser/chromeos/login/network_screen_browsertest.cc index 2a2dee5..3bca37d 100644 --- a/chrome/browser/chromeos/login/network_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/network_screen_browsertest.cc @@ -118,9 +118,9 @@ class NetworkScreenTest : public WizardInProcessBrowserTest { controller()->set_observer(mock_screen_observer.get()); DummyButtonListener button_listener; views::TextButton button(&button_listener, L"Button"); - views::MouseEvent event(views::Event::ET_MOUSE_RELEASED, + views::MouseEvent event(ui::ET_MOUSE_RELEASED, 0, 0, - views::Event::EF_LEFT_BUTTON_DOWN); + ui::EF_LEFT_BUTTON_DOWN); network_screen->ButtonPressed(&button, event); ui_test_utils::RunAllPendingInMessageLoop(); controller()->set_observer(NULL); diff --git a/chrome/browser/chromeos/login/new_user_view.cc b/chrome/browser/chromeos/login/new_user_view.cc index 121cf9f..ab17d64 100644 --- a/chrome/browser/chromeos/login/new_user_view.cc +++ b/chrome/browser/chromeos/login/new_user_view.cc @@ -85,7 +85,7 @@ class UsernameField : public chromeos::TextfieldWithMargin { // Overridden from views::View: virtual bool OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_LEFT) { + if (e.key_code() == ui::VKEY_LEFT) { return controller_->NavigateAway(); } return false; @@ -512,7 +512,7 @@ bool NewUserView::HandleKeyEvent(views::Textfield* sender, if (!CrosLibrary::Get()->EnsureLoaded() || login_in_process_) return false; - if (key_event.GetKeyCode() == ui::VKEY_RETURN) { + if (key_event.key_code() == ui::VKEY_RETURN) { if (!username_field_->text().empty() && !password_field_->text().empty()) Login(); // Return true so that processing ends diff --git a/chrome/browser/chromeos/login/screen_lock_view.cc b/chrome/browser/chromeos/login/screen_lock_view.cc index e74710a..0ebcd09 100644 --- a/chrome/browser/chromeos/login/screen_lock_view.cc +++ b/chrome/browser/chromeos/login/screen_lock_view.cc @@ -198,7 +198,7 @@ bool ScreenLockView::HandleKeyEvent( views::Textfield* sender, const views::KeyEvent& key_event) { screen_locker_->ClearErrors(); - if (key_event.GetKeyCode() == ui::VKEY_RETURN) { + if (key_event.key_code() == ui::VKEY_RETURN) { screen_locker_->Authenticate(password_field_->text()); return true; } diff --git a/chrome/browser/chromeos/login/shutdown_button.cc b/chrome/browser/chromeos/login/shutdown_button.cc index 138467c..d66b879 100644 --- a/chrome/browser/chromeos/login/shutdown_button.cc +++ b/chrome/browser/chromeos/login/shutdown_button.cc @@ -116,7 +116,7 @@ void ShutdownButton::OnLocaleChanged() { } gfx::NativeCursor ShutdownButton::GetCursorForPoint( - views::Event::EventType event_type, + ui::EventType event_type, const gfx::Point& p) { if (!IsEnabled()) { return NULL; diff --git a/chrome/browser/chromeos/login/shutdown_button.h b/chrome/browser/chromeos/login/shutdown_button.h index dd0a65a..15cb2ad 100644 --- a/chrome/browser/chromeos/login/shutdown_button.h +++ b/chrome/browser/chromeos/login/shutdown_button.h @@ -26,7 +26,7 @@ class ShutdownButton : public views::TextButton, // views::View overrides. virtual void OnLocaleChanged(); virtual gfx::NativeCursor GetCursorForPoint( - views::Event::EventType event_type, + ui::EventType event_type, const gfx::Point& p); // views::ButtonListener implementation. diff --git a/chrome/browser/chromeos/login/textfield_with_margin.cc b/chrome/browser/chromeos/login/textfield_with_margin.cc index 38cadb7..eb75416 100644 --- a/chrome/browser/chromeos/login/textfield_with_margin.cc +++ b/chrome/browser/chromeos/login/textfield_with_margin.cc @@ -36,7 +36,7 @@ void TextfieldWithMargin::Layout() { } bool TextfieldWithMargin::OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_ESCAPE && !text().empty()) { + if (e.key_code() == ui::VKEY_ESCAPE && !text().empty()) { SetText(string16()); return true; } diff --git a/chrome/browser/chromeos/login/user_view.cc b/chrome/browser/chromeos/login/user_view.cc index 3b07efd..85ef9df 100644 --- a/chrome/browser/chromeos/login/user_view.cc +++ b/chrome/browser/chromeos/login/user_view.cc @@ -235,7 +235,7 @@ class PodImageView : public views::ImageView { } gfx::NativeCursor GetCursorForPoint( - views::Event::EventType event_type, + ui::EventType event_type, const gfx::Point& p) { return (delegate_->IsUserSelected()) ? NULL : gfx::GetCursor(GDK_HAND2); } diff --git a/chrome/browser/chromeos/login/username_view.cc b/chrome/browser/chromeos/login/username_view.cc index fedf340..db22e2b 100644 --- a/chrome/browser/chromeos/login/username_view.cc +++ b/chrome/browser/chromeos/login/username_view.cc @@ -97,7 +97,7 @@ UsernameView* UsernameView::CreateShapedUsernameView( } gfx::NativeCursor UsernameView::GetCursorForPoint( - views::Event::EventType event_type, + ui::EventType event_type, const gfx::Point& p) { return use_small_shape_ ? gfx::GetCursor(GDK_HAND2) : NULL; } diff --git a/chrome/browser/chromeos/login/username_view.h b/chrome/browser/chromeos/login/username_view.h index 3a6245a..12ec105 100644 --- a/chrome/browser/chromeos/login/username_view.h +++ b/chrome/browser/chromeos/login/username_view.h @@ -46,7 +46,7 @@ class UsernameView : public views::Label { private: // Overriden from View. virtual gfx::NativeCursor GetCursorForPoint( - views::Event::EventType event_type, + ui::EventType event_type, const gfx::Point& p); virtual void OnLocaleChanged(); diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc index f55c1b5..e419994 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.cc +++ b/chrome/browser/chromeos/options/wifi_config_view.cc @@ -152,7 +152,7 @@ void WifiConfigView::ContentsChanged(views::Textfield* sender, bool WifiConfigView::HandleKeyEvent(views::Textfield* sender, const views::KeyEvent& key_event) { if (sender == passphrase_textfield_ && - key_event.GetKeyCode() == ui::VKEY_RETURN) { + key_event.key_code() == ui::VKEY_RETURN) { parent_->GetDialogClientView()->AcceptWindow(); } return false; diff --git a/chrome/browser/extensions/extension_input_api.cc b/chrome/browser/extensions/extension_input_api.cc index bb91c00..b062fd4 100644 --- a/chrome/browser/extensions/extension_input_api.cc +++ b/chrome/browser/extensions/extension_input_api.cc @@ -39,13 +39,13 @@ const char kUnsupportedModifier[] = "Unsupported modifier."; const char kNoValidRecipientError[] = "No valid recipient for event."; const char kKeyEventUnprocessedError[] = "Event was not handled."; -views::Event::EventType GetTypeFromString(const std::string& type) { +ui::EventType GetTypeFromString(const std::string& type) { if (type == kKeyDown) { - return views::Event::ET_KEY_PRESSED; + return ui::ET_KEY_PRESSED; } else if (type == kKeyUp) { - return views::Event::ET_KEY_RELEASED; + return ui::ET_KEY_RELEASED; } - return views::Event::ET_UNKNOWN; + return ui::ET_UNKNOWN; } } // namespace @@ -77,8 +77,8 @@ bool SendKeyboardEventInputFunction::RunImpl() { std::string type_name; EXTENSION_FUNCTION_VALIDATE(args->GetString(kType, &type_name)); - views::Event::EventType type = GetTypeFromString(type_name); - if (type == views::Event::ET_UNKNOWN) { + ui::EventType type = GetTypeFromString(type_name); + if (type == ui::ET_UNKNOWN) { error_ = kUnknownEventTypeError; return false; } @@ -89,21 +89,21 @@ bool SendKeyboardEventInputFunction::RunImpl() { const views::KeyEvent& prototype_event = KeyEventFromKeyIdentifier(identifier); - if (prototype_event.GetKeyCode() == ui::VKEY_UNKNOWN) { + if (prototype_event.key_code() == ui::VKEY_UNKNOWN) { error_ = kUnknownOrUnsupportedKeyIdentiferError; return false; } - int flags = prototype_event.GetFlags(); + int flags = prototype_event.flags(); bool alt = false; if (args->GetBoolean(kAlt, &alt)) - flags |= alt ? views::Event::EF_ALT_DOWN : 0; + flags |= alt ? ui::EF_ALT_DOWN : 0; bool ctrl = false; if (args->GetBoolean(kCtrl, &ctrl)) - flags |= ctrl ? views::Event::EF_CONTROL_DOWN : 0; + flags |= ctrl ? ui::EF_CONTROL_DOWN : 0; bool shift = false; if (args->GetBoolean(kShift, &shift)) - flags |= shift ? views::Event::EF_SHIFT_DOWN : 0; + flags |= shift ? ui::EF_SHIFT_DOWN : 0; bool meta = false; if (args->GetBoolean(kMeta, &meta)) { // Views does not have a Meta event flag, so return an error for now. @@ -119,7 +119,7 @@ bool SendKeyboardEventInputFunction::RunImpl() { return false; } - views::KeyEvent event(type, prototype_event.GetKeyCode(), flags, 0, 0); + views::KeyEvent event(type, prototype_event.key_code(), flags, 0, 0); if (!root_view->ProcessKeyEvent(event)) { error_ = kKeyEventUnprocessedError; return false; diff --git a/chrome/browser/extensions/key_identifier_conversion_views.cc b/chrome/browser/extensions/key_identifier_conversion_views.cc index 84dede3..de11ad7 100644 --- a/chrome/browser/extensions/key_identifier_conversion_views.cc +++ b/chrome/browser/extensions/key_identifier_conversion_views.cc @@ -159,18 +159,18 @@ static const KeyIdentifier kKeyIdentifiers[] = { { {"Cancel", "", "U+0018"}, ui::VKEY_UNKNOWN, 0 }, { {"Esc", "", "U+001B"}, ui::VKEY_ESCAPE, 0 }, { {"Spacebar", " ", "U+0020"}, ui::VKEY_SPACE, 0 }, - { {"Exclamation", "!", "U+0021"}, ui::VKEY_1, views::Event::EF_SHIFT_DOWN }, + { {"Exclamation", "!", "U+0021"}, ui::VKEY_1, ui::EF_SHIFT_DOWN }, { {"DoubleQuote", "\"", "U+0022"}, - ui::VKEY_OEM_7, views::Event::EF_SHIFT_DOWN }, - { {"Hash", "#", "U+0023"}, ui::VKEY_3, views::Event::EF_SHIFT_DOWN }, - { {"Dollar", "$", "U+0024"}, ui::VKEY_4, views::Event::EF_SHIFT_DOWN }, - { {"Ampersand", "&", "U+0026"}, ui::VKEY_7, views::Event::EF_SHIFT_DOWN }, + ui::VKEY_OEM_7, ui::EF_SHIFT_DOWN }, + { {"Hash", "#", "U+0023"}, ui::VKEY_3, ui::EF_SHIFT_DOWN }, + { {"Dollar", "$", "U+0024"}, ui::VKEY_4, ui::EF_SHIFT_DOWN }, + { {"Ampersand", "&", "U+0026"}, ui::VKEY_7, ui::EF_SHIFT_DOWN }, { {"Apostrophe", "\'", "U+0027"}, ui::VKEY_OEM_7, 0 }, - { {"LeftParen", "(", "U+0028"}, ui::VKEY_9, views::Event::EF_SHIFT_DOWN }, - { {"RightParen", ")", "U+0029"}, ui::VKEY_0, views::Event::EF_SHIFT_DOWN }, - { {"Asterisk", "*", "U+002A"}, ui::VKEY_8, views::Event::EF_SHIFT_DOWN }, - { {"Plus", "+", "U+002B"}, ui::VKEY_OEM_PLUS, views::Event::EF_SHIFT_DOWN }, - { {"Percent", "%", "U+0025"}, ui::VKEY_5, views::Event::EF_SHIFT_DOWN }, + { {"LeftParen", "(", "U+0028"}, ui::VKEY_9, ui::EF_SHIFT_DOWN }, + { {"RightParen", ")", "U+0029"}, ui::VKEY_0, ui::EF_SHIFT_DOWN }, + { {"Asterisk", "*", "U+002A"}, ui::VKEY_8, ui::EF_SHIFT_DOWN }, + { {"Plus", "+", "U+002B"}, ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN }, + { {"Percent", "%", "U+0025"}, ui::VKEY_5, ui::EF_SHIFT_DOWN }, { {"Comma", ",", "U+002C"}, ui::VKEY_OEM_COMMA, 0 }, { {"HyphenMinus", "-", "U+002D"}, ui::VKEY_OEM_MINUS, 0 }, { {"Period", ".", "U+002E"}, ui::VKEY_OEM_PERIOD, 0 }, @@ -185,16 +185,16 @@ static const KeyIdentifier kKeyIdentifiers[] = { { {"", "7", "U+0037"}, ui::VKEY_7, 0 }, { {"", "8", "U+0038"}, ui::VKEY_8, 0 }, { {"", "9", "U+0039"}, ui::VKEY_9, 0 }, - { {"Colon", ":", "U+003A"}, ui::VKEY_OEM_1, views::Event::EF_SHIFT_DOWN }, + { {"Colon", ":", "U+003A"}, ui::VKEY_OEM_1, ui::EF_SHIFT_DOWN }, { {"Semicolon", ";", "U+003B"}, ui::VKEY_OEM_1, 0 }, { {"LessThan", "<", "U+003C"}, - ui::VKEY_OEM_COMMA, views::Event::EF_SHIFT_DOWN }, + ui::VKEY_OEM_COMMA, ui::EF_SHIFT_DOWN }, { {"Equals", "=", "U+003D"}, ui::VKEY_OEM_PLUS, 0 }, { {"GreaterThan", ">", "U+003E"}, - ui::VKEY_OEM_PERIOD, views::Event::EF_SHIFT_DOWN }, + ui::VKEY_OEM_PERIOD, ui::EF_SHIFT_DOWN }, { {"QuestionMark", "?", "U+003F"}, - ui::VKEY_OEM_2, views::Event::EF_SHIFT_DOWN }, - { {"At", "@", "U+0040"}, ui::VKEY_2, views::Event::EF_SHIFT_DOWN }, + ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN }, + { {"At", "@", "U+0040"}, ui::VKEY_2, ui::EF_SHIFT_DOWN }, { {"", "A", "U+0041"}, ui::VKEY_A, 0 }, { {"", "B", "U+0042"}, ui::VKEY_B, 0 }, { {"", "C", "U+0043"}, ui::VKEY_C, 0 }, @@ -250,16 +250,16 @@ static const KeyIdentifier kKeyIdentifiers[] = { { {"LeftSquareBracket", "[", "U+005B"}, ui::VKEY_OEM_4, 0 }, { {"Backslash", "\\", "U+005C"}, ui::VKEY_OEM_5, 0 }, { {"RightSquareBracket", "]", "U+005D"}, ui::VKEY_OEM_6, 0 }, - { {"Circumflex", "^", "U+005E"}, ui::VKEY_6, views::Event::EF_SHIFT_DOWN }, + { {"Circumflex", "^", "U+005E"}, ui::VKEY_6, ui::EF_SHIFT_DOWN }, { {"Underscore", "_", "U+005F"}, - ui::VKEY_OEM_MINUS, views::Event::EF_SHIFT_DOWN }, + ui::VKEY_OEM_MINUS, ui::EF_SHIFT_DOWN }, { {"Grave", "`", "U+0060"}, ui::VKEY_OEM_3, 0 }, - { {"Tilde", "~", "U+007E"}, ui::VKEY_OEM_3, views::Event::EF_SHIFT_DOWN }, + { {"Tilde", "~", "U+007E"}, ui::VKEY_OEM_3, ui::EF_SHIFT_DOWN }, { {"LeftCurlyBracket", "{", "U+007B"}, - ui::VKEY_OEM_4, views::Event::EF_SHIFT_DOWN }, - { {"Pipe", "|", "U+007C"}, ui::VKEY_OEM_5, views::Event::EF_SHIFT_DOWN }, + ui::VKEY_OEM_4, ui::EF_SHIFT_DOWN }, + { {"Pipe", "|", "U+007C"}, ui::VKEY_OEM_5, ui::EF_SHIFT_DOWN }, { {"RightCurlyBracket", "}", "U+007D"}, - ui::VKEY_OEM_6, views::Event::EF_SHIFT_DOWN }, + ui::VKEY_OEM_6, ui::EF_SHIFT_DOWN }, { {"Del", "", "U+007F"}, ui::VKEY_DELETE, 0 }, { {"InvertedExclamation", "", "U+00A1"}, ui::VKEY_UNKNOWN, 0 }, { {"DeadGrave", "", "U+0300"}, ui::VKEY_UNKNOWN, 0 }, @@ -294,7 +294,7 @@ static void InitializeMaps() { return; kUnknownKeyEvent = new views::KeyEvent( - views::Event::ET_KEY_PRESSED, ui::VKEY_UNKNOWN, 0, 0, 0); + ui::ET_KEY_PRESSED, ui::VKEY_UNKNOWN, 0, 0, 0); for (int i = 0; i < kNumIdentifierTypes; ++i) identifierMaps[i] = new IdentifierMap; @@ -303,7 +303,7 @@ static void InitializeMaps() { const KeyIdentifier& key = kKeyIdentifiers[i]; views::KeyEvent* event = new views::KeyEvent( - views::Event::ET_KEY_PRESSED, key.key_code, key.event_flags, 0, 0); + ui::ET_KEY_PRESSED, key.key_code, key.event_flags, 0, 0); for (int j = 0; j < kNumIdentifierTypes; ++j) { if (key.identifiers[j][0] != '\0') { diff --git a/chrome/browser/extensions/key_identifier_conversion_views_unittest.cc b/chrome/browser/extensions/key_identifier_conversion_views_unittest.cc index 79ce56e..43c7f76 100644 --- a/chrome/browser/extensions/key_identifier_conversion_views_unittest.cc +++ b/chrome/browser/extensions/key_identifier_conversion_views_unittest.cc @@ -23,40 +23,40 @@ class KeyEventFromKeyIdentifierTest : public testing::Test { }; TEST_F(KeyEventFromKeyIdentifierTest, MatchOnIdentifier) { - EXPECT_EQ(ui::VKEY_APPS, KeyEventFromKeyIdentifier("Apps").GetKeyCode()); + EXPECT_EQ(ui::VKEY_APPS, KeyEventFromKeyIdentifier("Apps").key_code()); EXPECT_EQ(ui::VKEY_UNKNOWN, - KeyEventFromKeyIdentifier("Nonsense").GetKeyCode()); + KeyEventFromKeyIdentifier("Nonsense").key_code()); } TEST_F(KeyEventFromKeyIdentifierTest, MatchOnCharacter) { - EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("a").GetKeyCode()); - EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("A").GetKeyCode()); - EXPECT_EQ(ui::VKEY_OEM_PERIOD, KeyEventFromKeyIdentifier(">").GetKeyCode()); + EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("a").key_code()); + EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("A").key_code()); + EXPECT_EQ(ui::VKEY_OEM_PERIOD, KeyEventFromKeyIdentifier(">").key_code()); std::string non_printing_char(" "); non_printing_char[0] = static_cast<char>(1); EXPECT_EQ(ui::VKEY_UNKNOWN, - KeyEventFromKeyIdentifier(non_printing_char).GetKeyCode()); + KeyEventFromKeyIdentifier(non_printing_char).key_code()); } TEST_F(KeyEventFromKeyIdentifierTest, MatchOnUnicodeCodepoint) { - EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("U+0041").GetKeyCode()); - EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("U+0061").GetKeyCode()); - EXPECT_EQ(ui::VKEY_DELETE, KeyEventFromKeyIdentifier("U+007F").GetKeyCode()); + EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("U+0041").key_code()); + EXPECT_EQ(ui::VKEY_A, KeyEventFromKeyIdentifier("U+0061").key_code()); + EXPECT_EQ(ui::VKEY_DELETE, KeyEventFromKeyIdentifier("U+007F").key_code()); // this one exists in the map, but has no valid ui::VKEY - EXPECT_EQ(ui::VKEY_UNKNOWN, KeyEventFromKeyIdentifier("U+030A").GetKeyCode()); + EXPECT_EQ(ui::VKEY_UNKNOWN, KeyEventFromKeyIdentifier("U+030A").key_code()); // this one is not in the map - EXPECT_EQ(ui::VKEY_UNKNOWN, KeyEventFromKeyIdentifier("U+0001").GetKeyCode()); + EXPECT_EQ(ui::VKEY_UNKNOWN, KeyEventFromKeyIdentifier("U+0001").key_code()); } TEST_F(KeyEventFromKeyIdentifierTest, DoesNotMatchEmptyString) { - EXPECT_EQ(ui::VKEY_UNKNOWN, KeyEventFromKeyIdentifier("").GetKeyCode()); + EXPECT_EQ(ui::VKEY_UNKNOWN, KeyEventFromKeyIdentifier("").key_code()); } TEST_F(KeyEventFromKeyIdentifierTest, ShiftModifiersAreSet) { - EXPECT_EQ(0, KeyEventFromKeyIdentifier("1").GetFlags()); + EXPECT_EQ(0, KeyEventFromKeyIdentifier("1").flags()); const char* keys_with_shift[] = { "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", @@ -65,8 +65,8 @@ TEST_F(KeyEventFromKeyIdentifierTest, ShiftModifiersAreSet) { int kNumKeysWithShift = arraysize(keys_with_shift); for (int i = 0; i < kNumKeysWithShift; ++i) { - EXPECT_EQ(views::Event::EF_SHIFT_DOWN, - KeyEventFromKeyIdentifier(keys_with_shift[i]).GetFlags()); + EXPECT_EQ(ui::EF_SHIFT_DOWN, + KeyEventFromKeyIdentifier(keys_with_shift[i]).flags()); } } diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc index 55d33bb..904ba86 100644 --- a/chrome/browser/history/redirect_uitest.cc +++ b/chrome/browser/history/redirect_uitest.cc @@ -22,7 +22,7 @@ #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" #include "net/test/test_server.h" -#include "views/events/event.h" +#include "ui/base/events.h" namespace { @@ -165,9 +165,8 @@ TEST_F(RedirectTest, MAYBE_ClientCancelled) { ASSERT_TRUE(browser->BringToFront()); ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, &tab_view_bounds, true)); - ASSERT_TRUE( - window->SimulateOSClick(tab_view_bounds.CenterPoint(), - views::Event::EF_LEFT_BUTTON_DOWN)); + ASSERT_TRUE(window->SimulateOSClick(tab_view_bounds.CenterPoint(), + ui::EF_LEFT_BUTTON_DOWN)); EXPECT_TRUE(tab_proxy->WaitForNavigation(last_nav_time)); std::vector<GURL> redirects; diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc index 0e1df3d..77955d0 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -60,13 +60,13 @@ int WebInputEventFlagsFromViewsEvent(const views::Event& event) { WebKit::WebTouchPoint::State TouchPointStateFromEvent( const views::TouchEvent* event) { switch (event->GetType()) { - case views::Event::ET_TOUCH_PRESSED: + case ui::ET_TOUCH_PRESSED: return WebKit::WebTouchPoint::StatePressed; - case views::Event::ET_TOUCH_RELEASED: + case ui::ET_TOUCH_RELEASED: return WebKit::WebTouchPoint::StateReleased; - case views::Event::ET_TOUCH_MOVED: + case ui::ET_TOUCH_MOVED: return WebKit::WebTouchPoint::StateMoved; - case views::Event::ET_TOUCH_CANCELLED: + case ui::ET_TOUCH_CANCELLED: return WebKit::WebTouchPoint::StateCancelled; default: return WebKit::WebTouchPoint::StateUndefined; @@ -76,13 +76,13 @@ WebKit::WebTouchPoint::State TouchPointStateFromEvent( WebKit::WebInputEvent::Type TouchEventTypeFromEvent( const views::TouchEvent* event) { switch (event->GetType()) { - case views::Event::ET_TOUCH_PRESSED: + case ui::ET_TOUCH_PRESSED: return WebKit::WebInputEvent::TouchStart; - case views::Event::ET_TOUCH_RELEASED: + case ui::ET_TOUCH_RELEASED: return WebKit::WebInputEvent::TouchEnd; - case views::Event::ET_TOUCH_MOVED: + case ui::ET_TOUCH_MOVED: return WebKit::WebInputEvent::TouchMove; - case views::Event::ET_TOUCH_CANCELLED: + case ui::ET_TOUCH_CANCELLED: return WebKit::WebInputEvent::TouchCancel; default: return WebKit::WebInputEvent::Undefined; @@ -446,7 +446,7 @@ void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) { } gfx::NativeCursor RenderWidgetHostViewViews::GetCursorForPoint( - views::Event::EventType type, const gfx::Point& point) { + ui::EventType type, const gfx::Point& point) { return native_cursor_; } @@ -684,7 +684,7 @@ views::View::TouchStatus RenderWidgetHostViewViews::OnTouchEvent( TouchStatus status = TOUCH_STATUS_UNKNOWN; switch (e.GetType()) { - case views::Event::ET_TOUCH_PRESSED: + case ui::ET_TOUCH_PRESSED: // Add a new touch point. if (touch_event_.touchPointsLength < WebTouchEvent::touchPointsLengthCap) { @@ -700,9 +700,9 @@ views::View::TouchStatus RenderWidgetHostViewViews::OnTouchEvent( } } break; - case views::Event::ET_TOUCH_RELEASED: - case views::Event::ET_TOUCH_CANCELLED: - case views::Event::ET_TOUCH_MOVED: { + case ui::ET_TOUCH_RELEASED: + case ui::ET_TOUCH_CANCELLED: + case ui::ET_TOUCH_MOVED: { // The touch point should have been added to the event from an earlier // _PRESSED event. So find that. // At the moment, only a maximum of 4 touch-points are allowed. So a @@ -755,7 +755,7 @@ views::View::TouchStatus RenderWidgetHostViewViews::OnTouchEvent( host_->ForwardTouchEvent(touch_event_); // If the touch was released, then remove it from the list of touch points. - if (e.GetType() == views::Event::ET_TOUCH_RELEASED) { + if (e.GetType() == ui::ET_TOUCH_RELEASED) { --touch_event_.touchPointsLength; for (int i = point - touch_event_.touchPoints; i < touch_event_.touchPointsLength; @@ -764,7 +764,7 @@ views::View::TouchStatus RenderWidgetHostViewViews::OnTouchEvent( } if (touch_event_.touchPointsLength == 0) status = TOUCH_STATUS_END; - } else if (e.GetType() == views::Event::ET_TOUCH_CANCELLED) { + } else if (e.GetType() == ui::ET_TOUCH_CANCELLED) { status = TOUCH_STATUS_CANCEL; } diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.h b/chrome/browser/renderer_host/render_widget_host_view_views.h index 064a21e..4451196 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.h +++ b/chrome/browser/renderer_host/render_widget_host_view_views.h @@ -88,7 +88,7 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView, // Overridden from views::View. virtual std::string GetClassName() const; - gfx::NativeCursor GetCursorForPoint(views::Event::EventType type, + gfx::NativeCursor GetCursorForPoint(ui::EventType type, const gfx::Point& point); // Views mouse events, overridden from views::View. diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc index d0d9510..af27fec 100644 --- a/chrome/browser/ui/views/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmark_bar_view.cc @@ -193,12 +193,12 @@ class BookmarkFolderButton : public views::MenuButton { virtual bool IsTriggerableEvent(const views::MouseEvent& e) { // Left clicks should show the menu contents and right clicks should show // the context menu. They should not trigger the opening of underlying urls. - if (e.GetFlags() == views::MouseEvent::EF_LEFT_BUTTON_DOWN || - e.GetFlags() == views::MouseEvent::EF_RIGHT_BUTTON_DOWN) + if (e.flags() == ui::EF_LEFT_BUTTON_DOWN || + e.flags() == ui::EF_RIGHT_BUTTON_DOWN) return false; WindowOpenDisposition disposition( - event_utils::DispositionFromEventFlags(e.GetFlags())); + event_utils::DispositionFromEventFlags(e.flags())); return disposition != CURRENT_TAB; } @@ -1402,9 +1402,8 @@ int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event, int ops = data.GetFirstNode(profile_) ? ui::DragDropTypes::DRAG_MOVE : ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK; - return - bookmark_utils::PreferredDropOperation(event.GetSourceOperations(), - ops); + return bookmark_utils::PreferredDropOperation(event.source_operations(), + ops); } for (int i = 0; i < GetBookmarkButtonCount() && diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc index 8a2b9a1..77ecd07 100644 --- a/chrome/browser/ui/views/browser_actions_container.cc +++ b/chrome/browser/ui/views/browser_actions_container.cc @@ -699,7 +699,7 @@ void BrowserActionsContainer::OnDragExited() { int BrowserActionsContainer::OnPerformDrop( const views::DropTargetEvent& event) { BrowserActionDragData data; - if (!data.Read(event.GetData())) + if (!data.Read(event.data())) return ui::DragDropTypes::DRAG_NONE; // Make sure we have the same view as we started with. diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index c2b93d7..1fa8a2f 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc @@ -57,9 +57,8 @@ class ContentSettingBubbleContents::Favicon : public views::ImageView { // views::View overrides: virtual bool OnMousePressed(const views::MouseEvent& event); virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); - virtual gfx::NativeCursor GetCursorForPoint( - views::Event::EventType event_type, - const gfx::Point& p); + virtual gfx::NativeCursor GetCursorForPoint(ui::EventType event_type, + const gfx::Point& p); ContentSettingBubbleContents* parent_; views::Link* link_; @@ -92,11 +91,11 @@ void ContentSettingBubbleContents::Favicon::OnMouseReleased( if (!canceled && (event.IsLeftMouseButton() || event.IsMiddleMouseButton()) && HitTest(event.location())) - parent_->LinkActivated(link_, event.GetFlags()); + parent_->LinkActivated(link_, event.flags()); } gfx::NativeCursor ContentSettingBubbleContents::Favicon::GetCursorForPoint( - views::Event::EventType event_type, + ui::EventType event_type, const gfx::Point& p) { #if defined(OS_WIN) if (!g_hand_cursor) diff --git a/chrome/browser/ui/views/download_item_view.cc b/chrome/browser/ui/views/download_item_view.cc index ff2d44f..92f5c341 100644 --- a/chrome/browser/ui/views/download_item_view.cc +++ b/chrome/browser/ui/views/download_item_view.cc @@ -876,8 +876,7 @@ bool DownloadItemView::OnKeyPressed(const views::KeyEvent& e) { if (IsDangerousMode()) return true; - if (e.GetKeyCode() == ui::VKEY_SPACE || - e.GetKeyCode() == ui::VKEY_RETURN) { + if (e.key_code() == ui::VKEY_SPACE || e.key_code() == ui::VKEY_RETURN) { OpenDownload(); return true; } diff --git a/chrome/browser/ui/views/dropdown_bar_host_win.cc b/chrome/browser/ui/views/dropdown_bar_host_win.cc index f08db1d..0f0ce6a 100644 --- a/chrome/browser/ui/views/dropdown_bar_host_win.cc +++ b/chrome/browser/ui/views/dropdown_bar_host_win.cc @@ -17,7 +17,7 @@ NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( const TabContents* contents, const views::KeyEvent& key_event) { HWND hwnd = contents->GetContentNativeView(); - WORD key = WindowsKeyCodeForKeyboardCode(key_event.GetKeyCode()); + WORD key = WindowsKeyCodeForKeyboardCode(key_event.key_code()); return NativeWebKeyboardEvent(hwnd, key_event.message(), key, 0); } diff --git a/chrome/browser/ui/views/event_utils.cc b/chrome/browser/ui/views/event_utils.cc index 2677f19..8c59c51 100644 --- a/chrome/browser/ui/views/event_utils.cc +++ b/chrome/browser/ui/views/event_utils.cc @@ -11,15 +11,15 @@ using views::Event; namespace event_utils { WindowOpenDisposition DispositionFromEventFlags(int event_flags) { - if (((event_flags & Event::EF_MIDDLE_BUTTON_DOWN) == - Event::EF_MIDDLE_BUTTON_DOWN) || - ((event_flags & Event::EF_CONTROL_DOWN) == - Event::EF_CONTROL_DOWN)) { - return ((event_flags & Event::EF_SHIFT_DOWN) == Event::EF_SHIFT_DOWN) ? + if (((event_flags & ui::EF_MIDDLE_BUTTON_DOWN) == + ui::EF_MIDDLE_BUTTON_DOWN) || + ((event_flags & ui::EF_CONTROL_DOWN) == + ui::EF_CONTROL_DOWN)) { + return ((event_flags & ui::EF_SHIFT_DOWN) == ui::EF_SHIFT_DOWN) ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; } - if ((event_flags & Event::EF_SHIFT_DOWN) == Event::EF_SHIFT_DOWN) + if ((event_flags & ui::EF_SHIFT_DOWN) == ui::EF_SHIFT_DOWN) return NEW_WINDOW; return false /*event.IsAltDown()*/ ? SAVE_TO_DISK : CURRENT_TAB; } diff --git a/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc b/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc index 3c6260d..549017d 100644 --- a/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc +++ b/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc @@ -148,7 +148,7 @@ int BrowserActionOverflowMenuController::GetDropOperation( // (because we don't shrink the BrowserActionContainer when you do this). if ((item->GetCommand() == 0) && (*position == DROP_BEFORE)) { BrowserActionDragData drop_data; - if (!drop_data.Read(event.GetData())) + if (!drop_data.Read(event.data())) return ui::DragDropTypes::DRAG_NONE; if (drop_data.index() < owner_->VisibleBrowserActions()) @@ -163,7 +163,7 @@ int BrowserActionOverflowMenuController::OnPerformDrop( DropPosition position, const views::DropTargetEvent& event) { BrowserActionDragData drop_data; - if (!drop_data.Read(event.GetData())) + if (!drop_data.Read(event.data())) return ui::DragDropTypes::DRAG_NONE; size_t drop_index; diff --git a/chrome/browser/ui/views/extensions/extension_view.cc b/chrome/browser/ui/views/extensions/extension_view.cc index 077f4cd..811f12e 100644 --- a/chrome/browser/ui/views/extensions/extension_view.cc +++ b/chrome/browser/ui/views/extensions/extension_view.cc @@ -177,7 +177,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() == ui::VKEY_TAB); + return (e.key_code() == ui::VKEY_TAB); } void ExtensionView::HandleMouseMove() { diff --git a/chrome/browser/ui/views/find_bar_host.cc b/chrome/browser/ui/views/find_bar_host.cc index a253f8f..c1eac91 100644 --- a/chrome/browser/ui/views/find_bar_host.cc +++ b/chrome/browser/ui/views/find_bar_host.cc @@ -49,7 +49,7 @@ bool FindBarHost::MaybeForwardKeyEventToWebpage( return false; } - switch (key_event.GetKeyCode()) { + switch (key_event.key_code()) { case ui::VKEY_DOWN: case ui::VKEY_UP: case ui::VKEY_PRIOR: diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 92e5619..87a7abd 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc @@ -514,7 +514,7 @@ bool FindBarView::HandleKeyEvent(views::Textfield* sender, if (find_bar_host()->MaybeForwardKeyEventToWebpage(key_event)) return true; // Handled, we are done! - if (key_event.GetKeyCode() == ui::VKEY_RETURN) { + if (key_event.key_code() == ui::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/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc index 0eb38e3..bba2945 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.cc +++ b/chrome/browser/ui/views/frame/browser_root_view.cc @@ -56,7 +56,7 @@ void BrowserRootView::OnDragEntered(const views::DropTargetEvent& event) { if (ShouldForwardToTabStrip(event)) { forwarding_to_tab_strip_ = true; scoped_ptr<views::DropTargetEvent> mapped_event( - MapEventToTabStrip(event, event.GetData())); + MapEventToTabStrip(event, event.data())); tabstrip()->OnDragEntered(*mapped_event.get()); } } @@ -64,7 +64,7 @@ void BrowserRootView::OnDragEntered(const views::DropTargetEvent& event) { int BrowserRootView::OnDragUpdated(const views::DropTargetEvent& event) { if (ShouldForwardToTabStrip(event)) { scoped_ptr<views::DropTargetEvent> mapped_event( - MapEventToTabStrip(event, event.GetData())); + MapEventToTabStrip(event, event.data())); if (!forwarding_to_tab_strip_) { tabstrip()->OnDragEntered(*mapped_event.get()); forwarding_to_tab_strip_ = true; @@ -94,9 +94,9 @@ int BrowserRootView::OnPerformDrop(const views::DropTargetEvent& event) { GURL url; std::wstring title; ui::OSExchangeData mapped_data; - if (!event.GetData().GetURLAndTitle(&url, &title) || !url.is_valid()) { + if (!event.data().GetURLAndTitle(&url, &title) || !url.is_valid()) { // The url isn't valid. Use the paste and go url. - if (GetPasteAndGoURL(event.GetData(), &url)) + if (GetPasteAndGoURL(event.data(), &url)) mapped_data.SetURL(url, std::wstring()); // else case: couldn't extract a url or 'paste and go' url. This ends up // passing through an ui::OSExchangeData with nothing in it. We need to do @@ -129,7 +129,7 @@ views::DropTargetEvent* BrowserRootView::MapEventToTabStrip( ConvertPointToView(this, tabstrip(), &tab_strip_loc); return new views::DropTargetEvent(data, tab_strip_loc.x(), tab_strip_loc.y(), - event.GetSourceOperations()); + event.source_operations()); } BaseTabStrip* BrowserRootView::tabstrip() const { diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index a4ab18c..3f34a24 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -1258,7 +1258,7 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, // it'll be best if we can unify these conversion tables. // See http://crbug.com/54315 views::KeyEvent views_event(event.os_event); - views::Accelerator accelerator(views_event.GetKeyCode(), + views::Accelerator accelerator(views_event.key_code(), views_event.IsShiftDown(), views_event.IsControlDown(), views_event.IsAltDown()); diff --git a/chrome/browser/ui/views/keyword_editor_view.cc b/chrome/browser/ui/views/keyword_editor_view.cc index 38c7d30..d4ea968 100644 --- a/chrome/browser/ui/views/keyword_editor_view.cc +++ b/chrome/browser/ui/views/keyword_editor_view.cc @@ -258,9 +258,9 @@ void KeywordEditorView::OnDoubleClick() { if (edit_button_->IsEnabled()) { DWORD pos = GetMessagePos(); gfx::Point cursor_point(pos); - views::MouseEvent event(views::Event::ET_MOUSE_RELEASED, + views::MouseEvent event(ui::ET_MOUSE_RELEASED, cursor_point.x(), cursor_point.y(), - views::Event::EF_LEFT_BUTTON_DOWN); + ui::EF_LEFT_BUTTON_DOWN); ButtonPressed(edit_button_, event); } } diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index 6634354..8254948 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -697,13 +697,13 @@ void LocationBarView::SelectAll() { bool LocationBarView::OnMousePressed(const views::MouseEvent& event) { UINT msg; if (event.IsLeftMouseButton()) { - msg = (event.GetFlags() & views::MouseEvent::EF_IS_DOUBLE_CLICK) ? + msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? WM_LBUTTONDBLCLK : WM_LBUTTONDOWN; } else if (event.IsMiddleMouseButton()) { - msg = (event.GetFlags() & views::MouseEvent::EF_IS_DOUBLE_CLICK) ? + msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? WM_MBUTTONDBLCLK : WM_MBUTTONDOWN; } else if (event.IsRightMouseButton()) { - msg = (event.GetFlags() & views::MouseEvent::EF_IS_DOUBLE_CLICK) ? + msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? WM_RBUTTONDBLCLK : WM_RBUTTONDOWN; } else { NOTREACHED(); diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.cc b/chrome/browser/ui/views/location_bar/page_action_image_view.cc index e867091..bcfe51a 100644 --- a/chrome/browser/ui/views/location_bar/page_action_image_view.cc +++ b/chrome/browser/ui/views/location_bar/page_action_image_view.cc @@ -140,8 +140,7 @@ void PageActionImageView::OnMouseReleased(const views::MouseEvent& event, } bool PageActionImageView::OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_SPACE || - e.GetKeyCode() == ui::VKEY_RETURN) { + if (e.key_code() == ui::VKEY_SPACE || e.key_code() == ui::VKEY_RETURN) { ExecuteAction(1, false); return true; } diff --git a/chrome/browser/ui/views/location_bar/star_view.cc b/chrome/browser/ui/views/location_bar/star_view.cc index c7bacbeb..886aec2 100644 --- a/chrome/browser/ui/views/location_bar/star_view.cc +++ b/chrome/browser/ui/views/location_bar/star_view.cc @@ -59,8 +59,7 @@ void StarView::OnMouseReleased(const views::MouseEvent& event, bool canceled) { } bool StarView::OnKeyPressed(const views::KeyEvent& e) { - if (e.GetKeyCode() == ui::VKEY_SPACE || - e.GetKeyCode() == ui::VKEY_RETURN) { + if (e.key_code() == ui::VKEY_SPACE || e.key_code() == ui::VKEY_RETURN) { command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); return true; } diff --git a/chrome/browser/ui/views/options/cookies_view.cc b/chrome/browser/ui/views/options/cookies_view.cc index 83040e5..5b9c9e3 100644 --- a/chrome/browser/ui/views/options/cookies_view.cc +++ b/chrome/browser/ui/views/options/cookies_view.cc @@ -145,9 +145,9 @@ void CookiesView::ContentsChanged(views::Textfield* sender, bool CookiesView::HandleKeyEvent(views::Textfield* sender, const views::KeyEvent& key_event) { - if (key_event.GetKeyCode() == ui::VKEY_ESCAPE) { + if (key_event.key_code() == ui::VKEY_ESCAPE) { ResetSearchQuery(); - } else if (key_event.GetKeyCode() == ui::VKEY_RETURN) { + } else if (key_event.key_code() == ui::VKEY_RETURN) { search_update_factory_.RevokeAll(); UpdateSearchResults(); } diff --git a/chrome/browser/ui/views/reload_button.cc b/chrome/browser/ui/views/reload_button.cc index 80a469a..4189dd1 100644 --- a/chrome/browser/ui/views/reload_button.cc +++ b/chrome/browser/ui/views/reload_button.cc @@ -83,7 +83,7 @@ void ReloadButton::ButtonPressed(views::Button* /* button */, if (event.IsShiftDown() || event.IsControlDown()) { command = IDC_RELOAD_IGNORING_CACHE; // Mask off Shift and Control so they don't affect the disposition below. - flags &= ~(views::Event::EF_SHIFT_DOWN | views::Event::EF_CONTROL_DOWN); + flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); } else { command = IDC_RELOAD; } diff --git a/chrome/browser/ui/views/reload_button_unittest.cc b/chrome/browser/ui/views/reload_button_unittest.cc index db0d616..2f1aab00 100644 --- a/chrome/browser/ui/views/reload_button_unittest.cc +++ b/chrome/browser/ui/views/reload_button_unittest.cc @@ -57,7 +57,7 @@ TEST_F(ReloadButtonTest, Basic) { false); // Press the button. This should start the double-click timer. - views::MouseEvent e(views::Event::ET_MOUSE_PRESSED, 0, 0, 0); + views::MouseEvent e(ui::ET_MOUSE_PRESSED, 0, 0, 0); reload_.ButtonPressed(&reload_, e); CheckState(true, ReloadButton::MODE_RELOAD, ReloadButton::MODE_RELOAD, true, false); @@ -76,7 +76,7 @@ TEST_F(ReloadButtonTest, Basic) { TEST_F(ReloadButtonTest, DoubleClickTimer) { // Start by pressing the button. - views::MouseEvent e(views::Event::ET_MOUSE_PRESSED, 0, 0, 0); + views::MouseEvent e(ui::ET_MOUSE_PRESSED, 0, 0, 0); reload_.ButtonPressed(&reload_, e); // Try to press the button again. This should do nothing because the timer is @@ -102,7 +102,7 @@ TEST_F(ReloadButtonTest, DoubleClickTimer) { TEST_F(ReloadButtonTest, DisableOnHover) { // Change to stop and hover. - views::MouseEvent e(views::Event::ET_MOUSE_PRESSED, 0, 0, 0); + views::MouseEvent e(ui::ET_MOUSE_PRESSED, 0, 0, 0); reload_.ButtonPressed(&reload_, e); reload_.ChangeMode(ReloadButton::MODE_STOP, false); set_mouse_hovered(true); @@ -115,7 +115,7 @@ TEST_F(ReloadButtonTest, DisableOnHover) { // Un-hover the button, which should allow it to reset. set_mouse_hovered(false); - views::MouseEvent e2(views::Event::ET_MOUSE_MOVED, 0, 0, 0); + views::MouseEvent e2(ui::ET_MOUSE_MOVED, 0, 0, 0); reload_.OnMouseExited(e2); CheckState(true, ReloadButton::MODE_RELOAD, ReloadButton::MODE_RELOAD, false, false); @@ -123,7 +123,7 @@ TEST_F(ReloadButtonTest, DisableOnHover) { TEST_F(ReloadButtonTest, ResetOnClick) { // Change to stop and hover. - views::MouseEvent e(views::Event::ET_MOUSE_PRESSED, 0, 0, 0); + views::MouseEvent e(ui::ET_MOUSE_PRESSED, 0, 0, 0); reload_.ButtonPressed(&reload_, e); reload_.ChangeMode(ReloadButton::MODE_STOP, false); set_mouse_hovered(true); @@ -137,7 +137,7 @@ TEST_F(ReloadButtonTest, ResetOnClick) { TEST_F(ReloadButtonTest, ResetOnTimer) { // Change to stop, hover, and change back to reload. - views::MouseEvent e(views::Event::ET_MOUSE_PRESSED, 0, 0, 0); + views::MouseEvent e(ui::ET_MOUSE_PRESSED, 0, 0, 0); reload_.ButtonPressed(&reload_, e); reload_.ChangeMode(ReloadButton::MODE_STOP, false); set_mouse_hovered(true); diff --git a/chrome/browser/ui/views/tabs/tab_dragging_test.cc b/chrome/browser/ui/views/tabs/tab_dragging_test.cc index 5830deb..d39b3ff 100644 --- a/chrome/browser/ui/views/tabs/tab_dragging_test.cc +++ b/chrome/browser/ui/views/tabs/tab_dragging_test.cc @@ -134,7 +134,7 @@ TEST_F(TabDraggingTest, MAYBE_Tab1Tab2) { bounds1.y() + bounds1.height() / 2); gfx::Point end(start.x() + 2 * bounds1.width() / 3, start.y()); ASSERT_TRUE(browser->SimulateDrag(start, end, - views::Event::EF_LEFT_BUTTON_DOWN, + ui::EF_LEFT_BUTTON_DOWN, false)); // Now check for expected results. @@ -234,7 +234,7 @@ TEST_F(TabDraggingTest, MAYBE_Tab1Tab3) { bounds3.width() / 2, start.y()); ASSERT_TRUE(browser->SimulateDrag(start, end, - views::Event::EF_LEFT_BUTTON_DOWN, + ui::EF_LEFT_BUTTON_DOWN, false)); // Now check for expected results. @@ -344,7 +344,7 @@ TEST_F(TabDraggingTest, MAYBE_Tab1Tab3Escape) { // Simulate drag with 'true' as the last parameter. This will interrupt // in-flight with Escape. ASSERT_TRUE(browser->SimulateDrag(start, end, - views::Event::EF_LEFT_BUTTON_DOWN, + ui::EF_LEFT_BUTTON_DOWN, true)); // Now check for expected results. @@ -465,7 +465,7 @@ TEST_F(TabDraggingTest, MAYBE_Tab2OutOfTabStrip) { // Simulate tab drag. ASSERT_TRUE(browser->SimulateDrag(start, end, - views::Event::EF_LEFT_BUTTON_DOWN, + ui::EF_LEFT_BUTTON_DOWN, false)); // Now, first make sure that the old window has only two tabs remaining. diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index eca1ef9..84d7517 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -355,7 +355,7 @@ int TabStrip::OnPerformDrop(const DropTargetEvent& event) { GURL url; std::wstring title; - if (!event.GetData().GetURLAndTitle(&url, &title) || !url.is_valid()) + if (!event.data().GetURLAndTitle(&url, &title) || !url.is_valid()) return ui::DragDropTypes::DRAG_NONE; controller()->PerformDrop(drop_before, drop_index, url); @@ -758,7 +758,7 @@ void TabStrip::SetDropIndex(int tab_data_index, bool drop_before) { } int TabStrip::GetDropEffect(const views::DropTargetEvent& event) { - const int source_ops = event.GetSourceOperations(); + const int source_ops = event.source_operations(); if (source_ops & ui::DragDropTypes::DRAG_COPY) return ui::DragDropTypes::DRAG_COPY; if (source_ops & ui::DragDropTypes::DRAG_LINK) diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index c3aa37f..dde2083 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -146,8 +146,8 @@ void ToolbarView::Init(Profile* profile) { } #endif back_ = new views::ButtonDropDown(this, back_menu_model_.get()); - back_->set_triggerable_event_flags(views::Event::EF_LEFT_BUTTON_DOWN | - views::Event::EF_MIDDLE_BUTTON_DOWN); + back_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN | + ui::EF_MIDDLE_BUTTON_DOWN); back_->set_tag(IDC_BACK); back_->SetImageAlignment(views::ImageButton::ALIGN_RIGHT, views::ImageButton::ALIGN_TOP); @@ -157,8 +157,8 @@ void ToolbarView::Init(Profile* profile) { back_->SetID(VIEW_ID_BACK_BUTTON); forward_ = new views::ButtonDropDown(this, forward_menu_model_.get()); - forward_->set_triggerable_event_flags(views::Event::EF_LEFT_BUTTON_DOWN | - views::Event::EF_MIDDLE_BUTTON_DOWN); + forward_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN | + ui::EF_MIDDLE_BUTTON_DOWN); forward_->set_tag(IDC_FORWARD); forward_->SetTooltipText( UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD))); @@ -171,8 +171,8 @@ void ToolbarView::Init(Profile* profile) { LocationBarView::POPUP : LocationBarView::NORMAL); reload_ = new ReloadButton(location_bar_, browser_); - reload_->set_triggerable_event_flags(views::Event::EF_LEFT_BUTTON_DOWN | - views::Event::EF_MIDDLE_BUTTON_DOWN); + reload_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN | + ui::EF_MIDDLE_BUTTON_DOWN); reload_->set_tag(IDC_RELOAD); reload_->SetTooltipText( UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD))); @@ -182,8 +182,8 @@ void ToolbarView::Init(Profile* profile) { #if defined(OS_CHROMEOS) feedback_ = new views::ImageButton(this); feedback_->set_tag(IDC_FEEDBACK); - feedback_->set_triggerable_event_flags(views::Event::EF_LEFT_BUTTON_DOWN | - views::Event::EF_MIDDLE_BUTTON_DOWN); + feedback_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN | + ui::EF_MIDDLE_BUTTON_DOWN); feedback_->set_tag(IDC_FEEDBACK); feedback_->SetTooltipText( UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_FEEDBACK))); @@ -191,8 +191,8 @@ void ToolbarView::Init(Profile* profile) { #endif home_ = new views::ImageButton(this); - home_->set_triggerable_event_flags(views::Event::EF_LEFT_BUTTON_DOWN | - views::Event::EF_MIDDLE_BUTTON_DOWN); + home_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN | + ui::EF_MIDDLE_BUTTON_DOWN); home_->set_tag(IDC_HOME); home_->SetTooltipText( UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME))); diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc index ed32d6c..84f0e4f 100644 --- a/chrome/browser/unload_uitest.cc +++ b/chrome/browser/unload_uitest.cc @@ -12,8 +12,8 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/url_request/url_request_test_util.h" +#include "ui/base/events.h" #include "ui/base/message_box_flags.h" -#include "views/events/event.h" const std::string NOLISTENERS_HTML = "<html><head><title>nolisteners</title></head><body></body></html>"; @@ -245,7 +245,7 @@ TEST_F(UnloadTest, MAYBE_CrossSiteInfiniteUnloadAsyncInputEvent) { gfx::Rect bounds; ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_0, &bounds, false)); ASSERT_TRUE(browser->SimulateDrag(bounds.CenterPoint(), bounds.CenterPoint(), - views::Event::EF_LEFT_BUTTON_DOWN, false)); + ui::EF_LEFT_BUTTON_DOWN, false)); // The title should update before the timeout in CheckTitle. CheckTitle(L"Title Of Awesomeness"); @@ -437,7 +437,7 @@ TEST_F(UnloadTest, MAYBE_BrowserCloseTabWhenOtherTabHasListener) { // Simulate a click to force user_gesture to true; if we don't, the resulting // popup will be constrained, which isn't what we want to test. ASSERT_TRUE(window->SimulateOSClick(tab_view_bounds.CenterPoint(), - views::Event::EF_LEFT_BUTTON_DOWN)); + ui::EF_LEFT_BUTTON_DOWN)); ASSERT_TRUE(browser->WaitForTabCountToBecome(2)); scoped_refptr<TabProxy> popup_tab(browser->GetActiveTab()); diff --git a/chrome/test/automated_ui_tests/automated_ui_test_base.cc b/chrome/test/automated_ui_tests/automated_ui_test_base.cc index f5cad88..e282256 100644 --- a/chrome/test/automated_ui_tests/automated_ui_test_base.cc +++ b/chrome/test/automated_ui_tests/automated_ui_test_base.cc @@ -10,9 +10,9 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" +#include "ui/base/events.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" -#include "views/events/event.h" AutomatedUITestBase::AutomatedUITestBase() {} @@ -139,8 +139,7 @@ bool AutomatedUITestBase::DragTabOut() { end.set_x(start.x()); end.set_y(start.y() + 3 * urlbar_bounds.height()); - if (!browser->SimulateDrag(start, end, views::Event::EF_LEFT_BUTTON_DOWN, - false)) { + if (!browser->SimulateDrag(start, end, ui::EF_LEFT_BUTTON_DOWN, false)) { LogWarningMessage("failed_to_simulate_drag"); return false; } @@ -208,7 +207,7 @@ bool AutomatedUITestBase::DragActiveTab(bool drag_right) { } if (!browser->SimulateDrag(dragged_tab_point, destination_point, - views::Event::EF_LEFT_BUTTON_DOWN, false)) { + ui::EF_LEFT_BUTTON_DOWN, false)) { LogWarningMessage("failed_to_simulate_drag"); return false; } diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index 9286459..cd34c8f 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -43,7 +43,6 @@ #include "ui/base/ui_base_switches.h" #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/rect.h" -#include "views/events/event.h" using ui_test_utils::TimedMessageLoopRunner; using testing::CreateFunctor; @@ -191,8 +190,7 @@ TEST_F(AutomationProxyVisibleTest, MAYBE_WindowGetViewBounds) { start.y = bounds.y() + bounds.height() / 2; end.x = start.x + 2 * bounds.width() / 3; end.y = start.y; - ASSERT_TRUE(browser->SimulateDrag(start, end, - views::Event::EF_LEFT_BUTTON_DOWN)); + ASSERT_TRUE(browser->SimulateDrag(start, end, ui::EF_LEFT_BUTTON_DOWN)); // Check to see that the drag event successfully swapped the two tabs. tab1 = browser->GetTab(0); diff --git a/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc b/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc index c14cbd3..15a0ab8 100644 --- a/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc +++ b/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc @@ -11,9 +11,9 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" #include "chrome/test/ui_test_utils.h" +#include "ui/base/events.h" #include "ui/base/message_box_flags.h" #include "ui/gfx/rect.h" -#include "views/events/event.h" class FastShutdown : public UITest { }; @@ -42,7 +42,7 @@ TEST_F(FastShutdown, MAYBE_SlowTermination) { ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, &bounds, true)); // This click will launch a popup which has a before unload handler. ASSERT_TRUE(window->SimulateOSClick(bounds.CenterPoint(), - views::Event::EF_LEFT_BUTTON_DOWN)); + ui::EF_LEFT_BUTTON_DOWN)); ASSERT_TRUE(browser->WaitForTabCountToBecome(2)); // Close the tab, removing the one and only before unload handler. scoped_refptr<TabProxy> tab(browser->GetTab(1)); diff --git a/chrome/test/interactive_ui/keyboard_access_uitest.cc b/chrome/test/interactive_ui/keyboard_access_uitest.cc index 8bf28d0..5a9e089 100644 --- a/chrome/test/interactive_ui/keyboard_access_uitest.cc +++ b/chrome/test/interactive_ui/keyboard_access_uitest.cc @@ -8,8 +8,8 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" #include "googleurl/src/gurl.h" +#include "ui/base/events.h" #include "ui/base/keycodes/keyboard_codes.h" -#include "views/events/event.h" // This functionality currently works on Windows and on Linux when // toolkit_views is defined (i.e. for Chrome OS). It's not needed @@ -118,7 +118,7 @@ TEST_F(KeyboardAccessTest, DISABLED_TestAltMenuKeyboardAccess) { // Flaky, http://crbug.com/62311. TEST_F(KeyboardAccessTest, FLAKY_TestShiftAltMenuKeyboardAccess) { - TestMenuKeyboardAccess(true, views::Event::EF_SHIFT_DOWN); + TestMenuKeyboardAccess(true, ui::EF_SHIFT_DOWN); } #if defined(OS_CHROMEOS) @@ -154,14 +154,13 @@ TEST_F(KeyboardAccessTest, MAYBE_ReserveKeyboardAccelerators) { scoped_refptr<WindowProxy> window(browser->GetWindow()); ASSERT_TRUE(window); ASSERT_TRUE(window->SimulateOSKeyPress( - ui::VKEY_TAB, views::Event::EF_CONTROL_DOWN)); + ui::VKEY_TAB, ui::EF_CONTROL_DOWN)); ASSERT_TRUE(browser->WaitForTabToBecomeActive( 0, TestTimeouts::action_max_timeout_ms())); #if !defined(OS_MACOSX) // see BrowserWindowCocoa::GetCommandId ASSERT_TRUE(browser->ActivateTab(1)); - ASSERT_TRUE(window->SimulateOSKeyPress( - ui::VKEY_F4, views::Event::EF_CONTROL_DOWN)); + ASSERT_TRUE(window->SimulateOSKeyPress(ui::VKEY_F4, ui::EF_CONTROL_DOWN)); ASSERT_TRUE(browser->WaitForTabCountToBecome(1)); #endif } diff --git a/chrome/test/ui/history_uitest.cc b/chrome/test/ui/history_uitest.cc index d7d29f0..a7f0e14 100644 --- a/chrome/test/ui/history_uitest.cc +++ b/chrome/test/ui/history_uitest.cc @@ -12,8 +12,8 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" #include "chrome/test/ui_test_utils.h" +#include "ui/base/events.h" #include "ui/gfx/rect.h" -#include "views/events/event.h" namespace { @@ -109,9 +109,8 @@ TEST_F(HistoryTester, ConsiderRedirectAfterGestureAsUserInitiated) { gfx::Rect tab_view_bounds; ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER, &tab_view_bounds, true)); - ASSERT_TRUE( - window->SimulateOSClick(tab_view_bounds.CenterPoint(), - views::Event::EF_LEFT_BUTTON_DOWN)); + ASSERT_TRUE(window->SimulateOSClick(tab_view_bounds.CenterPoint(), + ui::EF_LEFT_BUTTON_DOWN)); NavigateToURL(GURL("javascript:redirectToPage12()")); WaitForFinish("History_Length_Test_12", "1", url, kTestCompleteCookie, diff --git a/chrome/test/webdriver/commands/webdriver_command.cc b/chrome/test/webdriver/commands/webdriver_command.cc index d1d0a73..cc0e471 100644 --- a/chrome/test/webdriver/commands/webdriver_command.cc +++ b/chrome/test/webdriver/commands/webdriver_command.cc @@ -19,7 +19,6 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" #include "chrome/test/webdriver/utility_functions.h" -#include "views/events/event.h" namespace webdriver { diff --git a/chrome/test/webdriver/keymap.cc b/chrome/test/webdriver/keymap.cc index c3080d7..91b0e07 100644 --- a/chrome/test/webdriver/keymap.cc +++ b/chrome/test/webdriver/keymap.cc @@ -5,7 +5,7 @@ #include "chrome/test/webdriver/keymap.h" #include "chrome/browser/automation/ui_controls.h" -#include "views/events/event.h" +#include "ui/base/events.h" namespace webdriver { @@ -147,17 +147,17 @@ bool KeyMap::Press(const scoped_refptr<WindowProxy>& window, int modifiers = 0; if (shift_ || shifted_keys_.find(key) != shifted_keys_.end()) { - modifiers = modifiers | views::Event::EF_SHIFT_DOWN; + modifiers = modifiers | ui::EF_SHIFT_DOWN; } if (control_) { - modifiers = modifiers | views::Event::EF_CONTROL_DOWN; + modifiers = modifiers | ui::EF_CONTROL_DOWN; } if (alt_) { - modifiers = modifiers | views::Event::EF_ALT_DOWN; + modifiers = modifiers | ui::EF_ALT_DOWN; } if (command_) { VLOG(1) << "Pressing command key on linux!!"; - modifiers = modifiers | views::Event::EF_COMMAND_DOWN; + modifiers = modifiers | ui::EF_COMMAND_DOWN; } // TODO(jmikhail): need to be able to capture modifier key up. |