diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 20:50:15 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 20:50:15 +0000 |
commit | 248d4db217127ba5d0decc9bd12696de0154f68f (patch) | |
tree | 76a910a80a8a4b2964766e498b469b1999403e0c /ui/app_list | |
parent | 7bdad1a4a53f98d31f00672cbfe2eaa81b95407d (diff) | |
download | chromium_src-248d4db217127ba5d0decc9bd12696de0154f68f.zip chromium_src-248d4db217127ba5d0decc9bd12696de0154f68f.tar.gz chromium_src-248d4db217127ba5d0decc9bd12696de0154f68f.tar.bz2 |
Remove views::KeyEvent, replacing uses of it with ui::KeyEvent.
http://crbug.com/125937
TEST=existing
TBR=jochen@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10825254
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list')
-rw-r--r-- | ui/app_list/app_list_view.cc | 3 | ||||
-rw-r--r-- | ui/app_list/app_list_view.h | 2 | ||||
-rw-r--r-- | ui/app_list/apps_grid_view.cc | 5 | ||||
-rw-r--r-- | ui/app_list/apps_grid_view.h | 4 | ||||
-rw-r--r-- | ui/app_list/contents_view.cc | 3 | ||||
-rw-r--r-- | ui/app_list/contents_view.h | 2 | ||||
-rw-r--r-- | ui/app_list/search_box_view.cc | 3 | ||||
-rw-r--r-- | ui/app_list/search_box_view.h | 2 | ||||
-rw-r--r-- | ui/app_list/search_result_list_view.cc | 12 | ||||
-rw-r--r-- | ui/app_list/search_result_list_view.h | 2 |
10 files changed, 24 insertions, 14 deletions
diff --git a/ui/app_list/app_list_view.cc b/ui/app_list/app_list_view.cc index c93adbd..077729e 100644 --- a/ui/app_list/app_list_view.cc +++ b/ui/app_list/app_list_view.cc @@ -12,6 +12,7 @@ #include "ui/app_list/pagination_model.h" #include "ui/app_list/search_box_model.h" #include "ui/app_list/search_box_view.h" +#include "ui/base/event.h" #include "ui/gfx/insets.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/textfield/textfield.h" @@ -129,7 +130,7 @@ void AppListView::GetHitTestMask(gfx::Path* mask) const { bubble_border_->GetMask(GetBubbleFrameView()->bounds(), mask); } -bool AppListView::OnKeyPressed(const views::KeyEvent& event) { +bool AppListView::OnKeyPressed(const ui::KeyEvent& event) { if (event.key_code() == ui::VKEY_ESCAPE) { Close(); return true; diff --git a/ui/app_list/app_list_view.h b/ui/app_list/app_list_view.h index 507dd63..3225a13 100644 --- a/ui/app_list/app_list_view.h +++ b/ui/app_list/app_list_view.h @@ -55,7 +55,7 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE; // Overridden from views::View: - virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; + virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; // Overridden from views::ButtonListener: virtual void ButtonPressed(views::Button* sender, diff --git a/ui/app_list/apps_grid_view.cc b/ui/app_list/apps_grid_view.cc index 45b3c4a..1de2b2f 100644 --- a/ui/app_list/apps_grid_view.cc +++ b/ui/app_list/apps_grid_view.cc @@ -8,6 +8,7 @@ #include "ui/app_list/app_list_item_view.h" #include "ui/app_list/pagination_model.h" +#include "ui/base/event.h" #include "ui/views/border.h" namespace { @@ -168,7 +169,7 @@ void AppsGridView::Layout() { } } -bool AppsGridView::OnKeyPressed(const views::KeyEvent& event) { +bool AppsGridView::OnKeyPressed(const ui::KeyEvent& event) { bool handled = false; if (selected_item_index_ >= 0) handled = GetItemViewAtIndex(selected_item_index_)->OnKeyPressed(event); @@ -217,7 +218,7 @@ bool AppsGridView::OnKeyPressed(const views::KeyEvent& event) { return handled; } -bool AppsGridView::OnKeyReleased(const views::KeyEvent& event) { +bool AppsGridView::OnKeyReleased(const ui::KeyEvent& event) { bool handled = false; if (selected_item_index_ >= 0) handled = GetItemViewAtIndex(selected_item_index_)->OnKeyReleased(event); diff --git a/ui/app_list/apps_grid_view.h b/ui/app_list/apps_grid_view.h index 0657a10..c611d2f 100644 --- a/ui/app_list/apps_grid_view.h +++ b/ui/app_list/apps_grid_view.h @@ -49,8 +49,8 @@ class APP_LIST_EXPORT AppsGridView : public views::View, // Overridden from views::View: virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void Layout() OVERRIDE; - virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; - virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE; + virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; + virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE; virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; private: diff --git a/ui/app_list/contents_view.cc b/ui/app_list/contents_view.cc index 2ad9887..72cfbac 100644 --- a/ui/app_list/contents_view.cc +++ b/ui/app_list/contents_view.cc @@ -11,6 +11,7 @@ #include "ui/app_list/page_switcher.h" #include "ui/app_list/pagination_model.h" #include "ui/app_list/search_result_list_view.h" +#include "ui/base/event.h" #include "ui/views/animation/bounds_animator.h" #include "ui/views/view_model.h" #include "ui/views/view_model_utils.h" @@ -220,7 +221,7 @@ ui::GestureStatus ContentsView::OnGestureEvent( return ui::GESTURE_STATUS_UNKNOWN; } -bool ContentsView::OnKeyPressed(const views::KeyEvent& event) { +bool ContentsView::OnKeyPressed(const ui::KeyEvent& event) { switch (show_state_) { case SHOW_APPS: return GetAppsGridView(view_model_.get())->OnKeyPressed(event); diff --git a/ui/app_list/contents_view.h b/ui/app_list/contents_view.h index 0e57c61..bfe9641 100644 --- a/ui/app_list/contents_view.h +++ b/ui/app_list/contents_view.h @@ -55,7 +55,7 @@ class ContentsView : public views::View { virtual void Layout() OVERRIDE; virtual ui::GestureStatus OnGestureEvent( const views::GestureEvent& event) OVERRIDE; - virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; + virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; virtual bool OnMouseWheel(const views::MouseWheelEvent& event) OVERRIDE; virtual bool OnScrollEvent(const views::ScrollEvent & event) OVERRIDE; diff --git a/ui/app_list/search_box_view.cc b/ui/app_list/search_box_view.cc index ab84d01..660d5de 100644 --- a/ui/app_list/search_box_view.cc +++ b/ui/app_list/search_box_view.cc @@ -8,6 +8,7 @@ #include "ui/app_list/search_box_model.h" #include "ui/app_list/search_box_view_delegate.h" +#include "ui/base/event.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/textfield/textfield.h" @@ -114,7 +115,7 @@ void SearchBoxView::ContentsChanged(views::Textfield* sender, } bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, - const views::KeyEvent& key_event) { + const ui::KeyEvent& key_event) { bool has_query = !search_box_->text().empty(); // Escape with non-empty query text clears the search box. diff --git a/ui/app_list/search_box_view.h b/ui/app_list/search_box_view.h index 10e4be2..0006917 100644 --- a/ui/app_list/search_box_view.h +++ b/ui/app_list/search_box_view.h @@ -56,7 +56,7 @@ class SearchBoxView : public views::View, virtual void ContentsChanged(views::Textfield* sender, const string16& new_contents) OVERRIDE; virtual bool HandleKeyEvent(views::Textfield* sender, - const views::KeyEvent& key_event) OVERRIDE; + const ui::KeyEvent& key_event) OVERRIDE; // Overridden from SearchBoxModelObserver: virtual void IconChanged() OVERRIDE; diff --git a/ui/app_list/search_result_list_view.cc b/ui/app_list/search_result_list_view.cc index 9d4f568..9e77cc5 100644 --- a/ui/app_list/search_result_list_view.cc +++ b/ui/app_list/search_result_list_view.cc @@ -10,6 +10,7 @@ #include "base/message_loop.h" #include "ui/app_list/search_result_view.h" #include "ui/app_list/search_result_list_view_delegate.h" +#include "ui/base/event.h" #include "ui/views/layout/box_layout.h" namespace { @@ -72,7 +73,7 @@ bool SearchResultListView::IsResultViewSelected( result_view; } -bool SearchResultListView::OnKeyPressed(const views::KeyEvent& event) { +bool SearchResultListView::OnKeyPressed(const ui::KeyEvent& event) { switch (event.key_code()) { case ui::VKEY_UP: SetSelectedIndex(std::max(selected_index_ - 1, 0)); @@ -81,8 +82,13 @@ bool SearchResultListView::OnKeyPressed(const views::KeyEvent& event) { SetSelectedIndex(std::min(selected_index_ + 1, last_visible_index_)); return true; case ui::VKEY_RETURN: - if (selected_index_ >= 0) - ButtonPressed(GetResultViewAt(selected_index_), event); + if (selected_index_ >= 0) { + // TODO(beng): remove once views::Event is gone. + views::MouseEvent synthetic_event( + ui::ET_MOUSE_RELEASED, 0, 0, + ui::EF_LEFT_MOUSE_BUTTON | event.flags()); + ButtonPressed(GetResultViewAt(selected_index_), synthetic_event); + } return true; default: break; diff --git a/ui/app_list/search_result_list_view.h b/ui/app_list/search_result_list_view.h index 1244609..c362c1a 100644 --- a/ui/app_list/search_result_list_view.h +++ b/ui/app_list/search_result_list_view.h @@ -33,7 +33,7 @@ class SearchResultListView : public views::View, bool IsResultViewSelected(const SearchResultView* result_view) const; // Overridden from views::View: - virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; + virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; private: // Helper function to get SearchResultView at given |index|. |