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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.h

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, 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/app_list_view_delegate.h
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.h b/chrome/browser/ui/app_list/app_list_view_delegate.h
index ec67e7489a809580c637413c31ac2702db49a107..e83896b860ddb413165d45281eb787ad8ffc60cc 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.h
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.h
@@ -52,13 +52,24 @@ class AppListViewDelegate : public app_list::AppListViewDelegate,
public SigninManagerBase::Observer,
public SigninManagerFactory::Observer {
public:
+ // Constructs Chrome's AppListViewDelegate, initially for |profile|.
+ // Does not take ownership of |controller|. TODO(tapted): It should.
AppListViewDelegate(Profile* profile,
AppListControllerDelegate* controller);
virtual ~AppListViewDelegate();
private:
- // Updates the app list's current profile and ProfileMenuItems.
- void OnProfileChanged();
+ // Configure the AppList for the given |profile|.
+ void SetProfile(Profile* profile);
+
+ // Updates the speech webview and start page for the current |profile_|.
+ void SetUpSearchUI();
+
+ // Updates the app list's ProfileMenuItems for the current |profile_|.
+ void SetUpProfileSwitcher();
+
+ // Updates the app list's custom launcher pages for the current |profile_|.
+ void SetUpCustomLauncherPages();
// Overridden from app_list::AppListViewDelegate:
virtual bool ForceNativeDesktop() const OVERRIDE;
@@ -130,7 +141,6 @@ class AppListViewDelegate : public app_list::AppListViewDelegate,
const base::FilePath& profile_path,
const base::string16& old_profile_name) OVERRIDE;
- scoped_ptr<app_list::SearchController> search_controller_;
// Unowned pointer to the controller.
AppListControllerDelegate* controller_;
// Unowned pointer to the associated profile. May change if SetProfileByPath
@@ -140,7 +150,9 @@ class AppListViewDelegate : public app_list::AppListViewDelegate,
// if |profile_| changes.
app_list::AppListModel* model_;
+ // Note: order ensures |search_controller_| is destroyed before |speech_ui_|.
scoped_ptr<app_list::SpeechUIModel> speech_ui_;
+ scoped_ptr<app_list::SearchController> search_controller_;
base::TimeDelta auto_launch_timeout_;
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_views.cc ('k') | chrome/browser/ui/app_list/app_list_view_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698