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

Side by Side Diff: chrome/browser/ui/webui/signin/inline_login_ui.cc

Issue 1054403002: Basic tests for new webview based signin flow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove flaky back-button check Created 5 years, 8 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
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/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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/signin/inline_login_ui.h ('k') | chrome/browser/ui/webui/signin/login_ui_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698