Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / signin / inline_login_ui.cc
index 7768caf..2f285af 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
 #include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sessions/session_tab_helper.h"
 #include "chrome/common/url_constants.h"
 #include "content/public/browser/web_ui.h"
 #include "content/public/browser/web_ui_data_source.h"
@@ -14,7 +15,6 @@
 #if defined(OS_CHROMEOS)
 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h"
 #else
-#include "chrome/browser/extensions/tab_helper.h"
 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h"
 #endif
 
@@ -47,12 +47,17 @@ InlineLoginUI::InlineLoginUI(content::WebUI* web_ui)
   web_ui->AddMessageHandler(new chromeos::InlineLoginHandlerChromeOS());
 #else
   web_ui->AddMessageHandler(new InlineLoginHandlerImpl());
+#endif
+  content::WebContents* contents = web_ui->GetWebContents();
   // Required for intercepting extension function calls when the page is loaded
   // in a bubble (not a full tab, thus tab helpers are not registered
   // automatically).
   extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
-      web_ui->GetWebContents());
-#endif
+      contents);
+  // Ensure that the login UI has a tab ID, which will allow the GAIA auth
+  // extension's background script to tell it apart from iframes injected by
+  // other extensions.
+  SessionTabHelper::CreateForWebContents(contents);
 }
 
 InlineLoginUI::~InlineLoginUI() {}