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

Unified Diff: ui/app_list/views/app_list_view.cc

Issue 2950913002: Added new features tests to AppListPresenterDelegateUnittests. (Closed)
Patch Set: Added new feature tests to AppListPresenterDelegateUnittests. Added early test returns for Config::… Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/app_list/views/app_list_view.cc
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 128b018f2dcde90c6ba3207842482f48d98945ee..a27d0a4fef8874a9c938935a85a40c78caedbfb2 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -521,7 +521,7 @@ void AppListView::EndDrag(const gfx::Point& location) {
// fling.
int const new_y_position = location.y() - initial_drag_point_.y() +
fullscreen_widget_->GetWindowBoundsInScreen().y();
- if (std::abs(last_fling_velocity_) > kAppListDragVelocityThreshold) {
+ if (std::abs(last_fling_velocity_) >= kAppListDragVelocityThreshold) {
// If the user releases drag with velocity over the threshold, snap to
// the next state, ignoring the drag release position.
@@ -724,12 +724,13 @@ void AppListView::OnGestureEvent(ui::GestureEvent* event) {
return;
switch (event->type()) {
+ case ui::ET_SCROLL_FLING_START:
case ui::ET_GESTURE_SCROLL_BEGIN:
StartDrag(event->location());
event->SetHandled();
break;
case ui::ET_GESTURE_SCROLL_UPDATE:
- last_fling_velocity_ = event->details().velocity_y();
+ last_fling_velocity_ = event->details().scroll_y();
UpdateDrag(event->location());
event->SetHandled();
break;
@@ -855,6 +856,7 @@ void AppListView::SetState(AppListState new_state) {
new_widget_bounds.set_y(0);
break;
case CLOSED:
+ GetWidget()->Close();
xiyuan 2017/06/21 18:16:18 Why do we need to do this? delegate_->Dismiss() do
newcomer 2017/06/21 20:39:42 I changed it so I could test it more easily. I agr
app_list_main_view_->Close();
delegate_->Dismiss();
break;

Powered by Google App Engine
This is Rietveld 408576698