OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_input_api.h" | 5 #include "chrome/browser/extensions/extension_input_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/extensions/key_identifier_conversion_views.h" | 11 #include "chrome/browser/extensions/key_identifier_conversion_views.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
14 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
15 #include "views/events/event.h" | 15 #include "views/events/event.h" |
16 #include "views/ime/input_method.h" | 16 #include "views/ime/input_method.h" |
17 #include "views/widget/widget.h" | 17 #include "views/widget/widget.h" |
18 | 18 |
19 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 19 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
20 #include "chrome/browser/chromeos/cros/cros_library.h" | 20 #include "chrome/browser/chromeos/cros/cros_library.h" |
21 #include "chrome/browser/chromeos/cros/input_method_library.h" | 21 #include "chrome/browser/chromeos/cros/input_method_library.h" |
22 #include "chrome/browser/chromeos/login/dom_login_display.h" | 22 #include "chrome/browser/chromeos/login/webui_login_display.h" |
23 #endif | 23 #endif |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 // Keys. | 27 // Keys. |
28 const char kType[] = "type"; | 28 const char kType[] = "type"; |
29 const char kKeyIdentifier[] = "keyIdentifier"; | 29 const char kKeyIdentifier[] = "keyIdentifier"; |
30 const char kAlt[] = "altKey"; | 30 const char kAlt[] = "altKey"; |
31 const char kCtrl[] = "ctrlKey"; | 31 const char kCtrl[] = "ctrlKey"; |
32 const char kMeta[] = "metaKey"; | 32 const char kMeta[] = "metaKey"; |
(...skipping 22 matching lines...) Expand all Loading... |
55 } | 55 } |
56 | 56 |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 void InputFunction::Run() { | 59 void InputFunction::Run() { |
60 SendResponse(RunImpl()); | 60 SendResponse(RunImpl()); |
61 } | 61 } |
62 | 62 |
63 views::Widget* SendKeyboardEventInputFunction::GetTopLevelWidget() { | 63 views::Widget* SendKeyboardEventInputFunction::GetTopLevelWidget() { |
64 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 64 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
65 views::Widget* login_window = chromeos::DOMLoginDisplay::GetLoginWindow(); | 65 views::Widget* login_window = chromeos::WebUILoginDisplay::GetLoginWindow(); |
66 if (login_window) | 66 if (login_window) |
67 return login_window; | 67 return login_window; |
68 #endif | 68 #endif |
69 | 69 |
70 Browser* browser = GetCurrentBrowser(); | 70 Browser* browser = GetCurrentBrowser(); |
71 if (!browser) | 71 if (!browser) |
72 return NULL; | 72 return NULL; |
73 | 73 |
74 BrowserWindow* window = browser->window(); | 74 BrowserWindow* window = browser->window(); |
75 if (!window) | 75 if (!window) |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // TODO(yusukes): Add a parameter for an input context ID. | 169 // TODO(yusukes): Add a parameter for an input context ID. |
170 int stroke_count = 0; // zero means 'clear all strokes'. | 170 int stroke_count = 0; // zero means 'clear all strokes'. |
171 if (HasOptionalArgument(0)) { | 171 if (HasOptionalArgument(0)) { |
172 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); | 172 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); |
173 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); | 173 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); |
174 } | 174 } |
175 cros_library->GetInputMethodLibrary()->CancelHandwritingStrokes(stroke_count); | 175 cros_library->GetInputMethodLibrary()->CancelHandwritingStrokes(stroke_count); |
176 return true; | 176 return true; |
177 } | 177 } |
178 #endif | 178 #endif |
OLD | NEW |