summaryrefslogtreecommitdiffstats
path: root/ui/keyboard
diff options
context:
space:
mode:
authorbshe <bshe@chromium.org>2015-02-23 09:03:03 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-23 17:03:34 +0000
commit2b07a075b8b8ce3c5c2a08c000cd0c7118a937c3 (patch)
tree8a0835af4bc958ea1568b3817de45596321c74a2 /ui/keyboard
parent4f02f4cd6c8b9087ecd286c905b15e253d88d82f (diff)
downloadchromium_src-2b07a075b8b8ce3c5c2a08c000cd0c7118a937c3.zip
chromium_src-2b07a075b8b8ce3c5c2a08c000cd0c7118a937c3.tar.gz
chromium_src-2b07a075b8b8ce3c5c2a08c000cd0c7118a937c3.tar.bz2
[Code cleanup]Remove webui keyboard mojo binding
BUG=455057 TEST=none Review URL: https://codereview.chromium.org/946623002 Cr-Commit-Position: refs/heads/master@{#317598}
Diffstat (limited to 'ui/keyboard')
-rw-r--r--ui/keyboard/BUILD.gn23
-rw-r--r--ui/keyboard/keyboard.cc14
-rw-r--r--ui/keyboard/keyboard.gyp23
-rw-r--r--ui/keyboard/keyboard.h1
-rw-r--r--ui/keyboard/keyboard_resources.grd2
-rw-r--r--ui/keyboard/keyboard_util.cc1
-rw-r--r--ui/keyboard/resources/index.html1
-rw-r--r--ui/keyboard/webui/DEPS3
-rw-r--r--ui/keyboard/webui/keyboard.mojom21
-rw-r--r--ui/keyboard/webui/vk_mojo_handler.cc127
-rw-r--r--ui/keyboard/webui/vk_mojo_handler.h50
-rw-r--r--ui/keyboard/webui/vk_webui_controller.cc118
-rw-r--r--ui/keyboard/webui/vk_webui_controller.h72
13 files changed, 1 insertions, 455 deletions
diff --git a/ui/keyboard/BUILD.gn b/ui/keyboard/BUILD.gn
index bdb0775..b504ba2 100644
--- a/ui/keyboard/BUILD.gn
+++ b/ui/keyboard/BUILD.gn
@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//testing/test.gni")
-import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
import("//third_party/google_input_tools/closure.gni")
import("//third_party/google_input_tools/inputview.gni")
import("//tools/grit/grit_rule.gni")
@@ -26,27 +25,17 @@ component("keyboard") {
"keyboard_switches.h",
"keyboard_util.cc",
"keyboard_util.h",
- "webui/vk_mojo_handler.cc",
- "webui/vk_mojo_handler.h",
- "webui/vk_webui_controller.cc",
- "webui/vk_webui_controller.h",
]
defines = [ "KEYBOARD_IMPLEMENTATION" ]
deps = [
- ":keyboard_mojom_bindings",
":resources",
"//base",
"//base/third_party/dynamic_annotations",
"//content/public/browser",
"//content/public/common",
- "//mojo/environment:chromium",
"//skia",
- "//third_party/mojo/src/mojo/edk/js",
- "//third_party/mojo/src/mojo/edk/system",
- "//third_party/mojo/src/mojo/public/cpp/bindings",
- "//third_party/mojo/src/mojo/public/cpp/system",
"//ui/aura",
"//ui/base",
"//ui/base/ime",
@@ -60,13 +49,6 @@ component("keyboard") {
]
}
-# GYP version: ui/keyboard/keyboard.gyp:keyboard_mojom_bindings
-mojom("keyboard_mojom_bindings") {
- sources = [
- "webui/keyboard.mojom",
- ]
-}
-
grit("resources_grit") {
source = "keyboard_resources.grd"
outputs = [
@@ -78,20 +60,15 @@ grit("resources_grit") {
input_tools_root_dir = "//third_party/google_input_tools/src/chrome/os"
inputview_gen_js = "$root_gen_dir/ui/keyboard/resources/inputview.js"
- keyboard_mojom_gen_js = "$root_gen_dir/ui/keyboard/webui/keyboard.mojom.js"
grit_flags = [
"-E",
"input_tools_root_dir=" + rebase_path(input_tools_root_dir, "."),
"-E",
"inputview_gen_js=" + rebase_path(inputview_gen_js, root_build_dir),
- "-E",
- "keyboard_mojom_gen_js=" +
- rebase_path(keyboard_mojom_gen_js, root_build_dir),
]
deps = [
":inputview",
- ":keyboard_mojom_bindings",
]
}
diff --git a/ui/keyboard/keyboard.cc b/ui/keyboard/keyboard.cc
index 2d4de13..436b935 100644
--- a/ui/keyboard/keyboard.cc
+++ b/ui/keyboard/keyboard.cc
@@ -7,7 +7,6 @@
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/keyboard/webui/vk_webui_controller.h"
namespace keyboard {
@@ -30,17 +29,4 @@ void InitializeKeyboard() {
pak_file, ui::SCALE_FACTOR_100P);
}
-void InitializeWebUIBindings() {
- CHECK(initialized);
- base::FilePath content_resources;
- DCHECK(PathService::Get(base::DIR_MODULE, &content_resources));
- content_resources =
- content_resources.Append(FILE_PATH_LITERAL("content_resources.pak"));
- ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
- content_resources, ui::SCALE_FACTOR_100P);
-
- content::WebUIControllerFactory::RegisterFactory(
- VKWebUIControllerFactory::GetInstance());
-}
-
} // namespace keyboard
diff --git a/ui/keyboard/keyboard.gyp b/ui/keyboard/keyboard.gyp
index c2c28a5..6570908 100644
--- a/ui/keyboard/keyboard.gyp
+++ b/ui/keyboard/keyboard.gyp
@@ -5,24 +5,14 @@
{
'variables': {
'chromium_code': 1,
- 'keyboard_mojom_gen_js': '<(SHARED_INTERMEDIATE_DIR)/ui/keyboard/webui/keyboard.mojom.js',
'input_tools_root_dir': '../../third_party/google_input_tools/src/chrome/os',
'inputview_gen_js': '<(SHARED_INTERMEDIATE_DIR)/ui/keyboard/resources/inputview.js',
},
- 'targets': [
- {
- 'target_name': 'keyboard_mojom_bindings',
- 'type': 'none',
- 'sources': [
- 'webui/keyboard.mojom',
- ],
- 'includes': [ '../../third_party/mojo/mojom_bindings_generator.gypi' ],
- },
+ 'targets': [
{
# GN version: //ui/keyboard:resources
'target_name': 'keyboard_resources',
'dependencies': [
- 'keyboard_mojom_bindings',
'../../third_party/google_input_tools/inputview.gyp:inputview',
],
'type': 'none',
@@ -35,7 +25,6 @@
'variables': {
'grit_grd_file': 'keyboard_resources.grd',
'grit_additional_defines': [
- '-E', 'keyboard_mojom_gen_js=<(keyboard_mojom_gen_js)',
'-E', 'input_tools_root_dir=<(input_tools_root_dir)',
'-E', 'inputview_gen_js=<(inputview_gen_js)',
],
@@ -62,11 +51,7 @@
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../../content/content.gyp:content_browser',
'../../ipc/ipc.gyp:ipc',
- '../../mojo/mojo_base.gyp:mojo_environment_chromium',
'../../skia/skia.gyp:skia',
- '../../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
- '../../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
- '../../third_party/mojo/mojo_public.gyp:mojo_js_bindings',
'../../url/url.gyp:url_lib',
'../aura/aura.gyp:aura',
'../base/ime/ui_base_ime.gyp:ui_base_ime',
@@ -77,14 +62,12 @@
'../gfx/gfx.gyp:gfx',
'../gfx/gfx.gyp:gfx_geometry',
'../wm/wm.gyp:wm',
- 'keyboard_mojom_bindings',
'keyboard_resources',
],
'defines': [
'KEYBOARD_IMPLEMENTATION',
],
'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/ui/keyboard/webui/keyboard.mojom.cc',
'keyboard.cc',
'keyboard.h',
'keyboard_constants.cc',
@@ -101,10 +84,6 @@
'keyboard_switches.h',
'keyboard_util.cc',
'keyboard_util.h',
- 'webui/vk_mojo_handler.cc',
- 'webui/vk_mojo_handler.h',
- 'webui/vk_webui_controller.cc',
- 'webui/vk_webui_controller.h',
]
},
{
diff --git a/ui/keyboard/keyboard.h b/ui/keyboard/keyboard.h
index a13cac4..a0aed8a 100644
--- a/ui/keyboard/keyboard.h
+++ b/ui/keyboard/keyboard.h
@@ -13,7 +13,6 @@ namespace keyboard {
// for loading resources used in for the virtual keyboard. This becomes a no-op
// after the first call.
KEYBOARD_EXPORT void InitializeKeyboard();
-KEYBOARD_EXPORT void InitializeWebUIBindings();
// Resets the keyboard to an uninitialized state. Required for
// BrowserWithTestWindowTest tests as they tear down the controller factory
diff --git a/ui/keyboard/keyboard_resources.grd b/ui/keyboard/keyboard_resources.grd
index 616109e..0b1f700bb 100644
--- a/ui/keyboard/keyboard_resources.grd
+++ b/ui/keyboard/keyboard_resources.grd
@@ -51,8 +51,6 @@
<include name="IDR_KEYBOARD_INPUTVIEW_ADAPTER" file="resources/inputview_adapter.js" type="BINDATA" />
<include name="IDR_KEYBOARD_INPUTVIEW_CSS" file="${input_tools_root_dir}/inputview/common.css" type="BINDATA" />
<include name="IDR_KEYBOARD_INPUTVIEW_JS" file="${inputview_gen_js}" use_base_dir="false" type="BINDATA" />
- <include name="IDR_KEYBOARD_MOJO_JS" file="resources/keyboard_mojo.js" flattenhtml="true" type="BINDATA" />
- <include name="IDR_KEYBOARD_MOJO_GEN_JS" file="${keyboard_mojom_gen_js}" use_base_dir="false" type="BINDATA" />
<include name="IDR_KEYBOARD_LOCALES_EN" file="resources/locales/en.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_KEYBOARD_LAYOUTS_101" file="${input_tools_root_dir}/inputview/layouts/101kbd_layout.js" type="BINDATA"/>
<include name="IDR_KEYBOARD_LAYOUTS_COMPACT_QWERTY" file="${input_tools_root_dir}/inputview/layouts/compactkbd_qwerty_layout.js" type="BINDATA" />
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc
index 6ffeb34..4054a37 100644
--- a/ui/keyboard/keyboard_util.cc
+++ b/ui/keyboard/keyboard_util.cc
@@ -360,7 +360,6 @@ const GritResourceMap* GetKeyboardExtensionResources(size_t* size) {
IDR_KEYBOARD_LAYOUTS_COMPACT_NUMBERPAD},
{"keyboard/inputview_layouts/emoji.js", IDR_KEYBOARD_LAYOUTS_EMOJI},
{"keyboard/inputview_layouts/handwriting.js", IDR_KEYBOARD_LAYOUTS_HWT},
- {"keyboard/keyboard_mojo.js", IDR_KEYBOARD_MOJO_JS},
{"keyboard/manifest.json", IDR_KEYBOARD_MANIFEST},
{"keyboard/sounds/keypress-delete.wav",
IDR_KEYBOARD_SOUNDS_KEYPRESS_DELETE},
diff --git a/ui/keyboard/resources/index.html b/ui/keyboard/resources/index.html
index 2f127fc..ad3c9fe 100644
--- a/ui/keyboard/resources/index.html
+++ b/ui/keyboard/resources/index.html
@@ -14,7 +14,6 @@
font-size: 0;
}
</style>
- <script src="keyboard_mojo.js"></script>
<script src="inputview.js"></script>
<script src="locales/en.js"></script>
<script src="inputview_adapter.js"></script>
diff --git a/ui/keyboard/webui/DEPS b/ui/keyboard/webui/DEPS
deleted file mode 100644
index 5f8633a..0000000
--- a/ui/keyboard/webui/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-include_rules = [
- "+third_party/mojo/src/mojo/public",
-]
diff --git a/ui/keyboard/webui/keyboard.mojom b/ui/keyboard/webui/keyboard.mojom
deleted file mode 100644
index 889f75c..0000000
--- a/ui/keyboard/webui/keyboard.mojom
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2015 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.
-
-module keyboard;
-
-interface KeyboardUIHandlerMojo {
- SetTextInputTypeObserver(TextInputTypeObserver observer);
-
- SendKeyEvent(string? event_type,
- int32 char_value,
- int32 key_code,
- string? key_name,
- int32 modifiers);
-
- HideKeyboard();
-};
-
-interface TextInputTypeObserver {
- OnTextInputTypeChanged(string? input_type);
-};
diff --git a/ui/keyboard/webui/vk_mojo_handler.cc b/ui/keyboard/webui/vk_mojo_handler.cc
deleted file mode 100644
index f40e9db..0000000
--- a/ui/keyboard/webui/vk_mojo_handler.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2014 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.
-
-#include "ui/keyboard/webui/vk_mojo_handler.h"
-
-#include "ui/aura/window.h"
-#include "ui/base/ime/input_method.h"
-#include "ui/base/ime/text_input_client.h"
-#include "ui/keyboard/keyboard_controller.h"
-#include "ui/keyboard/keyboard_controller_proxy.h"
-#include "ui/keyboard/keyboard_util.h"
-#include "ui/keyboard/webui/keyboard.mojom.h"
-
-namespace keyboard {
-
-VKMojoHandler::VKMojoHandler(
- mojo::InterfaceRequest<KeyboardUIHandlerMojo> request)
- : binding_(this, request.Pass()) {
- GetInputMethod()->AddObserver(this);
- OnTextInputStateChanged(GetInputMethod()->GetTextInputClient());
-}
-
-VKMojoHandler::~VKMojoHandler() {
- GetInputMethod()->RemoveObserver(this);
-}
-
-ui::InputMethod* VKMojoHandler::GetInputMethod() {
- return KeyboardController::GetInstance()->proxy()->GetInputMethod();
-}
-
-void VKMojoHandler::SetTextInputTypeObserver(
- TextInputTypeObserverPtr observer) {
- text_input_type_observer_ = observer.Pass();
-}
-
-void VKMojoHandler::SendKeyEvent(const mojo::String& event_type,
- int32_t char_value,
- int32_t key_code,
- const mojo::String& key_name,
- int32_t modifiers) {
- aura::Window* window =
- KeyboardController::GetInstance()->GetContainerWindow();
- std::string type = event_type.To<std::string>();
- std::string name = key_name.To<std::string>();
- keyboard::SendKeyEvent(
- type, char_value, key_code, name, modifiers, window->GetHost());
-}
-
-void VKMojoHandler::HideKeyboard() {
- KeyboardController::GetInstance()->HideKeyboard(
- KeyboardController::HIDE_REASON_MANUAL);
-}
-
-void VKMojoHandler::OnTextInputTypeChanged(const ui::TextInputClient* client) {
-}
-
-void VKMojoHandler::OnFocus() {
-}
-
-void VKMojoHandler::OnBlur() {
-}
-
-void VKMojoHandler::OnCaretBoundsChanged(const ui::TextInputClient* client) {
-}
-
-void VKMojoHandler::OnTextInputStateChanged(
- const ui::TextInputClient* text_client) {
- if (!text_input_type_observer_)
- return;
-
- ui::TextInputType type =
- text_client ? text_client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE;
- std::string type_name = "none";
- switch (type) {
- case ui::TEXT_INPUT_TYPE_NONE:
- type_name = "none";
- break;
-
- case ui::TEXT_INPUT_TYPE_PASSWORD:
- type_name = "password";
- break;
-
- case ui::TEXT_INPUT_TYPE_EMAIL:
- type_name = "email";
- break;
-
- case ui::TEXT_INPUT_TYPE_NUMBER:
- type_name = "number";
- break;
-
- case ui::TEXT_INPUT_TYPE_TELEPHONE:
- type_name = "tel";
- break;
-
- case ui::TEXT_INPUT_TYPE_URL:
- type_name = "url";
- break;
-
- case ui::TEXT_INPUT_TYPE_DATE:
- type_name = "date";
- break;
-
- case ui::TEXT_INPUT_TYPE_TEXT:
- case ui::TEXT_INPUT_TYPE_SEARCH:
- case ui::TEXT_INPUT_TYPE_DATE_TIME:
- case ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL:
- case ui::TEXT_INPUT_TYPE_MONTH:
- case ui::TEXT_INPUT_TYPE_TIME:
- case ui::TEXT_INPUT_TYPE_WEEK:
- case ui::TEXT_INPUT_TYPE_TEXT_AREA:
- case ui::TEXT_INPUT_TYPE_CONTENT_EDITABLE:
- case ui::TEXT_INPUT_TYPE_DATE_TIME_FIELD:
- type_name = "text";
- break;
- }
- text_input_type_observer_->OnTextInputTypeChanged(type_name);
-}
-
-void VKMojoHandler::OnInputMethodDestroyed(
- const ui::InputMethod* input_method) {
-}
-
-void VKMojoHandler::OnShowImeIfNeeded() {
-}
-
-} // namespace keyboard
diff --git a/ui/keyboard/webui/vk_mojo_handler.h b/ui/keyboard/webui/vk_mojo_handler.h
deleted file mode 100644
index 4afb1e1..0000000
--- a/ui/keyboard/webui/vk_mojo_handler.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_
-#define UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_
-
-#include "base/macros.h"
-#include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
-#include "ui/base/ime/input_method_observer.h"
-#include "ui/keyboard/webui/keyboard.mojom.h"
-
-namespace keyboard {
-
-class VKMojoHandler : public KeyboardUIHandlerMojo,
- public ui::InputMethodObserver {
- public:
- explicit VKMojoHandler(mojo::InterfaceRequest<KeyboardUIHandlerMojo> request);
- ~VKMojoHandler() override;
-
- private:
- ui::InputMethod* GetInputMethod();
-
- // KeyboardUIHandlerMojo:
- void SetTextInputTypeObserver(TextInputTypeObserverPtr observer) override;
- void SendKeyEvent(const mojo::String& event_type,
- int32_t char_value,
- int32_t key_code,
- const mojo::String& key_name,
- int32_t modifiers) override;
- void HideKeyboard() override;
-
- // ui::InputMethodObserver:
- void OnTextInputTypeChanged(const ui::TextInputClient* client) override;
- void OnFocus() override;
- void OnBlur() override;
- void OnCaretBoundsChanged(const ui::TextInputClient* client) override;
- void OnTextInputStateChanged(const ui::TextInputClient* text_client) override;
- void OnInputMethodDestroyed(const ui::InputMethod* input_method) override;
- void OnShowImeIfNeeded() override;
-
- TextInputTypeObserverPtr text_input_type_observer_;
- mojo::Binding<KeyboardUIHandlerMojo> binding_;
-
- DISALLOW_COPY_AND_ASSIGN(VKMojoHandler);
-};
-
-} // namespace keyboard
-
-#endif // UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_
diff --git a/ui/keyboard/webui/vk_webui_controller.cc b/ui/keyboard/webui/vk_webui_controller.cc
deleted file mode 100644
index 9a4688d..0000000
--- a/ui/keyboard/webui/vk_webui_controller.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2014 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.
-
-#include "ui/keyboard/webui/vk_webui_controller.h"
-
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
-#include "content/public/browser/render_frame_host.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_ui_data_source.h"
-#include "content/public/common/service_registry.h"
-#include "grit/keyboard_resources.h"
-#include "grit/keyboard_resources_map.h"
-#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h"
-#include "third_party/mojo/src/mojo/public/cpp/system/core.h"
-#include "ui/keyboard/keyboard_constants.h"
-#include "ui/keyboard/keyboard_util.h"
-#include "ui/keyboard/webui/vk_mojo_handler.h"
-
-namespace keyboard {
-
-namespace {
-
-content::WebUIDataSource* CreateKeyboardUIDataSource() {
- content::WebUIDataSource* source =
- content::WebUIDataSource::Create(kKeyboardHost);
-
- size_t count = 0;
- const GritResourceMap* resources = GetKeyboardExtensionResources(&count);
- source->SetDefaultResource(IDR_KEYBOARD_INDEX);
-
- const std::string keyboard_host = base::StringPrintf("%s/", kKeyboardHost);
- for (size_t i = 0; i < count; ++i) {
- size_t offset = 0;
- // The webui URL needs to skip the 'keyboard/' at the front of the resource
- // names, since it is part of the data-source name.
- if (StartsWithASCII(std::string(resources[i].name), keyboard_host, false))
- offset = keyboard_host.length();
- source->AddResourcePath(resources[i].name + offset, resources[i].value);
- }
- return source;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-// VKWebUIController:
-
-VKWebUIController::VKWebUIController(content::WebUI* web_ui)
- : WebUIController(web_ui), weak_factory_(this) {
- content::BrowserContext* browser_context =
- web_ui->GetWebContents()->GetBrowserContext();
- content::WebUIDataSource::Add(browser_context, CreateKeyboardUIDataSource());
- content::WebUIDataSource::AddMojoDataSource(browser_context)->AddResourcePath(
- "ui/keyboard/webui/keyboard.mojom", IDR_KEYBOARD_MOJO_GEN_JS);
-}
-
-VKWebUIController::~VKWebUIController() {
-}
-
-void VKWebUIController::RenderViewCreated(content::RenderViewHost* host) {
- host->GetMainFrame()->GetServiceRegistry()->AddService<KeyboardUIHandlerMojo>(
- base::Bind(&VKWebUIController::CreateAndStoreUIHandler,
- weak_factory_.GetWeakPtr()));
-}
-
-void VKWebUIController::CreateAndStoreUIHandler(
- mojo::InterfaceRequest<KeyboardUIHandlerMojo> request) {
- ui_handler_ = make_scoped_ptr(new VKMojoHandler(request.Pass()));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// VKWebUIControllerFactory:
-
-content::WebUI::TypeID VKWebUIControllerFactory::GetWebUIType(
- content::BrowserContext* browser_context,
- const GURL& url) const {
- if (url == GURL(kKeyboardURL))
- return const_cast<VKWebUIControllerFactory*>(this);
-
- return content::WebUI::kNoWebUI;
-}
-
-bool VKWebUIControllerFactory::UseWebUIForURL(
- content::BrowserContext* browser_context,
- const GURL& url) const {
- return GetWebUIType(browser_context, url) != content::WebUI::kNoWebUI;
-}
-
-bool VKWebUIControllerFactory::UseWebUIBindingsForURL(
- content::BrowserContext* browser_context,
- const GURL& url) const {
- return UseWebUIForURL(browser_context, url);
-}
-
-content::WebUIController* VKWebUIControllerFactory::CreateWebUIControllerForURL(
- content::WebUI* web_ui,
- const GURL& url) const {
- if (url == GURL(kKeyboardURL))
- return new VKWebUIController(web_ui);
- return NULL;
-}
-
-// static
-VKWebUIControllerFactory* VKWebUIControllerFactory::GetInstance() {
- return Singleton<VKWebUIControllerFactory>::get();
-}
-
-// protected
-VKWebUIControllerFactory::VKWebUIControllerFactory() {
-}
-
-VKWebUIControllerFactory::~VKWebUIControllerFactory() {
-}
-
-} // namespace keyboard
diff --git a/ui/keyboard/webui/vk_webui_controller.h b/ui/keyboard/webui/vk_webui_controller.h
deleted file mode 100644
index e1b1876..0000000
--- a/ui/keyboard/webui/vk_webui_controller.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef UI_KEYBOARD_WEBUI_VK_WEBUI_CONTROLLER_H_
-#define UI_KEYBOARD_WEBUI_VK_WEBUI_CONTROLLER_H_
-
-#include "base/macros.h"
-#include "base/memory/singleton.h"
-#include "base/memory/weak_ptr.h"
-#include "content/public/browser/web_ui_controller.h"
-#include "content/public/browser/web_ui_controller_factory.h"
-#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
-#include "third_party/mojo/src/mojo/public/cpp/system/core.h"
-#include "ui/keyboard/keyboard_export.h"
-#include "ui/keyboard/webui/keyboard.mojom.h"
-
-namespace content {
-class WebUIDataSource;
-}
-
-namespace keyboard {
-
-class VKMojoHandler;
-
-class VKWebUIController : public content::WebUIController {
- public:
- explicit VKWebUIController(content::WebUI* web_ui);
- ~VKWebUIController() override;
-
- private:
- void CreateAndStoreUIHandler(
- mojo::InterfaceRequest<KeyboardUIHandlerMojo> request);
-
- // content::WebUIController:
- void RenderViewCreated(content::RenderViewHost* host) override;
-
- scoped_ptr<VKMojoHandler> ui_handler_;
- base::WeakPtrFactory<VKWebUIController> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(VKWebUIController);
-};
-
-class KEYBOARD_EXPORT VKWebUIControllerFactory
- : public content::WebUIControllerFactory {
- public:
- // WebUIControllerFactory:
- content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
- const GURL& url) const override;
- bool UseWebUIForURL(content::BrowserContext* browser_context,
- const GURL& url) const override;
- bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
- const GURL& url) const override;
- content::WebUIController* CreateWebUIControllerForURL(
- content::WebUI* web_ui,
- const GURL& url) const override;
-
- static VKWebUIControllerFactory* GetInstance();
-
- protected:
- VKWebUIControllerFactory();
- ~VKWebUIControllerFactory() override;
-
- private:
- friend struct DefaultSingletonTraits<VKWebUIControllerFactory>;
-
- DISALLOW_COPY_AND_ASSIGN(VKWebUIControllerFactory);
-};
-
-} // namespace keyboard
-
-#endif // UI_KEYBOARD_WEBUI_VK_WEBUI_CONTROLLER_H_