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

Unified Diff: chrome/browser/resources/keyboard/ime.js

Issue 7084033: Catch exception when register extension with inputUI. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refine comment Created 9 years, 7 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 | « no previous file | chrome/browser/resources/keyboard/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/keyboard/ime.js
diff --git a/chrome/browser/resources/keyboard/ime.js b/chrome/browser/resources/keyboard/ime.js
index 3b7abd59723acd7292a029bec637410f4a952356..80c89937b8970e96da7d25e1ec3f6dd830b9a0ec 100644
--- a/chrome/browser/resources/keyboard/ime.js
+++ b/chrome/browser/resources/keyboard/ime.js
@@ -189,10 +189,6 @@ ImeUi.prototype = {
* @return {void}
*/
candidateClicked: function(index) {
- if (!chrome.experimental) {
- console.log('candidateClicked(' + index + '): experimental is disabled.');
- return;
- }
chrome.experimental.inputUI.candidateClicked(index, 1);
},
@@ -201,10 +197,6 @@ ImeUi.prototype = {
* @return {void}
*/
pageUp: function() {
- if (!chrome.experimental) {
- console.log('pageUp: experimental is disabled.');
- return;
- }
chrome.experimental.inputUI.pageUp();
},
@@ -213,10 +205,6 @@ ImeUi.prototype = {
* @return {void}
*/
pageDown: function() {
- if (!chrome.experimental) {
- console.log('pageDown: experimental is diabled.');
- return;
- }
chrome.experimental.inputUI.pageDown();
},
};
@@ -229,8 +217,16 @@ var imeui = null;
* @return {void}
*/
function initIme(element) {
- // imeui has been initialized.
if (imeui) {
+ // ime ui has been initialized.
+ return;
+ }
+
+ try {
+ // Register self to receive input method UI events.
+ chrome.experimental.inputUI.register();
+ } catch (e) {
+ // The ime is not enabled in chromium.
return;
}
@@ -243,12 +239,6 @@ function initIme(element) {
clearingDiv.style.clear = 'both';
element.appendChild(clearingDiv);
- if (!chrome.experimental)
- return;
-
- // Register self to receive input method UI events.
- chrome.experimental.inputUI.register();
-
// Install events handlers.
chrome.experimental.inputUI.onSetCursorLocation.addListener(
function(x, y, w, h) {
« no previous file with comments | « no previous file | chrome/browser/resources/keyboard/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698