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

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

Issue 236213002: Move most of extension_file_util.cc into extensions/common/file_util.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (file-util) Created 6 years, 8 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 | Annotate | Revision Log
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 "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"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/profiles/profile_manager.h" 12 #include "chrome/browser/profiles/profile_manager.h"
13 #include "chrome/common/extensions/extension_file_util.h"
14 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
15 #include "extensions/browser/extension_system.h" 14 #include "extensions/browser/extension_system.h"
16 #include "extensions/common/extension.h" 15 #include "extensions/common/extension.h"
17 #include "extensions/common/extension_l10n_util.h" 16 #include "extensions/common/extension_l10n_util.h"
17 #include "extensions/common/file_util.h"
18 #include "extensions/common/manifest_constants.h" 18 #include "extensions/common/manifest_constants.h"
19 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
20 20
21 namespace chromeos { 21 namespace chromeos {
22 22
23 namespace { 23 namespace {
24 24
25 struct WhitelistedComponentExtensionIME { 25 struct WhitelistedComponentExtensionIME {
26 const char* id; 26 const char* id;
27 const char* path; 27 const char* path;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // Remove(extension_id) does nothing when the extension has already been 134 // Remove(extension_id) does nothing when the extension has already been
135 // removed or not been registered. 135 // removed or not been registered.
136 GetComponentLoader()->Remove(extension_id); 136 GetComponentLoader()->Remove(extension_id);
137 } 137 }
138 138
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 extension_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";
151 151
152 return manifest.Pass(); 152 return manifest.Pass();
153 } 153 }
154 154
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 std::vector<ComponentExtensionIME>* result, 327 std::vector<ComponentExtensionIME>* result,
328 const base::Closure& callback) { 328 const base::Closure& callback) {
329 DCHECK(thread_checker_.CalledOnValidThread()); 329 DCHECK(thread_checker_.CalledOnValidThread());
330 DCHECK(result); 330 DCHECK(result);
331 component_extension_list_ = *result; 331 component_extension_list_ = *result;
332 is_initialized_ = true; 332 is_initialized_ = true;
333 callback.Run(); 333 callback.Run();
334 } 334 }
335 335
336 } // namespace chromeos 336 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698