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

Unified Diff: chrome/browser/resources/options/language_dictionary_overlay.js

Issue 11362063: Editing the custom spelling dictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Exclude custom dictionary WebUI from mac Created 8 years, 1 month 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
Index: chrome/browser/resources/options/language_dictionary_overlay.js
diff --git a/chrome/browser/resources/options/language_dictionary_overlay.js b/chrome/browser/resources/options/language_dictionary_overlay.js
new file mode 100644
index 0000000000000000000000000000000000000000..653df8855798fc0d46ad0765af321fbab7b3572e
--- /dev/null
+++ b/chrome/browser/resources/options/language_dictionary_overlay.js
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 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.
+
+cr.define('options', function() {
+ var OptionsPage = options.OptionsPage;
+ var ArrayDataModel = cr.ui.ArrayDataModel;
+ var DictionaryWordsList = options.dictionary_words.DictionaryWordsList;
+
+ function EditDictionaryOverlay() {
+ OptionsPage.call(this, 'editDictionary',
+ loadTimeData.getString('languageDictionaryOverlayPage'),
+ 'language-dictionary-overlay-page');
+ }
+
+ cr.addSingletonGetter(EditDictionaryOverlay);
+
+ EditDictionaryOverlay.prototype = {
+ __proto__: OptionsPage.prototype,
+
+ wordList_: null,
+
+ initializePage: function() {
+ OptionsPage.prototype.initializePage.call(this);
+ this.wordList_ = $('language-dictionary-overlay-word-list');
+ DictionaryWordsList.decorate(this.wordList_);
+ this.wordList_.autoExpands = true;
+ $('language-dictionary-overlay-done-button').onclick = function(e) {
+ OptionsPage.closeOverlay();
+ };
+ },
+
+ didShowPage: function() {
+ chrome.send('refreshDictionaryWords');
+ },
+
+ setWordList_: function(entries) {
+ entries.push('');
+ this.wordList_.dataModel = new ArrayDataModel(entries);
+ },
+ };
+
+ EditDictionaryOverlay.setWordList = function(entries) {
+ EditDictionaryOverlay.getInstance().setWordList_(entries);
+ };
+
+ return {
+ EditDictionaryOverlay: EditDictionaryOverlay
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698