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

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

Issue 882353002: Fixed crash when looking for iframe when gaia is being hosted in webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make it builds w/o chromeos flag Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/extensions/chrome_extension_web_contents_observer.h" 7 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
8 #include "chrome/browser/extensions/tab_helper.h" 8 #include "chrome/browser/extensions/tab_helper.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sessions/session_tab_helper.h" 10 #include "chrome/browser/sessions/session_tab_helper.h"
11 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
12 #include "chrome/grit/chromium_strings.h" 12 #include "chrome/grit/chromium_strings.h"
13 #include "components/signin/core/common/profile_management_switches.h" 13 #include "components/signin/core/common/profile_management_switches.h"
14 #include "content/public/browser/render_frame_host.h" 14 #include "content/public/browser/render_frame_host.h"
15 #include "content/public/browser/web_ui.h" 15 #include "content/public/browser/web_ui.h"
16 #include "content/public/browser/web_ui_data_source.h" 16 #include "content/public/browser/web_ui_data_source.h"
17 #include "extensions/browser/guest_view/guest_view_manager.h" 17 #include "extensions/browser/guest_view/guest_view_manager.h"
18 #include "grit/browser_resources.h" 18 #include "grit/browser_resources.h"
19 #if defined(OS_CHROMEOS) 19 #if defined(OS_CHROMEOS)
20 #include "chrome/browser/chromeos/login/startup_utils.h"
20 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h " 21 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h "
21 #else 22 #else
22 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" 23 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h"
23 #endif 24 #endif
24 25
25 namespace { 26 namespace {
26 27
27 content::WebUIDataSource* CreateWebUIDataSource() { 28 content::WebUIDataSource* CreateWebUIDataSource() {
28 content::WebUIDataSource* source = 29 content::WebUIDataSource* source =
29 content::WebUIDataSource::Create(chrome::kChromeUIChromeSigninHost); 30 content::WebUIDataSource::Create(chrome::kChromeUIChromeSigninHost);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 89 }
89 90
90 InlineLoginUI::~InlineLoginUI() {} 91 InlineLoginUI::~InlineLoginUI() {}
91 92
92 // Gets the Gaia iframe within a WebContents. 93 // Gets the Gaia iframe within a WebContents.
93 content::RenderFrameHost* InlineLoginUI::GetAuthIframe( 94 content::RenderFrameHost* InlineLoginUI::GetAuthIframe(
94 content::WebContents* web_contents, 95 content::WebContents* web_contents,
95 const GURL& parent_origin, 96 const GURL& parent_origin,
96 const std::string& parent_frame_name) { 97 const std::string& parent_frame_name) {
97 std::set<content::RenderFrameHost*> frame_set; 98 std::set<content::RenderFrameHost*> frame_set;
98 if (switches::IsEnableWebviewBasedSignin()) { 99 if (switches::IsEnableWebviewBasedSignin()
100 #if defined(OS_CHROMEOS)
101 || chromeos::StartupUtils::IsWebviewSigninEnabled()
Dmitry Polukhin 2015/01/29 10:51:15 Could you please instead create boolean variable l
Roman Sorokin (ftl) 2015/01/29 12:06:09 Done.
102 #endif
103 ) {
99 extensions::GuestViewManager* manager = 104 extensions::GuestViewManager* manager =
100 extensions::GuestViewManager::FromBrowserContext( 105 extensions::GuestViewManager::FromBrowserContext(
101 web_contents->GetBrowserContext()); 106 web_contents->GetBrowserContext());
102 manager->ForEachGuest(web_contents, 107 manager->ForEachGuest(web_contents,
103 base::Bind(&AddToSetIfSigninWebview, &frame_set)); 108 base::Bind(&AddToSetIfSigninWebview, &frame_set));
104 } else { 109 } else {
105 web_contents->ForEachFrame( 110 web_contents->ForEachFrame(
106 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, 111 base::Bind(&AddToSetIfIsAuthIframe, &frame_set,
107 parent_origin, parent_frame_name)); 112 parent_origin, parent_frame_name));
108 } 113 }
109 DCHECK_GE(1U, frame_set.size()); 114 DCHECK_GE(1U, frame_set.size());
110 if (!frame_set.empty()) 115 if (!frame_set.empty())
111 return *frame_set.begin(); 116 return *frame_set.begin();
112 117
113 return NULL; 118 return NULL;
114 } 119 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698