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 "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/extensions/component_loader.h" | 10 #include "chrome/browser/extensions/component_loader.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 scoped_ptr<base::DictionaryValue> ComponentExtensionIMEManagerImpl::GetManifest( | 139 scoped_ptr<base::DictionaryValue> ComponentExtensionIMEManagerImpl::GetManifest( |
140 const base::FilePath& file_path) { | 140 const base::FilePath& file_path) { |
141 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 141 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
142 std::string error; | 142 std::string error; |
143 scoped_ptr<base::DictionaryValue> manifest( | 143 scoped_ptr<base::DictionaryValue> manifest( |
144 extensions::file_util::LoadManifest(file_path, &error)); | 144 extensions::file_util::LoadManifest(file_path, &error)); |
145 if (!manifest.get()) | 145 if (!manifest.get()) |
146 LOG(ERROR) << "Failed at getting manifest"; | 146 LOG(ERROR) << "Failed at getting manifest"; |
147 if (!extension_l10n_util::LocalizeExtension(file_path, | 147 if (!extension_l10n_util::LocalizeExtension(file_path, |
148 manifest.get(), | 148 manifest.get(), |
149 &error)) | 149 &error)) { |
150 LOG(ERROR) << "Localization failed"; | 150 LOG(ERROR) << "Localization failed for: " << file_path.value() |
151 | 151 << " Error: " << error; |
| 152 } |
152 return manifest.Pass(); | 153 return manifest.Pass(); |
153 } | 154 } |
154 | 155 |
155 void ComponentExtensionIMEManagerImpl::InitializeAsync( | 156 void ComponentExtensionIMEManagerImpl::InitializeAsync( |
156 const base::Closure& callback) { | 157 const base::Closure& callback) { |
157 DCHECK(!is_initialized_); | 158 DCHECK(!is_initialized_); |
158 DCHECK(thread_checker_.CalledOnValidThread()); | 159 DCHECK(thread_checker_.CalledOnValidThread()); |
159 | 160 |
160 std::vector<ComponentExtensionIME>* component_extension_ime_list | 161 std::vector<ComponentExtensionIME>* component_extension_ime_list |
161 = new std::vector<ComponentExtensionIME>; | 162 = new std::vector<ComponentExtensionIME>; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 std::vector<ComponentExtensionIME>* result, | 334 std::vector<ComponentExtensionIME>* result, |
334 const base::Closure& callback) { | 335 const base::Closure& callback) { |
335 DCHECK(thread_checker_.CalledOnValidThread()); | 336 DCHECK(thread_checker_.CalledOnValidThread()); |
336 DCHECK(result); | 337 DCHECK(result); |
337 component_extension_list_ = *result; | 338 component_extension_list_ = *result; |
338 is_initialized_ = true; | 339 is_initialized_ = true; |
339 callback.Run(); | 340 callback.Run(); |
340 } | 341 } |
341 | 342 |
342 } // namespace chromeos | 343 } // namespace chromeos |
OLD | NEW |