<h2 id="manifest">Manifest</h2>
<p>You must declare the "input" permission
in the <a href="manifest.html">extension manifest</a>
to use the input.ime API.
For example:</p>
<pre>{
  "name": "My extension",
  ...
  <b>"permissions": [
    "input"
  ]</b>,
  ...
}</pre>

<h2 id="overview-examples">Examples</h2>

<p>
The following code creates an IME that converts typed letters to upper case.
</p>

<pre>
var context_id = -1;

chrome.input.ime.onFocus.addListener(function(context) {
  context_id = context.contextID;
});

chrome.input.ime.onKeyEventAsync.addListener(
  function(engineID, keyData) {
    if (keyData.type == "keydown" && keyData.key.match(/^[a-z]$/)) {
      chrome.input.ime.commitText({"contextID": context_id,
                                   "text": keyData.key.toUpperCase()});
      return true;
    } else {
      return false;
    }
  });
</pre>

<p>
For an example of using this API, see the
<a
  href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/input.ime/basic/">basic input.ime sample</a>.
For other examples and for help in viewing the source code, see
<a href="samples.html">Samples</a>.
</p>

<h2 id="manifest">Manifest</h2>
<p>You must declare the "input" permission
in the <a href="manifest.html">extension manifest</a>
to use the input.ime API.
For example:</p>
<pre>{
  "name": "My extension",
  ...
  <b>"permissions": [
    "input"
  ]</b>,
  ...
}</pre>

<h2 id="overview-examples">Examples</h2>

<p>
The following code creates an IME that converts typed letters to upper case.
</p>

<pre>
var context_id = -1;

chrome.input.ime.onFocus.addListener(function(context) {
  context_id = context.contextID;
});

chrome.input.ime.onKeyEvent.addListener(
  function(engineID, keyData) {
    if (keyData.type == "keydown" && keyData.key.match(/^[a-z]$/)) {
      chrome.input.ime.commitText({"contextID": context_id,
                                   "text": keyData.key.toUpperCase()});
      return true;
    } else {
      return false;
    }
  });
</pre>

<p>
For an example of using this API, see the
<a
  href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/input.ime/basic/">basic input.ime sample</a>.
For other examples and for help in viewing the source code, see
<a href="samples.html">Samples</a>.
</p>

Fix examples which uses typo function.
Fix examples which uses typo function.

BUG=

Review URL: https://chromiumcodereview.appspot.com/23452019

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@221581 0039d316-1c4b-4281-b951-d872f2087c98
