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

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

Issue 115393004: Turn on inline signin by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/extensions/extension_renderer_state.h" 8 #include "chrome/browser/extensions/extension_renderer_state.h"
9 #include "chrome/browser/profiles/profile_io_data.h" 9 #include "chrome/browser/profiles/profile_io_data.h"
10 #include "chrome/browser/profiles/profiles_state.h" 10 #include "chrome/browser/profiles/profiles_state.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 int route_id) { 62 int route_id) {
63 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 63 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
64 64
65 // Only set the header for Gaia (in the mirror world) and Drive. Gaia needs 65 // Only set the header for Gaia (in the mirror world) and Drive. Gaia needs
66 // the header to redirect certain user actions to Chrome native UI. Drive 66 // the header to redirect certain user actions to Chrome native UI. Drive
67 // needs the header to tell if the current user is connected. The drive path 67 // needs the header to tell if the current user is connected. The drive path
68 // is a temporary workaround until the more generic chrome.principals API is 68 // is a temporary workaround until the more generic chrome.principals API is
69 // available. 69 // available.
70 const GURL& url = redirect_url.is_empty() ? request->url() : redirect_url; 70 const GURL& url = redirect_url.is_empty() ? request->url() : redirect_url;
71 GURL origin(url.GetOrigin()); 71 GURL origin(url.GetOrigin());
72 bool enable_inline = CommandLine::ForCurrentProcess()->HasSwitch( 72 bool enable_web_signin = CommandLine::ForCurrentProcess()->HasSwitch(
73 switches::kEnableInlineSignin); 73 switches::kEnableWebBasedSignin);
74 if (!enable_inline || 74 if (enable_web_signin ||
75 !profiles::IsNewProfileManagementEnabled() || 75 !profiles::IsNewProfileManagementEnabled() ||
76 io_data->is_incognito() || 76 io_data->is_incognito() ||
77 io_data->google_services_username()->GetValue().empty() || 77 io_data->google_services_username()->GetValue().empty() ||
78 (!IsDriveOrigin(origin) && 78 (!IsDriveOrigin(origin) &&
79 !gaia::IsGaiaSignonRealm(origin))) { 79 !gaia::IsGaiaSignonRealm(origin))) {
80 return; 80 return;
81 } 81 }
82 82
83 ExtensionRendererState* renderer_state = 83 ExtensionRendererState* renderer_state =
84 ExtensionRendererState::GetInstance(); 84 ExtensionRendererState::GetInstance();
(...skipping 23 matching lines...) Expand all
108 request->response_headers()->HasHeader(kChromeManageAccountsHeader)) { 108 request->response_headers()->HasHeader(kChromeManageAccountsHeader)) {
109 DCHECK(profiles::IsNewProfileManagementEnabled() && 109 DCHECK(profiles::IsNewProfileManagementEnabled() &&
110 !io_data->is_incognito()); 110 !io_data->is_incognito());
111 content::BrowserThread::PostTask( 111 content::BrowserThread::PostTask(
112 content::BrowserThread::UI, FROM_HERE, 112 content::BrowserThread::UI, FROM_HERE,
113 base::Bind(ShowAvatarBubbleUIThread, child_id, route_id)); 113 base::Bind(ShowAvatarBubbleUIThread, child_id, route_id));
114 } 114 }
115 } 115 }
116 116
117 } // namespace signin 117 } // namespace signin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698