summaryrefslogtreecommitdiffstats
path: root/ui/keyboard/resources/api_adapter.js
blob: eb95e35cb8bffabd989881e518ab7b2dd9c36e87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

function logIfError() {
  if (chrome.runtime.lastError) {
    console.log(chrome.runtime.lastError);
  }
}

function insertText(text) {
  chrome.experimental.input.virtualKeyboard.insertText(text, logIfError);
}

function MoveCursor(swipe_direction, swipe_flags) {
  chrome.experimental.input.virtualKeyboard.moveCursor(swipe_direction,
                                                       swipe_flags);
}