| OLD | NEW |
| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "chrome/browser/extensions/extension_error_reporter.h" | 14 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 15 #include "chrome/browser/extensions/extension_install_prompt.h" | 15 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 16 #include "chrome/browser/extensions/extension_install_ui.h" | 16 #include "chrome/browser/extensions/extension_install_ui.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
| 18 #include "chrome/browser/extensions/permissions_updater.h" | 18 #include "chrome/browser/extensions/permissions_updater.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/extensions/api/plugins/plugins_handler.h" | 21 #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
| 22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 23 #include "extensions/browser/extension_prefs.h" | 23 #include "extensions/browser/extension_prefs.h" |
| 24 #include "extensions/browser/extension_registry.h" | 24 #include "extensions/browser/extension_registry.h" |
| 25 #include "extensions/browser/install_flag.h" |
| 25 #include "extensions/common/extension.h" | 26 #include "extensions/common/extension.h" |
| 26 #include "extensions/common/extension_l10n_util.h" | 27 #include "extensions/common/extension_l10n_util.h" |
| 27 #include "extensions/common/file_util.h" | 28 #include "extensions/common/file_util.h" |
| 28 #include "extensions/common/id_util.h" | 29 #include "extensions/common/id_util.h" |
| 29 #include "extensions/common/manifest.h" | 30 #include "extensions/common/manifest.h" |
| 30 #include "sync/api/string_ordinal.h" | 31 #include "sync/api/string_ordinal.h" |
| 31 | 32 |
| 32 using content::BrowserThread; | 33 using content::BrowserThread; |
| 33 using extensions::Extension; | 34 using extensions::Extension; |
| 34 | 35 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 312 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 312 base::string16 error = installer_.CheckManagementPolicy(); | 313 base::string16 error = installer_.CheckManagementPolicy(); |
| 313 if (!error.empty()) { | 314 if (!error.empty()) { |
| 314 ReportExtensionLoadError(base::UTF16ToUTF8(error)); | 315 ReportExtensionLoadError(base::UTF16ToUTF8(error)); |
| 315 return; | 316 return; |
| 316 } | 317 } |
| 317 | 318 |
| 318 PermissionsUpdater perms_updater(service_weak_->profile()); | 319 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 319 perms_updater.GrantActivePermissions(installer_.extension().get()); | 320 perms_updater.GrantActivePermissions(installer_.extension().get()); |
| 320 | 321 |
| 321 service_weak_->OnExtensionInstalled( | 322 service_weak_->OnExtensionInstalled(installer_.extension().get(), |
| 322 installer_.extension().get(), | 323 syncer::StringOrdinal(), |
| 323 syncer::StringOrdinal(), | 324 kInstallFlagInstallImmediately); |
| 324 false /* no requirement errors */, | |
| 325 NOT_BLACKLISTED, | |
| 326 false /* not ephemeral */, | |
| 327 false /* don't wait for idle */); | |
| 328 } | 325 } |
| 329 | 326 |
| 330 } // namespace extensions | 327 } // namespace extensions |
| OLD | NEW |