OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/input_method/component_extension_ime_manager_i
mpl.h" | 5 #include "chrome/browser/chromeos/input_method/component_extension_ime_manager_i
mpl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 const base::FilePath& file_path) { | 160 const base::FilePath& file_path) { |
161 // Remove(extension_id) does nothing when the extension has already been | 161 // Remove(extension_id) does nothing when the extension has already been |
162 // removed or not been registered. | 162 // removed or not been registered. |
163 GetComponentLoader(profile)->Remove(extension_id); | 163 GetComponentLoader(profile)->Remove(extension_id); |
164 } | 164 } |
165 | 165 |
166 scoped_ptr<base::DictionaryValue> ComponentExtensionIMEManagerImpl::GetManifest( | 166 scoped_ptr<base::DictionaryValue> ComponentExtensionIMEManagerImpl::GetManifest( |
167 const std::string& manifest_string) { | 167 const std::string& manifest_string) { |
168 std::string error; | 168 std::string error; |
169 JSONStringValueDeserializer deserializer(manifest_string); | 169 JSONStringValueDeserializer deserializer(manifest_string); |
170 scoped_ptr<base::Value> manifest(deserializer.Deserialize(NULL, &error)); | 170 scoped_ptr<base::Value> manifest = deserializer.Deserialize(NULL, &error); |
171 if (!manifest.get()) | 171 if (!manifest.get()) |
172 LOG(ERROR) << "Failed at getting manifest"; | 172 LOG(ERROR) << "Failed at getting manifest"; |
173 | 173 |
174 return scoped_ptr<base::DictionaryValue>( | 174 return scoped_ptr<base::DictionaryValue>( |
175 static_cast<base::DictionaryValue*>(manifest.release())).Pass(); | 175 static_cast<base::DictionaryValue*>(manifest.release())).Pass(); |
176 } | 176 } |
177 | 177 |
178 // static | 178 // static |
179 bool ComponentExtensionIMEManagerImpl::IsIMEExtensionID(const std::string& id) { | 179 bool ComponentExtensionIMEManagerImpl::IsIMEExtensionID(const std::string& id) { |
180 for (size_t i = 0; i < arraysize(whitelisted_component_extension); ++i) { | 180 for (size_t i = 0; i < arraysize(whitelisted_component_extension); ++i) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 ComponentExtensionEngine engine; | 331 ComponentExtensionEngine engine; |
332 ReadEngineComponent(component_ime, *dictionary, &engine); | 332 ReadEngineComponent(component_ime, *dictionary, &engine); |
333 component_ime.engines.push_back(engine); | 333 component_ime.engines.push_back(engine); |
334 } | 334 } |
335 out_imes->push_back(component_ime); | 335 out_imes->push_back(component_ime); |
336 } | 336 } |
337 } | 337 } |
338 | 338 |
339 } // namespace chromeos | 339 } // namespace chromeos |
OLD | NEW |