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

Unified Diff: athena/virtual_keyboard/vk_message_handler.cc

Issue 328303008: athena: Use mojo to provide the bindings for the virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/virtual_keyboard/vk_message_handler.h ('k') | athena/virtual_keyboard/vk_webui_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/virtual_keyboard/vk_message_handler.cc
diff --git a/athena/virtual_keyboard/vk_message_handler.cc b/athena/virtual_keyboard/vk_message_handler.cc
deleted file mode 100644
index fbd1e79495ac4db2802985d84c5ec5c2e010158b..0000000000000000000000000000000000000000
--- a/athena/virtual_keyboard/vk_message_handler.cc
+++ /dev/null
@@ -1,57 +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 "athena/virtual_keyboard/vk_message_handler.h"
-
-#include "athena/screen/public/screen_manager.h"
-#include "base/bind.h"
-#include "base/values.h"
-#include "content/public/browser/web_ui.h"
-#include "ui/keyboard/keyboard_controller.h"
-#include "ui/keyboard/keyboard_util.h"
-
-namespace athena {
-
-VKMessageHandler::VKMessageHandler() {
-}
-VKMessageHandler::~VKMessageHandler() {
-}
-
-void VKMessageHandler::RegisterMessages() {
- web_ui()->RegisterMessageCallback(
- "sendKeyEvent",
- base::Bind(&VKMessageHandler::SendKeyEvent, base::Unretained(this)));
- web_ui()->RegisterMessageCallback(
- "hideKeyboard",
- base::Bind(&VKMessageHandler::HideKeyboard, base::Unretained(this)));
-}
-
-void VKMessageHandler::SendKeyEvent(const base::ListValue* params) {
- std::string type;
- int char_value;
- int key_code;
- std::string key_name;
- int modifiers;
- if (!params->GetString(0, &type))
- return;
- if (!params->GetInteger(1, &char_value))
- return;
- if (!params->GetInteger(2, &key_code))
- return;
- if (!params->GetString(3, &key_name))
- return;
- if (!params->GetInteger(4, &modifiers))
- return;
-
- aura::Window* window = ScreenManager::Get()->GetContext();
- keyboard::SendKeyEvent(
- type, char_value, key_code, key_name, modifiers, window->GetHost());
-}
-
-void VKMessageHandler::HideKeyboard(const base::ListValue* params) {
- keyboard::KeyboardController::GetInstance()->HideKeyboard(
- keyboard::KeyboardController::HIDE_REASON_MANUAL);
-}
-
-} // namespace athena
« no previous file with comments | « athena/virtual_keyboard/vk_message_handler.h ('k') | athena/virtual_keyboard/vk_webui_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698