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

Side by Side Diff: chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc

Issue 10391044: retry 136193 - convert localStrings to loadTimeData for options page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 ChromeWebUIDataSource* source = 204 ChromeWebUIDataSource* source =
205 new ChromeWebUIDataSource(chrome::kChromeUIKeyboardOverlayHost); 205 new ChromeWebUIDataSource(chrome::kChromeUIKeyboardOverlayHost);
206 206
207 for (size_t i = 0; i < arraysize(kI18nContentToMessage); ++i) { 207 for (size_t i = 0; i < arraysize(kI18nContentToMessage); ++i) {
208 source->AddLocalizedString(kI18nContentToMessage[i].i18n_content, 208 source->AddLocalizedString(kI18nContentToMessage[i].i18n_content,
209 kI18nContentToMessage[i].message); 209 kI18nContentToMessage[i].message);
210 } 210 }
211 211
212 source->AddString("keyboardOverlayLearnMoreURL", UTF8ToUTF16(kLearnMoreURL)); 212 source->AddString("keyboardOverlayLearnMoreURL", UTF8ToUTF16(kLearnMoreURL));
213 source->set_json_path("strings.js"); 213 source->set_json_path("strings.js");
214 source->set_use_json_js_format_v2();
214 source->add_resource_path("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS); 215 source->add_resource_path("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS);
215 source->set_default_resource(IDR_KEYBOARD_OVERLAY_HTML); 216 source->set_default_resource(IDR_KEYBOARD_OVERLAY_HTML);
216 return source; 217 return source;
217 } 218 }
218 219
219 } // namespace 220 } // namespace
220 221
221 // The handler for Javascript messages related to the "keyboardoverlay" view. 222 // The handler for Javascript messages related to the "keyboardoverlay" view.
222 class KeyboardOverlayHandler 223 class KeyboardOverlayHandler
223 : public WebUIMessageHandler, 224 : public WebUIMessageHandler,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) 318 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui)
318 : WebDialogUI(web_ui) { 319 : WebDialogUI(web_ui) {
319 Profile* profile = Profile::FromWebUI(web_ui); 320 Profile* profile = Profile::FromWebUI(web_ui);
320 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); 321 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile);
321 web_ui->AddMessageHandler(handler); 322 web_ui->AddMessageHandler(handler);
322 323
323 // Set up the chrome://keyboardoverlay/ source. 324 // Set up the chrome://keyboardoverlay/ source.
324 ChromeURLDataManager::AddDataSource(profile, 325 ChromeURLDataManager::AddDataSource(profile,
325 CreateKeyboardOverlayUIHTMLSource()); 326 CreateKeyboardOverlayUIHTMLSource());
326 } 327 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/sync_setup_overlay.js ('k') | chrome/browser/ui/webui/chromeos/ui_account_tweaks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698