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

Unified Diff: chrome/browser/extensions/api/input/input.cc

Issue 13957005: Move KeyIdentifier->KeyEvent conversion to src/ui/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gyp 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/key_identifier_conversion_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/input/input.cc
diff --git a/chrome/browser/extensions/api/input/input.cc b/chrome/browser/extensions/api/input/input.cc
index 346489d2864c5b8def0c768dc5d5a624432955c0..77d1d64111b4effd0635452f762c06bff9879676 100644
--- a/chrome/browser/extensions/api/input/input.cc
+++ b/chrome/browser/extensions/api/input/input.cc
@@ -11,10 +11,11 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_function_registry.h"
-#include "chrome/browser/extensions/key_identifier_conversion_views.h"
#include "chrome/browser/ui/top_level_widget.h"
#include "chrome/common/chrome_notification_types.h"
+#include "content/public/browser/browser_thread.h"
#include "ui/base/events/event.h"
+#include "ui/base/events/key_identifier_conversion.h"
#if defined(USE_ASH) && defined(USE_AURA)
#include "ash/shell.h"
@@ -84,7 +85,9 @@ bool SendKeyboardEventInputFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args->GetString(kKeyIdentifier, &identifier));
TrimWhitespaceASCII(identifier, TRIM_ALL, &identifier);
- const ui::KeyEvent& prototype_event = KeyEventFromKeyIdentifier(identifier);
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ const ui::KeyEvent& prototype_event =
+ ui::KeyEventFromKeyIdentifier(identifier);
uint16 character = 0;
if (prototype_event.key_code() == ui::VKEY_UNKNOWN) {
// Check if |identifier| is "U+NNNN" format.
« no previous file with comments | « no previous file | chrome/browser/extensions/key_identifier_conversion_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698