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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 const std::string& extension_id, | 315 const std::string& extension_id, |
316 const base::FilePath& file_path) { | 316 const base::FilePath& file_path) { |
317 // Remove(extension_id) does nothing when the extension has already been | 317 // Remove(extension_id) does nothing when the extension has already been |
318 // removed or not been registered. | 318 // removed or not been registered. |
319 GetComponentLoader(profile)->Remove(extension_id); | 319 GetComponentLoader(profile)->Remove(extension_id); |
320 } | 320 } |
321 | 321 |
322 scoped_ptr<base::DictionaryValue> ComponentExtensionIMEManagerImpl::GetManifest( | 322 scoped_ptr<base::DictionaryValue> ComponentExtensionIMEManagerImpl::GetManifest( |
323 const std::string& manifest_string) { | 323 const std::string& manifest_string) { |
324 std::string error; | 324 std::string error; |
325 JSONStringValueSerializer serializer(manifest_string); | 325 JSONStringValueDeserializer deserializer(manifest_string); |
326 scoped_ptr<base::Value> manifest(serializer.Deserialize(NULL, &error)); | 326 scoped_ptr<base::Value> manifest(deserializer.Deserialize(NULL, &error)); |
327 if (!manifest.get()) | 327 if (!manifest.get()) |
328 LOG(ERROR) << "Failed at getting manifest"; | 328 LOG(ERROR) << "Failed at getting manifest"; |
329 | 329 |
330 return scoped_ptr<base::DictionaryValue>( | 330 return scoped_ptr<base::DictionaryValue>( |
331 static_cast<base::DictionaryValue*>(manifest.release())).Pass(); | 331 static_cast<base::DictionaryValue*>(manifest.release())).Pass(); |
332 } | 332 } |
333 | 333 |
334 // static | 334 // static |
335 bool ComponentExtensionIMEManagerImpl::ReadEngineComponent( | 335 bool ComponentExtensionIMEManagerImpl::ReadEngineComponent( |
336 const ComponentExtensionIME& component_extension, | 336 const ComponentExtensionIME& component_extension, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 490 |
491 ComponentExtensionEngine engine; | 491 ComponentExtensionEngine engine; |
492 ReadEngineComponent(component_ime, *dictionary, &engine); | 492 ReadEngineComponent(component_ime, *dictionary, &engine); |
493 component_ime.engines.push_back(engine); | 493 component_ime.engines.push_back(engine); |
494 } | 494 } |
495 out_imes->push_back(component_ime); | 495 out_imes->push_back(component_ime); |
496 } | 496 } |
497 } | 497 } |
498 | 498 |
499 } // namespace chromeos | 499 } // namespace chromeos |
OLD | NEW |