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 "webkit/plugins/npapi/webplugin_ime_win.h" | 5 #include "webkit/plugins/npapi/webplugin_ime_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
15 #include "webkit/plugins/npapi/plugin_constants_win.h" | 15 #include "webkit/plugins/npapi/plugin_constants_win.h" |
16 #include "webkit/plugins/npapi/plugin_instance.h" | 16 #include "webkit/plugins/npapi/plugin_instance.h" |
17 | 17 |
18 #pragma comment(lib, "imm32.lib") | 18 #pragma comment(lib, "imm32.lib") |
19 | 19 |
20 using WebKit::WebInputEvent; | 20 using WebKit::WebInputEvent; |
21 using WebKit::WebCompositionEvent; | 21 using WebKit::WebCompositionEvent; |
22 | 22 |
23 namespace webkit { | 23 namespace webkit { |
24 namespace npapi { | 24 namespace npapi { |
25 | 25 |
26 // A critical section that prevents two or more plug-ins from accessing a | 26 // A critical section that prevents two or more plug-ins from accessing a |
27 // WebPluginIMEWin instance through our patch function. | 27 // WebPluginIMEWin instance through our patch function. |
28 base::LazyInstance<base::Lock> g_webplugin_ime_lock(base::LINKER_INITIALIZED); | 28 base::LazyInstance<base::Lock, |
| 29 base::LeakyLazyInstanceTraits<base::Lock> > |
| 30 g_webplugin_ime_lock(base::LINKER_INITIALIZED); |
29 | 31 |
30 WebPluginIMEWin* WebPluginIMEWin::instance_ = NULL; | 32 WebPluginIMEWin* WebPluginIMEWin::instance_ = NULL; |
31 | 33 |
32 WebPluginIMEWin::WebPluginIMEWin() | 34 WebPluginIMEWin::WebPluginIMEWin() |
33 : cursor_position_(0), | 35 : cursor_position_(0), |
34 delta_start_(0), | 36 delta_start_(0), |
35 composing_text_(false), | 37 composing_text_(false), |
36 support_ime_messages_(false), | 38 support_ime_messages_(false), |
37 status_updated_(false), | 39 status_updated_(false), |
38 input_type_(1) { | 40 input_type_(1) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 if (instance->input_type_ != input_type) { | 316 if (instance->input_type_ != input_type) { |
315 instance->input_type_ = input_type; | 317 instance->input_type_ = input_type; |
316 instance->status_updated_ = true; | 318 instance->status_updated_ = true; |
317 } | 319 } |
318 | 320 |
319 return TRUE; | 321 return TRUE; |
320 } | 322 } |
321 | 323 |
322 } // namespace npapi | 324 } // namespace npapi |
323 } // namespace webkit | 325 } // namespace webkit |
OLD | NEW |