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

Unified Diff: chrome/browser/background/background_mode_manager.cc

Issue 9271018: Merge 115621 - Refactor ProfileInfoCacheObserver interface and usage thereof. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/963/src/
Patch Set: Created 8 years, 11 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/background/background_mode_manager.cc
===================================================================
--- chrome/browser/background/background_mode_manager.cc (revision 118523)
+++ chrome/browser/background/background_mode_manager.cc (working copy)
@@ -17,6 +17,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/status_icons/status_icon.h"
#include "chrome/browser/status_icons/status_tray.h"
#include "chrome/browser/ui/browser_list.h"
@@ -384,10 +385,11 @@
///////////////////////////////////////////////////////////////////////////////
// BackgroundModeManager, ProfileInfoCacheObserver overrides
-void BackgroundModeManager::OnProfileAdded(const string16& profile_name,
- const string16& profile_base_dir,
- const FilePath& profile_path,
- const gfx::Image* avatar_image) {
+void BackgroundModeManager::OnProfileAdded(const FilePath& profile_path) {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ string16 profile_name = cache.GetNameOfProfileAtIndex(
+ cache.GetIndexOfProfileWithPath(profile_path));
// At this point, the profile should be registered with the background mode
// manager, but when it's actually added to the cache is when its name is
// set so we need up to update that with the background_mode_data.
@@ -404,7 +406,11 @@
}
void BackgroundModeManager::OnProfileWillBeRemoved(
- const string16& profile_name) {
+ const FilePath& profile_path) {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ string16 profile_name = cache.GetNameOfProfileAtIndex(
+ cache.GetIndexOfProfileWithPath(profile_path));
// Remove the profile from our map of profiles.
BackgroundModeInfoMap::iterator it =
GetBackgroundModeIterator(profile_name);
@@ -415,12 +421,18 @@
}
}
-void BackgroundModeManager::OnProfileWasRemoved(const string16& profile_name) {
+void BackgroundModeManager::OnProfileWasRemoved(
+ const FilePath& profile_path,
+ const string16& profile_name) {
}
void BackgroundModeManager::OnProfileNameChanged(
- const string16& old_profile_name,
- const string16& new_profile_name) {
+ const FilePath& profile_path,
+ const string16& old_profile_name) {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ string16 new_profile_name = cache.GetNameOfProfileAtIndex(
+ cache.GetIndexOfProfileWithPath(profile_path));
BackgroundModeInfoMap::const_iterator it =
GetBackgroundModeIterator(old_profile_name);
// We check that the returned iterator is valid due to unittests, but really
@@ -433,10 +445,7 @@
}
void BackgroundModeManager::OnProfileAvatarChanged(
- const string16& profile_name,
- const string16& profile_base_dir,
- const FilePath& profile_path,
- const gfx::Image* avatar_image) {
+ const FilePath& profile_path) {
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/background/background_mode_manager.h ('k') | chrome/browser/background/background_mode_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698