| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/signin/signin_header_helper.h" | 5 #include "chrome/browser/signin/signin_header_helper.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 google_util::IsGoogleDomainUrl( | 161 google_util::IsGoogleDomainUrl( |
| 162 url, | 162 url, |
| 163 google_util::ALLOW_SUBDOMAIN, | 163 google_util::ALLOW_SUBDOMAIN, |
| 164 google_util::DISALLOW_NON_STANDARD_PORTS); | 164 google_util::DISALLOW_NON_STANDARD_PORTS); |
| 165 if (!is_google_url && !IsDriveOrigin(origin)) | 165 if (!is_google_url && !IsDriveOrigin(origin)) |
| 166 return false; | 166 return false; |
| 167 | 167 |
| 168 std::string account_id(io_data->google_services_account_id()->GetValue()); | 168 std::string account_id(io_data->google_services_account_id()->GetValue()); |
| 169 | 169 |
| 170 int profile_mode_mask = PROFILE_MODE_DEFAULT; | 170 int profile_mode_mask = PROFILE_MODE_DEFAULT; |
| 171 // TODO(guohui): Needs to check for parent control as well. | |
| 172 if (io_data->incognito_availibility()->GetValue() == | 171 if (io_data->incognito_availibility()->GetValue() == |
| 173 IncognitoModePrefs::DISABLED) { | 172 IncognitoModePrefs::DISABLED || |
| 173 IncognitoModePrefs::ArePlatformParentalControlsEnabledCached()) { |
| 174 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED; | 174 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED; |
| 175 } | 175 } |
| 176 | 176 |
| 177 // TODO(guohui): needs to make a new flag for enabling account consistency. | 177 // TODO(guohui): needs to make a new flag for enabling account consistency. |
| 178 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s", | 178 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s", |
| 179 kGaiaIdAttrName, account_id.c_str(), | 179 kGaiaIdAttrName, account_id.c_str(), |
| 180 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(), | 180 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(), |
| 181 kEnableAccountConsistencyAttrName, | 181 kEnableAccountConsistencyAttrName, |
| 182 is_new_profile_management ? "true" : "false")); | 182 is_new_profile_management ? "true" : "false")); |
| 183 request->SetExtraRequestHeaderByName( | 183 request->SetExtraRequestHeaderByName( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 if (params.service_type == GAIA_SERVICE_TYPE_NONE) | 223 if (params.service_type == GAIA_SERVICE_TYPE_NONE) |
| 224 return; | 224 return; |
| 225 | 225 |
| 226 content::BrowserThread::PostTask( | 226 content::BrowserThread::PostTask( |
| 227 content::BrowserThread::UI, FROM_HERE, | 227 content::BrowserThread::UI, FROM_HERE, |
| 228 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); | 228 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); |
| 229 #endif // defined(OS_IOS) | 229 #endif // defined(OS_IOS) |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace signin | 232 } // namespace signin |
| OLD | NEW |