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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_views.cc

Issue 492163002: Fix Profile* lifetime issues in Chrome's AppListViewDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add constructor comment Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/app_list/app_list_service_views.h" 5 #include "chrome/browser/ui/app_list/app_list_service_views.h"
6 6
7 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 7 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
8 #include "chrome/browser/ui/app_list/scoped_keep_alive.h" 8 #include "chrome/browser/ui/app_list/scoped_keep_alive.h"
9 #include "ui/app_list/views/app_list_view.h"
9 10
10 AppListServiceViews::AppListServiceViews( 11 AppListServiceViews::AppListServiceViews(
11 scoped_ptr<AppListControllerDelegate> controller_delegate) 12 scoped_ptr<AppListControllerDelegate> controller_delegate)
12 : shower_(this), 13 : shower_(this),
13 can_dismiss_(true), 14 can_dismiss_(true),
14 controller_delegate_(controller_delegate.Pass()) { 15 controller_delegate_(controller_delegate.Pass()) {
15 } 16 }
16 17
17 AppListServiceViews::~AppListServiceViews() {} 18 AppListServiceViews::~AppListServiceViews() {}
18 19
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 57 }
57 58
58 Profile* AppListServiceViews::GetCurrentAppListProfile() { 59 Profile* AppListServiceViews::GetCurrentAppListProfile() {
59 return shower_.profile(); 60 return shower_.profile();
60 } 61 }
61 62
62 AppListControllerDelegate* AppListServiceViews::GetControllerDelegate() { 63 AppListControllerDelegate* AppListServiceViews::GetControllerDelegate() {
63 return controller_delegate_.get(); 64 return controller_delegate_.get();
64 } 65 }
65 66
67 void AppListServiceViews::DestroyAppList() {
68 if (!shower_.HasView())
69 return;
70
71 // Use CloseNow(). This can't be asynchronous because the profile will be
72 // deleted once this function returns.
73 shower_.app_list()->GetWidget()->CloseNow();
74 DCHECK(!shower_.HasView());
75 }
76
66 AppListControllerDelegate* 77 AppListControllerDelegate*
67 AppListServiceViews::GetControllerDelegateForCreate() { 78 AppListServiceViews::GetControllerDelegateForCreate() {
68 return controller_delegate_.get(); 79 return controller_delegate_.get();
69 } 80 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_views.h ('k') | chrome/browser/ui/app_list/app_list_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698