| 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/ui/webui/signin/inline_login_ui.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 extensions::TabHelper::CreateForWebContents(contents); | 120 extensions::TabHelper::CreateForWebContents(contents); |
| 121 // Ensure that the login UI has a tab ID, which will allow the GAIA auth | 121 // Ensure that the login UI has a tab ID, which will allow the GAIA auth |
| 122 // extension's background script to tell it apart from iframes injected by | 122 // extension's background script to tell it apart from iframes injected by |
| 123 // other extensions. | 123 // other extensions. |
| 124 SessionTabHelper::CreateForWebContents(contents); | 124 SessionTabHelper::CreateForWebContents(contents); |
| 125 } | 125 } |
| 126 | 126 |
| 127 InlineLoginUI::~InlineLoginUI() {} | 127 InlineLoginUI::~InlineLoginUI() {} |
| 128 | 128 |
| 129 // Gets the Gaia iframe within a WebContents. | 129 // Gets the Gaia iframe within a WebContents. |
| 130 content::RenderFrameHost* InlineLoginUI::GetAuthIframe( | 130 content::RenderFrameHost* InlineLoginUI::GetAuthFrame( |
| 131 content::WebContents* web_contents, | 131 content::WebContents* web_contents, |
| 132 const GURL& parent_origin, | 132 const GURL& parent_origin, |
| 133 const std::string& parent_frame_name) { | 133 const std::string& parent_frame_name) { |
| 134 std::set<content::RenderFrameHost*> frame_set; | 134 std::set<content::RenderFrameHost*> frame_set; |
| 135 bool is_webview = switches::IsEnableWebviewBasedSignin(); | 135 bool is_webview = switches::IsEnableWebviewBasedSignin(); |
| 136 #if defined(OS_CHROMEOS) | 136 #if defined(OS_CHROMEOS) |
| 137 is_webview = is_webview || chromeos::StartupUtils::IsWebviewSigninEnabled(); | 137 is_webview = is_webview || chromeos::StartupUtils::IsWebviewSigninEnabled(); |
| 138 #endif | 138 #endif |
| 139 if (is_webview) { | 139 if (is_webview) { |
| 140 extensions::GuestViewManager* manager = | 140 extensions::GuestViewManager* manager = |
| 141 extensions::GuestViewManager::FromBrowserContext( | 141 extensions::GuestViewManager::FromBrowserContext( |
| 142 web_contents->GetBrowserContext()); | 142 web_contents->GetBrowserContext()); |
| 143 manager->ForEachGuest(web_contents, | 143 manager->ForEachGuest(web_contents, |
| 144 base::Bind(&AddToSetIfSigninWebview, &frame_set)); | 144 base::Bind(&AddToSetIfSigninWebview, &frame_set)); |
| 145 } else { | 145 } else { |
| 146 web_contents->ForEachFrame( | 146 web_contents->ForEachFrame( |
| 147 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, | 147 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, |
| 148 parent_origin, parent_frame_name)); | 148 parent_origin, parent_frame_name)); |
| 149 } | 149 } |
| 150 DCHECK_GE(1U, frame_set.size()); | 150 DCHECK_GE(1U, frame_set.size()); |
| 151 if (!frame_set.empty()) | 151 if (!frame_set.empty()) |
| 152 return *frame_set.begin(); | 152 return *frame_set.begin(); |
| 153 | 153 |
| 154 return NULL; | 154 return NULL; |
| 155 } | 155 } |
| OLD | NEW |