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

Unified Diff: chrome_frame/host_w_controls.html

Issue 218019: Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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
« no previous file with comments | « chrome_frame/host.html ('k') | chrome_frame/html_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/host_w_controls.html
===================================================================
--- chrome_frame/host_w_controls.html (revision 0)
+++ chrome_frame/host_w_controls.html (revision 0)
@@ -0,0 +1,97 @@
+<HTML>
+<!-- TODO(slightlyoff): Move to tests directory? -->
+<HEAD>
+<TITLE> Chrome Frame Test </TITLE>
+<SCRIPT type="text/javascript">
+function msg(txt) {
+ try {
+ document.getElementById("my_text").innerHTML = txt;
+ } catch(e) {
+ alert("error");
+ }
+}
+
+function GetChromeFrame() {
+ var chromeFrame = window.document.ChromeFrame
+ return chromeFrame;
+}
+
+function OnChromeFrameMessage(text) {
+ msg("In host: \r\nMessage from ChromeFrame: " + text);
+
+ var chromeFrame = GetChromeFrame();
+ chromeFrame.PostMessageToFrame("OnHostMessage", "Hello from host");
+ return "OK";
+}
+
+function OnNavigate() {
+ var url = document.getElementById('inputurl');
+ GetChromeFrame().src = url.value;
+}
+
+function OnFocus() {
+ msg("OnFocus");
+}
+
+window.onload = function() {
+ var chromeFrame = GetChromeFrame();
+ var url = location.href;
+ url = url.substr(0, url.lastIndexOf('/') + 1) + "frame_w_controls.html";
+ chromeFrame.src = url;
+
+ try {
+ var cf = document.getElementById('ChromeFrame');
+ cf.addEventListener("focus", OnFocus, true);
+ cf.addEventListener("blur", function() { msg('blur'); }, true);
+ msg("ready");
+ } catch(e) {
+ alert("error");
+ }
+}
+
+function setFocusToCf() {
+ var cf = document.getElementById('ChromeFrame');
+ cf.focus();
+ // alert(cf.hasFocus());
+ return true;
+}
+
+</SCRIPT>
+<style>
+/* CSS magic to avoid the focus rect */
+object:focus {
+ outline: 0;
+}
+</style>
+<!--
+object:focus { outline: none; }
+:focus { outline: none }
+a:focus { outline: 1px dotted invert }
+-->
+</HEAD>
+<BODY>
+Chrome Frame Test activex
+<br><br>
+<input id="inputurl" type="text" name="URL">
+<input type="submit" value="Navigate" onClick="OnNavigate();">
+<center>
+<OBJECT ID="ChromeFrame" tabindex="0"
+ WIDTH="500"
+ HEIGHT="300"
+ CODEBASE="http://www.google.com"
+ CLASSID="CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">
+ <!-- <PARAM NAME="BackColor" VALUE="100"> -->
+ <!-- <PARAM NAME="src" VALUE="file:///z:/code/debug/test.html"> -->
+ <embed ID="ChromeFramePlugin" WIDTH=500 HEIGHT=300 NAME="ChromeFrame"
+ SRC="http://www.google.com" TYPE="application/chromeframe">
+ </embed>
+</OBJECT>
+<p>To test the focus: <input id="fake_edit" type="text" name="fake"></p>
+<p><button onclick="return setFocusToCf();">SetFocusToCF</button></p>
+<p>
+Message:<br>
+<pre><p id="my_text"></p></pre>
+</p>
+</center>
+</BODY>
+</HTML>
« no previous file with comments | « chrome_frame/host.html ('k') | chrome_frame/html_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698