| 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/extensions/component_loader.h" | 9 #include "chrome/browser/extensions/component_loader.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 component_ime.path = base::FilePath( | 250 component_ime.path = base::FilePath( |
| 251 whitelisted_component_extension[i].path); | 251 whitelisted_component_extension[i].path); |
| 252 | 252 |
| 253 const base::FilePath manifest_path = | 253 const base::FilePath manifest_path = |
| 254 component_ime.path.Append("manifest.json"); | 254 component_ime.path.Append("manifest.json"); |
| 255 | 255 |
| 256 if (!base::PathExists(component_ime.path) || | 256 if (!base::PathExists(component_ime.path) || |
| 257 !base::PathExists(manifest_path)) | 257 !base::PathExists(manifest_path)) |
| 258 continue; | 258 continue; |
| 259 | 259 |
| 260 if (!file_util::ReadFileToString(manifest_path, &component_ime.manifest)) | 260 if (!base::ReadFileToString(manifest_path, &component_ime.manifest)) |
| 261 continue; | 261 continue; |
| 262 | 262 |
| 263 scoped_ptr<DictionaryValue> manifest = GetManifest(component_ime.path); | 263 scoped_ptr<DictionaryValue> manifest = GetManifest(component_ime.path); |
| 264 if (!manifest.get()) | 264 if (!manifest.get()) |
| 265 continue; | 265 continue; |
| 266 | 266 |
| 267 if (!ReadExtensionInfo(*manifest.get(), | 267 if (!ReadExtensionInfo(*manifest.get(), |
| 268 whitelisted_component_extension[i].id, | 268 whitelisted_component_extension[i].id, |
| 269 &component_ime)) | 269 &component_ime)) |
| 270 continue; | 270 continue; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 292 std::vector<ComponentExtensionIME>* result, | 292 std::vector<ComponentExtensionIME>* result, |
| 293 const base::Closure& callback) { | 293 const base::Closure& callback) { |
| 294 DCHECK(thread_checker_.CalledOnValidThread()); | 294 DCHECK(thread_checker_.CalledOnValidThread()); |
| 295 DCHECK(result); | 295 DCHECK(result); |
| 296 component_extension_list_ = *result; | 296 component_extension_list_ = *result; |
| 297 is_initialized_ = true; | 297 is_initialized_ = true; |
| 298 callback.Run(); | 298 callback.Run(); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace chromeos | 301 } // namespace chromeos |
| OLD | NEW |