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

Side by Side Diff: ui/keyboard/keyboard_ui_controller.cc

Issue 13652010: Add a virtual keyboard webui at chrome://keyboard/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix Created 7 years, 8 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
« no previous file with comments | « ui/keyboard/keyboard_ui_controller.h ('k') | ui/keyboard/resources/common.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/keyboard/keyboard_ui_controller.h"
6
7 #include "content/public/browser/browser_context.h"
8 #include "content/public/browser/web_contents.h"
9 #include "content/public/browser/web_ui.h"
10 #include "content/public/browser/web_ui_data_source.h"
11 #include "grit/keyboard_resources.h"
12 #include "ui/keyboard/keyboard_constants.h"
13
14 namespace {
15
16 content::WebUIDataSource* CreateKeyboardUIDataSource() {
17 content::WebUIDataSource* source =
18 content::WebUIDataSource::Create(keyboard::kKeyboardWebUIHost);
19
20 source->SetDefaultResource(IDR_KEYBOARD_INDEX);
21
22 source->AddResourcePath("main.css", IDR_KEYBOARD_MAIN_CSS);
23
24 source->AddResourcePath("main.js", IDR_KEYBOARD_MAIN_JS);
25 source->AddResourcePath("common.js", IDR_KEYBOARD_COMMON_JS);
26 source->AddResourcePath("layout_us.js", IDR_KEYBOARD_LAYOUT_US_JS);
27 source->AddResourcePath("images/chevron.svg", IDR_KEYBOARD_IMAGES_CHEVRON);
28 source->AddResourcePath("images/del.svg", IDR_KEYBOARD_IMAGES_DEL);
29 source->AddResourcePath("images/keyboard.svg", IDR_KEYBOARD_IMAGES_KEYBOARD);
30 source->AddResourcePath("images/mic.svg", IDR_KEYBOARD_IMAGES_MIC);
31 source->AddResourcePath("images/ret.svg", IDR_KEYBOARD_IMAGES_RET);
32 source->AddResourcePath("images/shift_down.svg",
33 IDR_KEYBOARD_IMAGES_SHIFT_DOWN);
34 source->AddResourcePath("images/shift.svg", IDR_KEYBOARD_IMAGES_SHIFT);
35 source->AddResourcePath("images/tab.svg", IDR_KEYBOARD_IMAGES_TAB);
36
37 return source;
38 }
39
40 } // namespace
41
42 namespace keyboard {
43
44 KeyboardUIController::KeyboardUIController(content::WebUI* web_ui)
45 : WebUIController(web_ui) {
46 content::BrowserContext* browser_context =
47 web_ui->GetWebContents()->GetBrowserContext();
48 content::WebUIDataSource::Add(
49 browser_context,
50 CreateKeyboardUIDataSource());
51 }
52
53 KeyboardUIController::~KeyboardUIController() {}
54
55 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_ui_controller.h ('k') | ui/keyboard/resources/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698