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

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

Issue 1321713005: Abstract WebContents/NavigationController from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 years, 3 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"
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/guest_view/browser/guest_view_manager.h"
20 #include "components/sessions/content/content_open_tab.h"
20 #include "components/signin/core/common/profile_management_switches.h" 21 #include "components/signin/core/common/profile_management_switches.h"
21 #include "content/public/browser/render_frame_host.h" 22 #include "content/public/browser/render_frame_host.h"
22 #include "content/public/browser/web_ui.h" 23 #include "content/public/browser/web_ui.h"
23 #include "content/public/browser/web_ui_data_source.h" 24 #include "content/public/browser/web_ui_data_source.h"
24 #include "extensions/browser/guest_view/web_view/web_view_guest.h" 25 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
25 #include "grit/browser_resources.h" 26 #include "grit/browser_resources.h"
26 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
27 #include "chrome/browser/chromeos/login/startup_utils.h" 28 #include "chrome/browser/chromeos/login/startup_utils.h"
28 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h " 29 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h "
29 #else 30 #else
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // Required for intercepting extension function calls when the page is loaded 120 // Required for intercepting extension function calls when the page is loaded
120 // in a bubble (not a full tab, thus tab helpers are not registered 121 // in a bubble (not a full tab, thus tab helpers are not registered
121 // automatically). 122 // automatically).
122 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( 123 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
123 contents); 124 contents);
124 extensions::TabHelper::CreateForWebContents(contents); 125 extensions::TabHelper::CreateForWebContents(contents);
125 // Ensure that the login UI has a tab ID, which will allow the GAIA auth 126 // Ensure that the login UI has a tab ID, which will allow the GAIA auth
126 // extension's background script to tell it apart from iframes injected by 127 // extension's background script to tell it apart from iframes injected by
127 // other extensions. 128 // other extensions.
128 SessionTabHelper::CreateForWebContents(contents); 129 SessionTabHelper::CreateForWebContents(contents);
130
131 sessions::ContentOpenTab::CreateForWebContents(contents);
129 } 132 }
130 133
131 InlineLoginUI::~InlineLoginUI() {} 134 InlineLoginUI::~InlineLoginUI() {}
132 135
133 // Gets the Gaia iframe within a WebContents. 136 // Gets the Gaia iframe within a WebContents.
134 content::RenderFrameHost* InlineLoginUI::GetAuthFrame( 137 content::RenderFrameHost* InlineLoginUI::GetAuthFrame(
135 content::WebContents* web_contents, 138 content::WebContents* web_contents,
136 const GURL& parent_origin, 139 const GURL& parent_origin,
137 const std::string& parent_frame_name) { 140 const std::string& parent_frame_name) {
138 std::set<content::RenderFrameHost*> frame_set; 141 std::set<content::RenderFrameHost*> frame_set;
(...skipping 14 matching lines...) Expand all
153 web_contents->ForEachFrame( 156 web_contents->ForEachFrame(
154 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, 157 base::Bind(&AddToSetIfIsAuthIframe, &frame_set,
155 parent_origin, parent_frame_name)); 158 parent_origin, parent_frame_name));
156 } 159 }
157 DCHECK_GE(1U, frame_set.size()); 160 DCHECK_GE(1U, frame_set.size());
158 if (!frame_set.empty()) 161 if (!frame_set.empty())
159 return *frame_set.begin(); 162 return *frame_set.begin();
160 163
161 return NULL; 164 return NULL;
162 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698