Move VariationsRegistrySyncerWin to ChromeVariationsServiceClient
[chromium-blink-merge.git] / docs / kiosk_mode.md
blob55bc39caab7aa58c719a8a3087677e6a585cca04
1 ## Introduction
3 If you have a real world kiosk application that you want to run on Google Chrome, then below are the steps to take to simulate kiosk mode.
6 ## Steps to Simulate Kiosk Mode
8 ### Step 1
10 Compile the following Java code:
12 ```
13 import java.awt.*;
14 import java.applet.*;
15 import java.security.*;
16 import java.awt.event.*;
18 public class FullScreen extends Applet
20    public void fullScreen()
21    {
22       AccessController.doPrivileged
23       (
24          new PrivilegedAction() 
25          {
26             public Object run() 
27             {
28                try
29                {
30                   Robot robot = new Robot();
31                   robot.keyPress(KeyEvent.VK_F11);
32                }
33                catch (AWTException e)
34                {
35                   e.printStackTrace();
36                }
37                return null;
38             }
39          }
40       );
41    }
43 ```
45 ### Step 2
47 Include it in an applet on your kiosk application's home page:
49 ```
50 <applet name="appletFullScreen" code="FullScreen.class" width="1" height="1"></applet>
51 ```
53 ### Step 3
55 Add the following to the kiosk computer's java.policy file:
57 ```
58 grant codeBase "http://yourservername/*"
59
60    permission java.security.AllPermission;
62 ```
64 ### Step 4
66 Include the following JavaScript and assign the doLoad function to the onload event:
68 ```
69 var _appletFullScreen;
71 function doLoad()
73    _appletFullScreen = document.applets[0];
74    doFullScreen();
77 function doFullScreen()
79    if (_appletFullScreen && _appletFullScreen.fullScreen)
80    {
81 // Add an if statement to check whether document.body.clientHeight is not indicative of full screen mode
82       _appletFullScreen.fullScreen();
83    }
85 ```