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

Unified Diff: chrome/browser/profiles/gaia_info_update_service.cc

Issue 566933005: Do not display lock for hosted domains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.cc » ('j') | chrome/browser/profiles/profile_manager.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/gaia_info_update_service.cc
diff --git a/chrome/browser/profiles/gaia_info_update_service.cc b/chrome/browser/profiles/gaia_info_update_service.cc
index d370a759c8a14305559845ada98428f45a2483a4..ce58eac3d1a2e8429378f62b4c881c0d350fbf48 100644
--- a/chrome/browser/profiles/gaia_info_update_service.cc
+++ b/chrome/browser/profiles/gaia_info_update_service.cc
@@ -5,11 +5,13 @@
#include "chrome/browser/profiles/gaia_info_update_service.h"
#include "base/prefs/pref_service.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.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/profiles/profiles_state.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/common/pref_names.h"
@@ -135,6 +137,14 @@ void GAIAInfoUpdateService::OnProfileDownloadSuccess(
} else if (picture_status == ProfileDownloader::PICTURE_DEFAULT) {
cache.SetGAIAPictureOfProfileAtIndex(profile_index, NULL);
}
+
+ base::string16 hosted_domain = downloader->GetProfileHostedDomain();
+ profile_->GetPrefs()->SetInteger(prefs::kProfileIsLockableVersion,
noms (inactive) 2014/09/12 19:33:25 You should add a comment that this only allows non
Mike Lerman 2014/09/15 14:08:55 Added the comment by the definition of the version
noms (inactive) 2014/09/15 18:52:40 Hmm, but the comment would be useful here as well.
Mike Lerman 2014/09/15 19:51:41 Hmm I wrote some wording I hope is good.
+ profiles::kCurrentLockAlgorithmVersion);
+ if (hosted_domain.empty() || hosted_domain == base::UTF8ToUTF16("google.com"))
+ profile_->GetPrefs()->SetBoolean(prefs::kProfileIsLockable, true);
+ else
+ profile_->GetPrefs()->SetBoolean(prefs::kProfileIsLockable, false);
noms (inactive) 2014/09/12 19:33:25 This could be profile_->GetPrefs()->SetBoolean(pr
Mike Lerman 2014/09/15 14:08:55 Ugh ternaries, so unreadable! Done :P
}
void GAIAInfoUpdateService::OnProfileDownloadFailure(
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.cc » ('j') | chrome/browser/profiles/profile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698