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

Unified Diff: chrome/browser/app_controller_profile_observer.mm

Issue 14923004: [Mac] AppController needs to update its "last profile" pointer when the active profile is deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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/app_controller_profile_observer.mm
diff --git a/chrome/browser/app_controller_profile_observer.mm b/chrome/browser/app_controller_profile_observer.mm
new file mode 100644
index 0000000000000000000000000000000000000000..10fcd421dffff7272141c0366e12fe806fbe18cc
--- /dev/null
+++ b/chrome/browser/app_controller_profile_observer.mm
@@ -0,0 +1,51 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/app_controller_profile_observer.h"
+
+#import "chrome/browser/app_controller_mac.h"
+#include "base/utf_string_conversions.h"
+
+AppControllerProfileObserver::AppControllerProfileObserver(
+ ProfileManager* profile_manager, id app_controller)
+ : profile_manager_(profile_manager),
+ app_controller_(app_controller) {
+ if (profile_manager_) {
Roger Tawa OOO till Jul 10th 2013/05/07 20:54:15 add DCHECK(profile_manager_) ?
noms (inactive) 2013/05/08 15:19:35 Done.
+ profile_manager_->GetProfileInfoCache().AddObserver(this);
+ }
+}
+
+AppControllerProfileObserver::~AppControllerProfileObserver() {
+ if (profile_manager_) {
+ profile_manager_->GetProfileInfoCache().RemoveObserver(this);
+ }
+}
+
+// ProfileInfoCacheObserver implementation:
+
+void AppControllerProfileObserver::OnProfileAdded(
+ const base::FilePath& profile_path) {
+}
+
+void AppControllerProfileObserver::OnProfileWasRemoved(
+ const base::FilePath& profile_path,
+ const string16& profile_name) {
+ // When a profile is deleted we need to notify the AppController,
+ // so that it can correctly update its pointer to the last used profile.
+ [app_controller_ profileWasRemoved:profile_name];
+}
+
+void AppControllerProfileObserver::OnProfileWillBeRemoved(
+ const base::FilePath& profile_path) {
+}
+
+void AppControllerProfileObserver::OnProfileNameChanged(
+ const base::FilePath& profile_path,
+ const string16& old_profile_name) {
+}
+
+void AppControllerProfileObserver::OnProfileAvatarChanged(
+ const base::FilePath& profile_path) {
+}
+

Powered by Google App Engine
This is Rietveld 408576698