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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 233 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
234 DCHECK(out_imes); | 234 DCHECK(out_imes); |
235 for (size_t i = 0; i < arraysize(whitelisted_component_extension); ++i) { | 235 for (size_t i = 0; i < arraysize(whitelisted_component_extension); ++i) { |
236 ComponentExtensionIME component_ime; | 236 ComponentExtensionIME component_ime; |
237 component_ime.path = base::FilePath( | 237 component_ime.path = base::FilePath( |
238 whitelisted_component_extension[i].path); | 238 whitelisted_component_extension[i].path); |
239 | 239 |
240 const base::FilePath manifest_path = | 240 const base::FilePath manifest_path = |
241 component_ime.path.Append("manifest.json"); | 241 component_ime.path.Append("manifest.json"); |
242 | 242 |
243 if (!file_util::PathExists(component_ime.path) || | 243 if (!base::PathExists(component_ime.path) || |
244 !file_util::PathExists(manifest_path)) | 244 !base::PathExists(manifest_path)) |
245 continue; | 245 continue; |
246 | 246 |
247 if (!file_util::ReadFileToString(manifest_path, &component_ime.manifest)) | 247 if (!file_util::ReadFileToString(manifest_path, &component_ime.manifest)) |
248 continue; | 248 continue; |
249 | 249 |
250 scoped_ptr<DictionaryValue> manifest = GetManifest(component_ime.path); | 250 scoped_ptr<DictionaryValue> manifest = GetManifest(component_ime.path); |
251 if (!manifest.get()) | 251 if (!manifest.get()) |
252 continue; | 252 continue; |
253 | 253 |
254 if (!ReadExtensionInfo(*manifest.get(), | 254 if (!ReadExtensionInfo(*manifest.get(), |
(...skipping 24 matching lines...) Expand all Loading... |
279 std::vector<ComponentExtensionIME>* result, | 279 std::vector<ComponentExtensionIME>* result, |
280 const base::Closure& callback) { | 280 const base::Closure& callback) { |
281 DCHECK(thread_checker_.CalledOnValidThread()); | 281 DCHECK(thread_checker_.CalledOnValidThread()); |
282 DCHECK(result); | 282 DCHECK(result); |
283 component_extension_list_ = *result; | 283 component_extension_list_ = *result; |
284 is_initialized_ = true; | 284 is_initialized_ = true; |
285 callback.Run(); | 285 callback.Run(); |
286 } | 286 } |
287 | 287 |
288 } // namespace chromeos | 288 } // namespace chromeos |
OLD | NEW |