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 "input_method_event_router.h" | 5 #include "input_method_event_router.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 return std::binary_search(ids_.begin(), ids_.end(), id); | 35 return std::binary_search(ids_.begin(), ids_.end(), id); |
36 } | 36 } |
37 | 37 |
38 const std::vector<std::string>& ids() { return ids_; } | 38 const std::vector<std::string>& ids() { return ids_; } |
39 | 39 |
40 private: | 40 private: |
41 std::vector<std::string> ids_; | 41 std::vector<std::string> ids_; |
42 }; | 42 }; |
43 | 43 |
44 base::LazyInstance<InputMethodPrivateExtensionsWhitelist> | 44 base::LazyInstance<InputMethodPrivateExtensionsWhitelist> |
45 g_input_method_private_extensions_whitelist(base::LINKER_INITIALIZED); | 45 g_input_method_private_extensions_whitelist = LAZY_INSTANCE_INITIALIZER; |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 namespace chromeos { | 49 namespace chromeos { |
50 | 50 |
51 ExtensionInputMethodEventRouter::ExtensionInputMethodEventRouter() { | 51 ExtensionInputMethodEventRouter::ExtensionInputMethodEventRouter() { |
52 input_method::InputMethodManager::GetInstance()->AddObserver(this); | 52 input_method::InputMethodManager::GetInstance()->AddObserver(this); |
53 } | 53 } |
54 | 54 |
55 ExtensionInputMethodEventRouter::~ExtensionInputMethodEventRouter() { | 55 ExtensionInputMethodEventRouter::~ExtensionInputMethodEventRouter() { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 DCHECK(xkb_id.substr(0, prefix_length) == kXkbPrefix); | 102 DCHECK(xkb_id.substr(0, prefix_length) == kXkbPrefix); |
103 return xkb_id.substr(prefix_length); | 103 return xkb_id.substr(prefix_length); |
104 } | 104 } |
105 | 105 |
106 bool ExtensionInputMethodEventRouter::IsExtensionWhitelisted( | 106 bool ExtensionInputMethodEventRouter::IsExtensionWhitelisted( |
107 const std::string& extension_id) { | 107 const std::string& extension_id) { |
108 return g_input_method_private_extensions_whitelist.Get().HasId(extension_id); | 108 return g_input_method_private_extensions_whitelist.Get().HasId(extension_id); |
109 } | 109 } |
110 | 110 |
111 } // namespace chromeos | 111 } // namespace chromeos |
OLD | NEW |