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/test/apps_grid_view_test_api.h" | 5 #include "ui/app_list/views/test/apps_grid_view_test_api.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "ui/app_list/views/app_list_item_view.h" | 8 #include "ui/app_list/views/app_list_item_view.h" |
9 #include "ui/app_list/views/apps_grid_view.h" | 9 #include "ui/app_list/views/apps_grid_view.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 void AppsGridViewTestApi::SetPageFlipDelay(int page_flip_delay_in_ms) { | 39 void AppsGridViewTestApi::SetPageFlipDelay(int page_flip_delay_in_ms) { |
40 view_->page_flip_delay_in_ms_ = page_flip_delay_in_ms; | 40 view_->page_flip_delay_in_ms_ = page_flip_delay_in_ms; |
41 } | 41 } |
42 | 42 |
43 void AppsGridViewTestApi::PressItemAt(int index) { | 43 void AppsGridViewTestApi::PressItemAt(int index) { |
44 GetViewAtModelIndex(index)->OnKeyPressed( | 44 GetViewAtModelIndex(index)->OnKeyPressed( |
45 ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, ui::EF_NONE)); | 45 ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, ui::EF_NONE)); |
46 } | 46 } |
47 | 47 |
48 void AppsGridViewTestApi::DisableSynchronousDrag() { | |
49 #if defined(OS_WIN) | |
50 DCHECK(view_->synchronous_drag_.Get() == NULL) | |
51 << "DisableSynchronousDrag needs to " | |
52 "be called before " | |
53 "synchronous_drag_ is set up."; | |
54 view_->use_synchronous_drag_ = false; | |
55 #endif | |
56 } | |
57 | |
58 bool AppsGridViewTestApi::HasPendingPageFlip() const { | 48 bool AppsGridViewTestApi::HasPendingPageFlip() const { |
59 return view_->page_flip_timer_.IsRunning() || | 49 return view_->page_flip_timer_.IsRunning() || |
60 view_->pagination_model()->has_transition(); | 50 view_->pagination_model()->has_transition(); |
61 } | 51 } |
62 | 52 |
63 } // namespace test | 53 } // namespace test |
64 } // namespace app_list | 54 } // namespace app_list |
OLD | NEW |