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

Side by Side Diff: ui/app_list/presenter/app_list_presenter_impl.cc

Issue 2234233002: Enable ash window cycle UI by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/presenter/app_list_presenter_impl.h" 5 #include "ui/app_list/presenter/app_list_presenter_impl.h"
6 6
7 #include "ui/app_list/app_list_constants.h" 7 #include "ui/app_list/app_list_constants.h"
8 #include "ui/app_list/app_list_switches.h" 8 #include "ui/app_list/app_list_switches.h"
9 #include "ui/app_list/pagination_model.h" 9 #include "ui/app_list/pagination_model.h"
10 #include "ui/app_list/presenter/app_list_presenter_delegate_factory.h" 10 #include "ui/app_list/presenter/app_list_presenter_delegate_factory.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 void AppListPresenterImpl::Dismiss() { 74 void AppListPresenterImpl::Dismiss() {
75 if (!is_visible_) 75 if (!is_visible_)
76 return; 76 return;
77 77
78 // If the app list is currently visible, there should be an existing view. 78 // If the app list is currently visible, there should be an existing view.
79 DCHECK(view_); 79 DCHECK(view_);
80 80
81 is_visible_ = false; 81 is_visible_ = false;
82 82
83 // Our widget is currently active. When the animation completes we'll hide 83 // The dismissal may have occurred in response to the app list losing
84 // the widget, changing activation. If a menu is shown before the animation 84 // activation. Otherwise, our widget is currently active. When the animation
85 // completes then the activation change triggers the menu to close. By 85 // completes we'll hide the widget, changing activation. If a menu is shown
86 // deactivating now we ensure there is no activation change when the 86 // before the animation completes then the activation change triggers the menu
87 // animation completes and any menus stay open. 87 // to close. By deactivating now we ensure there is no activation change when
88 view_->GetWidget()->Deactivate(); 88 // the animation completes and any menus stay open.
89 if (view_->GetWidget()->IsActive())
Evan Stade 2016/08/12 22:51:58 This is necessary because otherwise Alt+Tabbing wh
90 view_->GetWidget()->Deactivate();
89 91
90 presenter_delegate_->OnDismissed(); 92 presenter_delegate_->OnDismissed();
91 ScheduleAnimation(); 93 ScheduleAnimation();
92 } 94 }
93 95
94 void AppListPresenterImpl::ToggleAppList(int64_t display_id) { 96 void AppListPresenterImpl::ToggleAppList(int64_t display_id) {
95 if (IsVisible()) { 97 if (IsVisible()) {
96 Dismiss(); 98 Dismiss();
97 return; 99 return;
98 } 100 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } else if (should_snap_back_) { 264 } else if (should_snap_back_) {
263 should_snap_back_ = false; 265 should_snap_back_ = false;
264 ui::ScopedLayerAnimationSettings animation(widget_animator); 266 ui::ScopedLayerAnimationSettings animation(widget_animator);
265 animation.SetTransitionDuration( 267 animation.SetTransitionDuration(
266 base::TimeDelta::FromMilliseconds(kOverscrollPageTransitionDurationMs)); 268 base::TimeDelta::FromMilliseconds(kOverscrollPageTransitionDurationMs));
267 widget->SetBounds(view_bounds_); 269 widget->SetBounds(view_bounds_);
268 } 270 }
269 } 271 }
270 272
271 } // namespace app_list 273 } // namespace app_list
OLDNEW
« ash/wm/window_cycle_controller_unittest.cc ('K') | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698