diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 12:28:25 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 12:28:25 +0000 |
commit | 7ff661f3a8bed8b6ae7d75fc9b956e27912e5e84 (patch) | |
tree | 9fdebce3128d81ebafaba32de263b2e6c0605c05 | |
parent | 519eb8e49b4045fd212cd2b5adacedcecd352862 (diff) | |
download | chromium_src-7ff661f3a8bed8b6ae7d75fc9b956e27912e5e84.zip chromium_src-7ff661f3a8bed8b6ae7d75fc9b956e27912e5e84.tar.gz chromium_src-7ff661f3a8bed8b6ae7d75fc9b956e27912e5e84.tar.bz2 |
Fix extension_webstore_private_api calls to DefaultProfile. Instead of calling GetDefaultProfile in incognito mode, call GetOriginalProfile, which gives the non-incognito profile from which that profile was spawned. This makes things work with multi-profiles.
BUG=83792
TEST=existing tests still work.
Review URL: http://codereview.chromium.org/6992036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86602 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_webstore_private_api.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/chrome/browser/extensions/extension_webstore_private_api.cc b/chrome/browser/extensions/extension_webstore_private_api.cc index dbfdb67..1dead6c 100644 --- a/chrome/browser/extensions/extension_webstore_private_api.cc +++ b/chrome/browser/extensions/extension_webstore_private_api.cc @@ -101,15 +101,6 @@ DictionaryValue* CreateLoginResult(Profile* profile) { return dictionary; } -// If |profile| is not incognito, returns it. Otherwise returns the real -// (not incognito) default profile. -Profile* GetDefaultProfile(Profile* profile) { - if (!profile->IsOffTheRecord()) - return profile; - else - return g_browser_process->profile_manager()->GetDefaultProfile(); -} - } // namespace // static @@ -470,7 +461,7 @@ bool CompleteInstallFunction::RunImpl() { bool GetBrowserLoginFunction::RunImpl() { if (!IsWebStoreURL(profile_, source_url())) return false; - result_.reset(CreateLoginResult(GetDefaultProfile(profile_))); + result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); return true; } @@ -514,7 +505,7 @@ bool PromptBrowserLoginFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &preferred_email)); } - Profile* profile = GetDefaultProfile(profile_); + Profile* profile = profile_->GetOriginalProfile(); // Login can currently only be invoked tab-modal. Since this is // coming from the webstore, we should always have a tab, but check @@ -566,7 +557,7 @@ void PromptBrowserLoginFunction::OnLoginSuccess() { // Ensure that apps are synced. // - If the user has already setup sync, we add Apps to the current types. // - If not, we create a new set which is just Apps. - ProfileSyncService* service = GetSyncService(GetDefaultProfile(profile_)); + ProfileSyncService* service = GetSyncService(profile_->GetOriginalProfile()); syncable::ModelTypeSet types; if (service->HasSyncSetupCompleted()) service->GetPreferredDataTypes(&types); @@ -608,7 +599,7 @@ void PromptBrowserLoginFunction::Observe(NotificationType type, DCHECK(waiting_for_token_); - result_.reset(CreateLoginResult(GetDefaultProfile(profile_))); + result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); SendResponse(true); // Matches the AddRef in RunImpl(). |