| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |