summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-02 12:26:13 +0000
committerpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-02 12:26:13 +0000
commitef527046875bb54dcbcff25caf2c3aebd917efb1 (patch)
tree402ff77334ceced99062c728dd28b08aa4a3ad95
parent11ecd8e8d74814af1ec6eef335b8d40e931ac11f (diff)
downloadchromium_src-ef527046875bb54dcbcff25caf2c3aebd917efb1.zip
chromium_src-ef527046875bb54dcbcff25caf2c3aebd917efb1.tar.gz
chromium_src-ef527046875bb54dcbcff25caf2c3aebd917efb1.tar.bz2
Merge 120013 - Quick-and-dirty hacks for getting policy working behind proxies.
This is check-in for mattias. Original review: http://codereview.chromium.org/9315011/ Note that this hard-wires policy OAuth fetching in login_utils.cc to the authentication profile. I'm not entirely sure this is a good idea, but required since the user profile isn't in a state to allow successful requests at this point (the use-shared-proxies flag is off). Other stuff in login_utils.cc might need the hack too (sync?). BUG=chromium-os:25703 TEST=Verify fix for chromium-os:25703 TBR=mnissler@chromium.org,zelidrag@chromium.org,sumit@chromium.org,pastarmovj@chromium.org,kuan@chromium.org Review URL: https://chromiumcodereview.appspot.com/9309024 TBR=xiyuan@chromium.org Review URL: https://chromiumcodereview.appspot.com/9309053 git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@120203 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/login/login_utils.cc16
-rw-r--r--chrome/browser/chromeos/proxy_config_service_impl.cc4
2 files changed, 13 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 899965f..3e8c117 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -789,6 +789,12 @@ void LoginUtilsImpl::OnProfileCreated(
user_profile->GetPrefs(), NULL);
google_services_username.SetValue(
UserManager::Get()->logged_in_user().display_email());
+ // Make sure we flip every profile to not share proxies if the user hasn't
+ // specified so explicitly.
+ const PrefService::Preference* use_shared_proxies_pref =
+ user_profile->GetPrefs()->FindPreference(prefs::kUseSharedProxies);
+ if (use_shared_proxies_pref->IsDefaultValue())
+ user_profile->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false);
RespectLocalePreference(user_profile);
return;
}
@@ -891,8 +897,8 @@ void LoginUtilsImpl::StartTokenServices(Profile* user_profile) {
if (!ReadOAuth1AccessToken(user_profile, &oauth1_token, &oauth1_secret))
return;
- FetchSecondaryTokens(user_profile->GetOffTheRecordProfile(), oauth1_token,
- oauth1_secret);
+ FetchSecondaryTokens(user_profile->GetOffTheRecordProfile(),
+ oauth1_token, oauth1_secret);
}
void LoginUtilsImpl::StartSignedInServices(
@@ -1280,9 +1286,9 @@ void LoginUtilsImpl::FetchPolicyToken(Profile* offrecord_profile,
// Fetch dm service token now, if it hasn't been fetched yet.
if (!policy_oauth_fetcher_.get() || policy_oauth_fetcher_->failed()) {
// Trigger oauth token fetch for user policy.
- policy_oauth_fetcher_.reset(new PolicyOAuthFetcher(offrecord_profile,
- token,
- secret));
+ policy_oauth_fetcher_.reset(
+ new PolicyOAuthFetcher(authenticator_->authentication_profile(),
+ token, secret));
policy_oauth_fetcher_->Start();
}
diff --git a/chrome/browser/chromeos/proxy_config_service_impl.cc b/chrome/browser/chromeos/proxy_config_service_impl.cc
index 1f6f438..8480d30 100644
--- a/chrome/browser/chromeos/proxy_config_service_impl.cc
+++ b/chrome/browser/chromeos/proxy_config_service_impl.cc
@@ -542,7 +542,7 @@ void ProxyConfigServiceImpl::RegisterPrefs(PrefService* pref_service) {
// Use shared proxies default to off. GetUseSharedProxies will return the
// correct value based on pre-login and login.
pref_service->RegisterBooleanPref(prefs::kUseSharedProxies,
- false,
+ true,
PrefService::UNSYNCABLE_PREF);
}
@@ -664,7 +664,7 @@ void ProxyConfigServiceImpl::SetProxyConfigForNetwork(
bool ProxyConfigServiceImpl::GetUseSharedProxies() {
const PrefService::Preference* use_shared_proxies_pref =
prefs()->FindPreference(prefs::kUseSharedProxies);
- if (!use_shared_proxies_pref || use_shared_proxies_pref->IsDefaultValue())
+ if (!use_shared_proxies_pref)
return !UserManager::Get()->user_is_logged_in();
return use_shared_proxies_.GetValue();
}