Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698