| 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_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return login_window; | 87 return login_window; |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 if (!browser) | 90 if (!browser) |
| 91 return NULL; | 91 return NULL; |
| 92 | 92 |
| 93 BrowserWindow* window = browser->window(); | 93 BrowserWindow* window = browser->window(); |
| 94 if (!window) | 94 if (!window) |
| 95 return NULL; | 95 return NULL; |
| 96 | 96 |
| 97 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( | 97 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); |
| 98 window->GetNativeHandle()); | |
| 99 return browser_view ? browser_view->GetWidget() : NULL; | 98 return browser_view ? browser_view->GetWidget() : NULL; |
| 100 } | 99 } |
| 101 | 100 |
| 102 } // namespace | 101 } // namespace |
| 103 | 102 |
| 104 bool SendKeyboardEventInputFunction::RunImpl() { | 103 bool SendKeyboardEventInputFunction::RunImpl() { |
| 105 DictionaryValue* args; | 104 DictionaryValue* args; |
| 106 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args)); | 105 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args)); |
| 107 | 106 |
| 108 std::string type_name; | 107 std::string type_name; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 int stroke_count = 0; // zero means 'clear all strokes'. | 235 int stroke_count = 0; // zero means 'clear all strokes'. |
| 237 if (HasOptionalArgument(0)) { | 236 if (HasOptionalArgument(0)) { |
| 238 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); | 237 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); |
| 239 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); | 238 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); |
| 240 } | 239 } |
| 241 chromeos::input_method::InputMethodManager::GetInstance()-> | 240 chromeos::input_method::InputMethodManager::GetInstance()-> |
| 242 CancelHandwritingStrokes(stroke_count); | 241 CancelHandwritingStrokes(stroke_count); |
| 243 return true; | 242 return true; |
| 244 } | 243 } |
| 245 #endif | 244 #endif |
| OLD | NEW |