Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1215)

Side by Side Diff: ui/app_list/search_result_list_view.cc

Issue 10832282: Replace views::MouseEvent with ui::MouseEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_unittest.cc ('k') | ui/base/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/app_list/search_result_list_view.h" 5 #include "ui/app_list/search_result_list_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 bool SearchResultListView::OnKeyPressed(const ui::KeyEvent& event) { 76 bool SearchResultListView::OnKeyPressed(const ui::KeyEvent& event) {
77 switch (event.key_code()) { 77 switch (event.key_code()) {
78 case ui::VKEY_UP: 78 case ui::VKEY_UP:
79 SetSelectedIndex(std::max(selected_index_ - 1, 0)); 79 SetSelectedIndex(std::max(selected_index_ - 1, 0));
80 return true; 80 return true;
81 case ui::VKEY_DOWN: 81 case ui::VKEY_DOWN:
82 SetSelectedIndex(std::min(selected_index_ + 1, last_visible_index_)); 82 SetSelectedIndex(std::min(selected_index_ + 1, last_visible_index_));
83 return true; 83 return true;
84 case ui::VKEY_RETURN: 84 case ui::VKEY_RETURN:
85 if (selected_index_ >= 0) { 85 if (selected_index_ >= 0)
86 // TODO(beng): remove once views::Event is gone. 86 ButtonPressed(GetResultViewAt(selected_index_), event);
87 views::MouseEvent synthetic_event(
88 ui::ET_MOUSE_RELEASED, 0, 0,
89 ui::EF_LEFT_MOUSE_BUTTON | event.flags());
90 ButtonPressed(GetResultViewAt(selected_index_), synthetic_event);
91 }
92 return true; 87 return true;
93 default: 88 default:
94 break; 89 break;
95 } 90 }
96 return false; 91 return false;
97 } 92 }
98 93
99 SearchResultView* SearchResultListView::GetResultViewAt(int index) { 94 SearchResultView* SearchResultListView::GetResultViewAt(int index) {
100 DCHECK(index >= 0 && index < child_count()); 95 DCHECK(index >= 0 && index < child_count());
101 return static_cast<SearchResultView*>(child_at(index)); 96 return static_cast<SearchResultView*>(child_at(index));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 GetResultViewAt(i)->ClearResultNoRepaint(); 151 GetResultViewAt(i)->ClearResultNoRepaint();
157 152
158 ScheduleUpdate(); 153 ScheduleUpdate();
159 } 154 }
160 155
161 void SearchResultListView::ListItemsChanged(size_t start, size_t count) { 156 void SearchResultListView::ListItemsChanged(size_t start, size_t count) {
162 ScheduleUpdate(); 157 ScheduleUpdate();
163 } 158 }
164 159
165 } // namespace app_list 160 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_unittest.cc ('k') | ui/base/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698