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

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: filter http request from native code instead of JS Created 6 years, 5 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
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..3025068ee4ca90fb9f72db8a0753264e861b10c2 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 AddToSetIfIsGaiaAuthIframe(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 ||
+ 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::GetGaiaAuthIframe(
+ 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(&AddToSetIfIsGaiaAuthIframe, &frame_set,
+ parent_origin, parent_frame_name));
+ DCHECK_GE(1U, frame_set.size());
+ if (!frame_set.empty())
+ return *frame_set.begin();
+ else
+ return NULL;
+}

Powered by Google App Engine
This is Rietveld 408576698