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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 google_util::IsYoutubeDomainUrl( | 174 google_util::IsYoutubeDomainUrl( |
175 url, | 175 url, |
176 google_util::ALLOW_SUBDOMAIN, | 176 google_util::ALLOW_SUBDOMAIN, |
177 google_util::DISALLOW_NON_STANDARD_PORTS)); | 177 google_util::DISALLOW_NON_STANDARD_PORTS)); |
178 if (!is_google_url && !IsDriveOrigin(origin)) | 178 if (!is_google_url && !IsDriveOrigin(origin)) |
179 return false; | 179 return false; |
180 | 180 |
181 std::string account_id(io_data->google_services_account_id()->GetValue()); | 181 std::string account_id(io_data->google_services_account_id()->GetValue()); |
182 | 182 |
183 int profile_mode_mask = PROFILE_MODE_DEFAULT; | 183 int profile_mode_mask = PROFILE_MODE_DEFAULT; |
184 // TODO(guohui): Needs to check for parent control as well. | |
185 if (io_data->incognito_availibility()->GetValue() == | 184 if (io_data->incognito_availibility()->GetValue() == |
186 IncognitoModePrefs::DISABLED) { | 185 IncognitoModePrefs::DISABLED || |
| 186 IncognitoModePrefs::ArePlatformParentalControlsEnabledCached()) { |
187 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED; | 187 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED; |
188 } | 188 } |
189 | 189 |
190 // TODO(guohui): needs to make a new flag for enabling account consistency. | 190 // TODO(guohui): needs to make a new flag for enabling account consistency. |
191 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s", | 191 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s", |
192 kGaiaIdAttrName, account_id.c_str(), | 192 kGaiaIdAttrName, account_id.c_str(), |
193 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(), | 193 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(), |
194 kEnableAccountConsistencyAttrName, | 194 kEnableAccountConsistencyAttrName, |
195 is_new_profile_management ? "true" : "false")); | 195 is_new_profile_management ? "true" : "false")); |
196 request->SetExtraRequestHeaderByName( | 196 request->SetExtraRequestHeaderByName( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (params.service_type == GAIA_SERVICE_TYPE_NONE) | 236 if (params.service_type == GAIA_SERVICE_TYPE_NONE) |
237 return; | 237 return; |
238 | 238 |
239 content::BrowserThread::PostTask( | 239 content::BrowserThread::PostTask( |
240 content::BrowserThread::UI, FROM_HERE, | 240 content::BrowserThread::UI, FROM_HERE, |
241 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); | 241 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); |
242 #endif // defined(OS_IOS) | 242 #endif // defined(OS_IOS) |
243 } | 243 } |
244 | 244 |
245 } // namespace signin | 245 } // namespace signin |
OLD | NEW |