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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 (key_identifier.substr(2).find_first_not_of("0123456789abcdefABCDEF") == | 67 (key_identifier.substr(2).find_first_not_of("0123456789abcdefABCDEF") == |
68 std::string::npos)) { | 68 std::string::npos)) { |
69 const bool result = | 69 const bool result = |
70 base::HexStringToInt(key_identifier.substr(2), &character); | 70 base::HexStringToInt(key_identifier.substr(2), &character); |
71 DCHECK(result) << key_identifier; | 71 DCHECK(result) << key_identifier; |
72 } | 72 } |
73 return character; | 73 return character; |
74 } | 74 } |
75 | 75 |
76 views::Widget* GetTopLevelWidget(Browser* browser) { | 76 views::Widget* GetTopLevelWidget(Browser* browser) { |
77 if (views::ViewsDelegate::views_delegate) { | |
78 views::View* view = views::ViewsDelegate::views_delegate-> | |
79 GetDefaultParentView(); | |
80 if (view) | |
81 return view->GetWidget(); | |
82 } | |
83 | |
84 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 77 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
85 chromeos::LoginDisplayHost* host = | 78 chromeos::LoginDisplayHost* host = |
86 chromeos::BaseLoginDisplayHost::default_host(); | 79 chromeos::BaseLoginDisplayHost::default_host(); |
87 if (host) | 80 if (host) |
88 return views::Widget::GetWidgetForNativeWindow(host->GetNativeWindow()); | 81 return views::Widget::GetWidgetForNativeWindow(host->GetNativeWindow()); |
89 #endif | 82 #endif |
90 | 83 |
91 if (!browser) | 84 if (!browser) |
92 return NULL; | 85 return NULL; |
93 | 86 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 int stroke_count = 0; // zero means 'clear all strokes'. | 229 int stroke_count = 0; // zero means 'clear all strokes'. |
237 if (HasOptionalArgument(0)) { | 230 if (HasOptionalArgument(0)) { |
238 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); | 231 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); |
239 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); | 232 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); |
240 } | 233 } |
241 chromeos::input_method::InputMethodManager::GetInstance()-> | 234 chromeos::input_method::InputMethodManager::GetInstance()-> |
242 CancelHandwritingStrokes(stroke_count); | 235 CancelHandwritingStrokes(stroke_count); |
243 return true; | 236 return true; |
244 } | 237 } |
245 #endif | 238 #endif |
OLD | NEW |