OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |