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 "chrome/browser/extensions/extension_renderer_state.h" | 7 #include "chrome/browser/extensions/extension_renderer_state.h" |
8 #include "chrome/browser/profiles/profile_io_data.h" | 8 #include "chrome/browser/profiles/profile_io_data.h" |
9 #include "chrome/browser/tab_contents/tab_util.h" | 9 #include "chrome/browser/tab_contents/tab_util.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 return; | 65 return; |
66 } | 66 } |
67 | 67 |
68 // Only set the header for Gaia (in the mirror world) and Drive. Gaia needs | 68 // Only set the header for Gaia (in the mirror world) and Drive. Gaia needs |
69 // the header to redirect certain user actions to Chrome native UI. Drive | 69 // the header to redirect certain user actions to Chrome native UI. Drive |
70 // needs the header to tell if the current user is connected. The drive path | 70 // needs the header to tell if the current user is connected. The drive path |
71 // is a temporary workaround until the more generic chrome.principals API is | 71 // is a temporary workaround until the more generic chrome.principals API is |
72 // available. | 72 // available. |
73 const GURL& url = redirect_url.is_empty() ? request->url() : redirect_url; | 73 const GURL& url = redirect_url.is_empty() ? request->url() : redirect_url; |
74 GURL origin(url.GetOrigin()); | 74 GURL origin(url.GetOrigin()); |
75 bool is_gaia_origin = switches::IsEnableInlineSignin() && | 75 bool is_gaia_origin = !switches::IsEnableWebBasedSignin() && |
76 switches::IsNewProfileManagement() && | 76 switches::IsNewProfileManagement() && |
77 gaia::IsGaiaSignonRealm(origin); | 77 gaia::IsGaiaSignonRealm(origin); |
78 if (!is_gaia_origin && !IsDriveOrigin(origin)) | 78 if (!is_gaia_origin && !IsDriveOrigin(origin)) |
79 return; | 79 return; |
80 | 80 |
81 ExtensionRendererState* renderer_state = | 81 ExtensionRendererState* renderer_state = |
82 ExtensionRendererState::GetInstance(); | 82 ExtensionRendererState::GetInstance(); |
83 ExtensionRendererState::WebViewInfo webview_info; | 83 ExtensionRendererState::WebViewInfo webview_info; |
84 bool is_guest = renderer_state->GetWebViewInfo( | 84 bool is_guest = renderer_state->GetWebViewInfo( |
85 child_id, route_id, &webview_info); | 85 child_id, route_id, &webview_info); |
(...skipping 20 matching lines...) Expand all Loading... |
106 request->response_headers()->HasHeader(kChromeManageAccountsHeader)) { | 106 request->response_headers()->HasHeader(kChromeManageAccountsHeader)) { |
107 DCHECK(switches::IsNewProfileManagement() && | 107 DCHECK(switches::IsNewProfileManagement() && |
108 !io_data->is_incognito()); | 108 !io_data->is_incognito()); |
109 content::BrowserThread::PostTask( | 109 content::BrowserThread::PostTask( |
110 content::BrowserThread::UI, FROM_HERE, | 110 content::BrowserThread::UI, FROM_HERE, |
111 base::Bind(ShowAvatarBubbleUIThread, child_id, route_id)); | 111 base::Bind(ShowAvatarBubbleUIThread, child_id, route_id)); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 } // namespace signin | 115 } // namespace signin |
OLD | NEW |