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

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

Issue 2434573004: Close app list widget when users click outside of the widget (Closed)
Patch Set: Combine 2 if statements and add DCHECK(!is_visible_) before its use. Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/ash/app_list/app_list_service_ash.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19 matching lines...) Expand all
30 30
31 } // namespace 31 } // namespace
32 32
33 AppListPresenterImpl::AppListPresenterImpl( 33 AppListPresenterImpl::AppListPresenterImpl(
34 AppListPresenterDelegateFactory* factory) 34 AppListPresenterDelegateFactory* factory)
35 : factory_(factory) { 35 : factory_(factory) {
36 DCHECK(factory); 36 DCHECK(factory);
37 } 37 }
38 38
39 AppListPresenterImpl::~AppListPresenterImpl() { 39 AppListPresenterImpl::~AppListPresenterImpl() {
40 Dismiss();
sadrul 2016/10/21 15:12:48 Looks like this is a virtual function, and calling
thanhph 2016/10/21 16:09:40 Thank Sadrul! I make Dismiss override final by cha
40 presenter_delegate_.reset(); 41 presenter_delegate_.reset();
41 // Ensures app list view goes before the controller since pagination model 42 // Ensures app list view goes before the controller since pagination model
42 // lives in the controller and app list view would access it on destruction. 43 // lives in the controller and app list view would access it on destruction.
43 if (view_) { 44 if (view_) {
44 view_->GetAppsPaginationModel()->RemoveObserver(this); 45 view_->GetAppsPaginationModel()->RemoveObserver(this);
45 if (view_->GetWidget()) 46 if (view_->GetWidget())
46 view_->GetWidget()->CloseNow(); 47 view_->GetWidget()->CloseNow();
47 } 48 }
48 } 49 }
49 50
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } else if (should_snap_back_) { 265 } else if (should_snap_back_) {
265 should_snap_back_ = false; 266 should_snap_back_ = false;
266 ui::ScopedLayerAnimationSettings animation(widget_animator); 267 ui::ScopedLayerAnimationSettings animation(widget_animator);
267 animation.SetTransitionDuration( 268 animation.SetTransitionDuration(
268 base::TimeDelta::FromMilliseconds(kOverscrollPageTransitionDurationMs)); 269 base::TimeDelta::FromMilliseconds(kOverscrollPageTransitionDurationMs));
269 widget->SetBounds(view_bounds_); 270 widget->SetBounds(view_bounds_);
270 } 271 }
271 } 272 }
272 273
273 } // namespace app_list 274 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/app_list/app_list_service_ash.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698