#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"
#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
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() {}