ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / ui / login / login_interstitial_delegate.cc
blobb4b8dfb73603b29875f008970ff1a631bd76a40a
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/login/login_interstitial_delegate.h"
7 LoginInterstitialDelegate::LoginInterstitialDelegate(
8 content::WebContents* web_contents,
9 const GURL& request_url,
10 base::Closure& callback)
11 : callback_(callback) {
12 // The interstitial page owns us.
13 content::InterstitialPage* interstitial_page =
14 content::InterstitialPage::Create(web_contents,
15 true,
16 request_url,
17 this);
18 interstitial_page->Show();
21 LoginInterstitialDelegate::~LoginInterstitialDelegate() {
24 void LoginInterstitialDelegate::CommandReceived(const std::string& command) {
25 callback_.Run();
28 std::string LoginInterstitialDelegate::GetHTMLContents() {
29 // Showing an interstitial results in a new navigation, and a new navigation
30 // closes all modal dialogs on the page. Therefore the login prompt must be
31 // shown after the interstitial is displayed. This is done by sending a
32 // command from the interstitial page as soon as it is loaded.
33 return std::string(
34 "<!DOCTYPE html>"
35 "<html><body><script>"
36 "window.domAutomationController.setAutomationId(1);"
37 "window.domAutomationController.send('1');"
38 "</script></body></html>");