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

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

Issue 946623002: [Code cleanup]Remove webui keyboard mojo binding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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.h ('k') | ui/keyboard/keyboard.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 "ui/keyboard/keyboard.h" 5 #include "ui/keyboard/keyboard.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/keyboard/webui/vk_webui_controller.h"
11 10
12 namespace keyboard { 11 namespace keyboard {
13 12
14 static bool initialized = false; 13 static bool initialized = false;
15 14
16 void ResetKeyboardForTesting() { 15 void ResetKeyboardForTesting() {
17 initialized = false; 16 initialized = false;
18 } 17 }
19 18
20 void InitializeKeyboard() { 19 void InitializeKeyboard() {
21 if (initialized) 20 if (initialized)
22 return; 21 return;
23 initialized = true; 22 initialized = true;
24 23
25 base::FilePath pak_dir; 24 base::FilePath pak_dir;
26 PathService::Get(base::DIR_MODULE, &pak_dir); 25 PathService::Get(base::DIR_MODULE, &pak_dir);
27 base::FilePath pak_file = pak_dir.Append( 26 base::FilePath pak_file = pak_dir.Append(
28 FILE_PATH_LITERAL("keyboard_resources.pak")); 27 FILE_PATH_LITERAL("keyboard_resources.pak"));
29 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( 28 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
30 pak_file, ui::SCALE_FACTOR_100P); 29 pak_file, ui::SCALE_FACTOR_100P);
31 } 30 }
32 31
33 void InitializeWebUIBindings() {
34 CHECK(initialized);
35 base::FilePath content_resources;
36 DCHECK(PathService::Get(base::DIR_MODULE, &content_resources));
37 content_resources =
38 content_resources.Append(FILE_PATH_LITERAL("content_resources.pak"));
39 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
40 content_resources, ui::SCALE_FACTOR_100P);
41
42 content::WebUIControllerFactory::RegisterFactory(
43 VKWebUIControllerFactory::GetInstance());
44 }
45
46 } // namespace keyboard 32 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard.h ('k') | ui/keyboard/keyboard.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698