OLD | NEW |
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/views/apps_grid_view.h" | 5 #include "ui/app_list/views/apps_grid_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 from - view->bounds().origin()); | 141 from - view->bounds().origin()); |
142 gfx::Point translated_to = gfx::PointAtOffsetFromOrigin( | 142 gfx::Point translated_to = gfx::PointAtOffsetFromOrigin( |
143 to - view->bounds().origin()); | 143 to - view->bounds().origin()); |
144 | 144 |
145 ui::MouseEvent pressed_event(ui::ET_MOUSE_PRESSED, | 145 ui::MouseEvent pressed_event(ui::ET_MOUSE_PRESSED, |
146 translated_from, from, 0); | 146 translated_from, from, 0); |
147 apps_grid_view_->InitiateDrag(view, pointer, pressed_event); | 147 apps_grid_view_->InitiateDrag(view, pointer, pressed_event); |
148 | 148 |
149 ui::MouseEvent drag_event(ui::ET_MOUSE_DRAGGED, | 149 ui::MouseEvent drag_event(ui::ET_MOUSE_DRAGGED, |
150 translated_to, to, 0); | 150 translated_to, to, 0); |
151 apps_grid_view_->UpdateDrag(view, pointer, drag_event); | 151 apps_grid_view_->UpdateDragFromItem(pointer, drag_event); |
152 } | 152 } |
153 | 153 |
154 void SimulateKeyPress(ui::KeyboardCode key_code) { | 154 void SimulateKeyPress(ui::KeyboardCode key_code) { |
155 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, key_code, 0, false); | 155 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, key_code, 0, false); |
156 apps_grid_view_->OnKeyPressed(key_event); | 156 apps_grid_view_->OnKeyPressed(key_event); |
157 } | 157 } |
158 | 158 |
159 scoped_ptr<AppListTestModel> model_; | 159 scoped_ptr<AppListTestModel> model_; |
160 scoped_ptr<PaginationModel> pagination_model_; | 160 scoped_ptr<PaginationModel> pagination_model_; |
161 scoped_ptr<AppsGridView> apps_grid_view_; | 161 scoped_ptr<AppsGridView> apps_grid_view_; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 // After page switch, arrow keys select first item on current page. | 421 // After page switch, arrow keys select first item on current page. |
422 apps_grid_view_->SetSelectedView(GetItemViewAt(first_index)); | 422 apps_grid_view_->SetSelectedView(GetItemViewAt(first_index)); |
423 pagination_model_->SelectPage(1, false); | 423 pagination_model_->SelectPage(1, false); |
424 SimulateKeyPress(ui::VKEY_UP); | 424 SimulateKeyPress(ui::VKEY_UP); |
425 EXPECT_TRUE(apps_grid_view_->IsSelectedView(GetItemViewAt( | 425 EXPECT_TRUE(apps_grid_view_->IsSelectedView(GetItemViewAt( |
426 first_index_on_page2))); | 426 first_index_on_page2))); |
427 } | 427 } |
428 | 428 |
429 } // namespace test | 429 } // namespace test |
430 } // namespace app_list | 430 } // namespace app_list |
OLD | NEW |