OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/login/login_interstitial_delegate.h" | 5 #include "chrome/browser/ui/login/login_interstitial_delegate.h" |
6 | 6 |
7 content::InterstitialPageDelegate::TypeID | 7 content::InterstitialPageDelegate::TypeID |
8 LoginInterstitialDelegate::kTypeForTesting = | 8 LoginInterstitialDelegate::kTypeForTesting = |
9 &LoginInterstitialDelegate::kTypeForTesting; | 9 &LoginInterstitialDelegate::kTypeForTesting; |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 std::string LoginInterstitialDelegate::GetHTMLContents() { | 50 std::string LoginInterstitialDelegate::GetHTMLContents() { |
51 // Showing an interstitial results in a new navigation, and a new navigation | 51 // Showing an interstitial results in a new navigation, and a new navigation |
52 // closes all modal dialogs on the page. Therefore the login prompt must be | 52 // closes all modal dialogs on the page. Therefore the login prompt must be |
53 // shown after the interstitial is displayed. This is done by sending a | 53 // shown after the interstitial is displayed. This is done by sending a |
54 // command from the interstitial page as soon as it is loaded. | 54 // command from the interstitial page as soon as it is loaded. |
55 return std::string( | 55 return std::string( |
56 "<!DOCTYPE html>" | 56 "<!DOCTYPE html>" |
57 "<html><body><script>" | 57 "<html><body><script>" |
58 "window.domAutomationController.setAutomationId(1);" | |
59 "window.domAutomationController.send('1');" | 58 "window.domAutomationController.send('1');" |
60 "</script></body></html>"); | 59 "</script></body></html>"); |
61 } | 60 } |
OLD | NEW |