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

Side by Side Diff: chrome/browser/signin/signin_header_helper.cc

Issue 481053003: Honor x-chrome header on non web triggerable transitions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/prefs/incognito_mode_prefs.h" 10 #include "chrome/browser/prefs/incognito_mode_prefs.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 int route_id) { 249 int route_id) {
250 #if defined(OS_IOS) 250 #if defined(OS_IOS)
251 NOTREACHED(); 251 NOTREACHED();
252 #else 252 #else
253 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 253 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
254 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) 254 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin()))
255 return; 255 return;
256 256
257 const content::ResourceRequestInfo* info = 257 const content::ResourceRequestInfo* info =
258 content::ResourceRequestInfo::ForRequest(request); 258 content::ResourceRequestInfo::ForRequest(request);
259 if (!(info && info->IsMainFrame() && info->HasUserGesture())) 259 if (!(info && info->IsMainFrame() &&
260 (info->HasUserGesture() ||
261 !content::PageTransitionIsWebTriggerable(info->GetPageTransition()))))
260 return; 262 return;
261 263
262 std::string header_value; 264 std::string header_value;
263 if (!request->response_headers()->GetNormalizedHeader( 265 if (!request->response_headers()->GetNormalizedHeader(
264 kChromeManageAccountsHeader, &header_value)) { 266 kChromeManageAccountsHeader, &header_value)) {
265 return; 267 return;
266 } 268 }
267 269
268 DCHECK(switches::IsEnableAccountConsistency() && !io_data->IsOffTheRecord()); 270 DCHECK(switches::IsEnableAccountConsistency() && !io_data->IsOffTheRecord());
269 ManageAccountsParams params(BuildManageAccountsParams(header_value)); 271 ManageAccountsParams params(BuildManageAccountsParams(header_value));
270 if (params.service_type == GAIA_SERVICE_TYPE_NONE) 272 if (params.service_type == GAIA_SERVICE_TYPE_NONE)
271 return; 273 return;
272 274
273 params.child_id = child_id; 275 params.child_id = child_id;
274 params.route_id = route_id; 276 params.route_id = route_id;
275 content::BrowserThread::PostTask( 277 content::BrowserThread::PostTask(
276 content::BrowserThread::UI, FROM_HERE, 278 content::BrowserThread::UI, FROM_HERE,
277 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); 279 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params));
278 #endif // defined(OS_IOS) 280 #endif // defined(OS_IOS)
279 } 281 }
280 282
281 } // namespace signin 283 } // namespace signin
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698