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

Unified Diff: chrome/browser/ui/webui/signin/inline_login_ui.cc

Issue 317093002: Show confirmation dialog for unsecure signin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/signin/inline_login_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/signin/inline_login_ui.cc
diff --git a/chrome/browser/ui/webui/signin/inline_login_ui.cc b/chrome/browser/ui/webui/signin/inline_login_ui.cc
index 2f285aff0428f22bea721e4f0687d2e46c07b007..161abb30e60334d7210c514665876798c7ecf3f0 100644
--- a/chrome/browser/ui/webui/signin/inline_login_ui.cc
+++ b/chrome/browser/ui/webui/signin/inline_login_ui.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/common/url_constants.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "grit/browser_resources.h"
@@ -33,7 +34,19 @@ content::WebUIDataSource* CreateWebUIDataSource() {
source->AddLocalizedString("title", IDS_CHROME_SIGNIN_TITLE);
return source;
-};
+}
+
+void AddToSetIfIsAuthIframe(std::set<content::RenderFrameHost*>* frame_set,
+ const GURL& parent_origin,
+ const std::string& parent_frame_name,
+ content::RenderFrameHost* frame) {
+ content::RenderFrameHost* parent = frame->GetParent();
+ if (parent && parent->GetFrameName() == parent_frame_name &&
+ (parent_origin.is_empty() ||
+ parent->GetLastCommittedURL().GetOrigin() == parent_origin)) {
+ frame_set->insert(frame);
+ }
+}
} // empty namespace
@@ -61,3 +74,19 @@ InlineLoginUI::InlineLoginUI(content::WebUI* web_ui)
}
InlineLoginUI::~InlineLoginUI() {}
+
+// Gets the Gaia iframe within a WebContents.
+content::RenderFrameHost* InlineLoginUI::GetAuthIframe(
+ content::WebContents* web_contents,
+ const GURL& parent_origin,
+ const std::string& parent_frame_name) {
+ std::set<content::RenderFrameHost*> frame_set;
+ web_contents->ForEachFrame(
+ base::Bind(&AddToSetIfIsAuthIframe, &frame_set,
+ parent_origin, parent_frame_name));
+ DCHECK_GE(1U, frame_set.size());
+ if (!frame_set.empty())
+ return *frame_set.begin();
+
+ return NULL;
+}
« no previous file with comments | « chrome/browser/ui/webui/signin/inline_login_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698