| 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" |
| 11 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 11 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 12 #include "chrome/browser/extensions/tab_helper.h" | 12 #include "chrome/browser/extensions/tab_helper.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/sessions/session_tab_helper.h" | 14 #include "chrome/browser/sessions/session_tab_helper.h" |
| 15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 18 #include "chrome/grit/chromium_strings.h" | 18 #include "chrome/grit/chromium_strings.h" |
| 19 #include "components/guest_view/browser/guest_view_manager.h" |
| 19 #include "components/signin/core/common/profile_management_switches.h" | 20 #include "components/signin/core/common/profile_management_switches.h" |
| 20 #include "content/public/browser/render_frame_host.h" | 21 #include "content/public/browser/render_frame_host.h" |
| 21 #include "content/public/browser/web_ui.h" | 22 #include "content/public/browser/web_ui.h" |
| 22 #include "content/public/browser/web_ui_data_source.h" | 23 #include "content/public/browser/web_ui_data_source.h" |
| 23 #include "extensions/browser/guest_view/guest_view_manager.h" | |
| 24 #include "grit/browser_resources.h" | 24 #include "grit/browser_resources.h" |
| 25 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
| 26 #include "chrome/browser/chromeos/login/startup_utils.h" | 26 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 27 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h
" | 27 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h
" |
| 28 #else | 28 #else |
| 29 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" | 29 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 content::RenderFrameHost* InlineLoginUI::GetAuthFrame( | 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 guestview::GuestViewManager* manager = |
| 141 extensions::GuestViewManager::FromBrowserContext( | 141 guestview::GuestViewManager::FromBrowserContext( |
| 142 web_contents->GetBrowserContext()); | 142 web_contents->GetBrowserContext()); |
| 143 if (manager) { | 143 if (manager) { |
| 144 manager->ForEachGuest(web_contents, | 144 manager->ForEachGuest(web_contents, |
| 145 base::Bind(&AddToSetIfSigninWebview, &frame_set)); | 145 base::Bind(&AddToSetIfSigninWebview, &frame_set)); |
| 146 } | 146 } |
| 147 } else { | 147 } else { |
| 148 web_contents->ForEachFrame( | 148 web_contents->ForEachFrame( |
| 149 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, | 149 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, |
| 150 parent_origin, parent_frame_name)); | 150 parent_origin, parent_frame_name)); |
| 151 } | 151 } |
| 152 DCHECK_GE(1U, frame_set.size()); | 152 DCHECK_GE(1U, frame_set.size()); |
| 153 if (!frame_set.empty()) | 153 if (!frame_set.empty()) |
| 154 return *frame_set.begin(); | 154 return *frame_set.begin(); |
| 155 | 155 |
| 156 return NULL; | 156 return NULL; |
| 157 } | 157 } |
| OLD | NEW |