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

Side by Side Diff: chrome/browser/extensions/unpacked_installer.cc

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/extensions/unpacked_installer.h" 5 #include "chrome/browser/extensions/unpacked_installer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/threading/thread_restrictions.h" 11 #include "base/threading/thread_restrictions.h"
12 #include "chrome/browser/extensions/extension_install_prompt.h" 12 #include "chrome/browser/extensions/extension_install_prompt.h"
13 #include "chrome/browser/extensions/extension_install_ui.h" 13 #include "chrome/browser/extensions/extension_install_ui.h"
14 #include "chrome/browser/extensions/extension_prefs.h" 14 #include "chrome/browser/extensions/extension_prefs.h"
15 #include "chrome/browser/extensions/extension_service.h" 15 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/extensions/permissions_updater.h" 16 #include "chrome/browser/extensions/permissions_updater.h"
17 #include "chrome/browser/extensions/requirements_checker.h" 17 #include "chrome/browser/extensions/requirements_checker.h"
18 #include "chrome/common/extensions/api/plugins/plugins_handler.h" 18 #include "chrome/common/extensions/api/plugins/plugins_handler.h"
19 #include "chrome/common/extensions/extension.h" 19 #include "chrome/common/extensions/extension.h"
20 #include "chrome/common/extensions/extension_file_util.h" 20 #include "chrome/common/extensions/extension_file_util.h"
21 #include "chrome/common/extensions/manifest.h" 21 #include "chrome/common/extensions/manifest.h"
22 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
23 #include "extensions/common/id_util.h"
23 #include "sync/api/string_ordinal.h" 24 #include "sync/api/string_ordinal.h"
24 25
25 using content::BrowserThread; 26 using content::BrowserThread;
26 using extensions::Extension; 27 using extensions::Extension;
27 28
28 namespace { 29 namespace {
29 30
30 const char kUnpackedExtensionsBlacklistedError[] = 31 const char kUnpackedExtensionsBlacklistedError[] =
31 "Loading of unpacked extensions is disabled by the administrator."; 32 "Loading of unpacked extensions is disabled by the administrator.";
32 33
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 167
167 if (!requirement_errors.empty()) { 168 if (!requirement_errors.empty()) {
168 ReportExtensionLoadError(JoinString(requirement_errors, ' ')); 169 ReportExtensionLoadError(JoinString(requirement_errors, ' '));
169 return; 170 return;
170 } 171 }
171 172
172 OnLoaded(); 173 OnLoaded();
173 } 174 }
174 175
175 int UnpackedInstaller::GetFlags() { 176 int UnpackedInstaller::GetFlags() {
176 std::string id = Extension::GenerateIdForPath(extension_path_); 177 std::string id = id_util::GenerateIdForPath(extension_path_);
177 bool allow_file_access = 178 bool allow_file_access =
178 Manifest::ShouldAlwaysAllowFileAccess(Manifest::UNPACKED); 179 Manifest::ShouldAlwaysAllowFileAccess(Manifest::UNPACKED);
179 if (service_weak_->extension_prefs()->HasAllowFileAccessSetting(id)) 180 if (service_weak_->extension_prefs()->HasAllowFileAccessSetting(id))
180 allow_file_access = service_weak_->extension_prefs()->AllowFileAccess(id); 181 allow_file_access = service_weak_->extension_prefs()->AllowFileAccess(id);
181 182
182 int result = Extension::FOLLOW_SYMLINKS_ANYWHERE; 183 int result = Extension::FOLLOW_SYMLINKS_ANYWHERE;
183 if (allow_file_access) 184 if (allow_file_access)
184 result |= Extension::ALLOW_FILE_ACCESS; 185 result |= Extension::ALLOW_FILE_ACCESS;
185 if (require_modern_manifest_version_) 186 if (require_modern_manifest_version_)
186 result |= Extension::REQUIRE_MODERN_MANIFEST_VERSION; 187 result |= Extension::REQUIRE_MODERN_MANIFEST_VERSION;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 if (launch_on_load_) 274 if (launch_on_load_)
274 service_weak_->ScheduleLaunchOnLoad(extension_->id()); 275 service_weak_->ScheduleLaunchOnLoad(extension_->id());
275 276
276 service_weak_->OnExtensionInstalled(extension_, 277 service_weak_->OnExtensionInstalled(extension_,
277 syncer::StringOrdinal(), 278 syncer::StringOrdinal(),
278 false /* no requirement errors */, 279 false /* no requirement errors */,
279 false /* don't wait for idle */); 280 false /* don't wait for idle */);
280 } 281 }
281 282
282 } // namespace extensions 283 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698