Index: chrome/browser/extensions/crx_installer.cc |
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc |
index b77769ff455590584b3e6232c284f5dacda26f6b..aa837a7585538c350dc6c7062f5c4ef4ceb7de91 100644 |
--- a/chrome/browser/extensions/crx_installer.cc |
+++ b/chrome/browser/extensions/crx_installer.cc |
@@ -135,6 +135,7 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> service_weak, |
install_wait_for_idle_(true), |
update_from_settings_page_(false), |
is_ephemeral_(false), |
+ is_syncable_(true), |
installer_(service_weak->profile()) { |
installer_task_runner_ = service_weak->GetFileTaskRunner(); |
if (!approval) |
@@ -229,21 +230,18 @@ void CrxInstaller::ConvertUserScriptOnFileThread() { |
void CrxInstaller::InstallWebApp(const WebApplicationInfo& web_app) { |
NotifyCrxInstallBegin(); |
+ // Web apps can only ever be converted to bookmark apps. |
+ DCHECK(creation_flags_ & Extension::FROM_BOOKMARK); |
if (!installer_task_runner_->PostTask( |
FROM_HERE, |
- base::Bind(&CrxInstaller::ConvertWebAppOnFileThread, |
- this, |
- web_app, |
- install_directory_))) |
+ base::Bind(&CrxInstaller::ConvertWebAppOnFileThread, this, web_app))) |
NOTREACHED(); |
} |
void CrxInstaller::ConvertWebAppOnFileThread( |
- const WebApplicationInfo& web_app, |
- const base::FilePath& install_directory) { |
- base::string16 error; |
- scoped_refptr<Extension> extension( |
- ConvertWebAppToExtension(web_app, base::Time::Now(), install_directory)); |
+ const WebApplicationInfo& web_app) { |
+ scoped_refptr<Extension> extension(ConvertWebAppToExtension( |
+ web_app, base::Time::Now(), creation_flags_, install_directory_)); |
if (!extension.get()) { |
// Validation should have stopped any potential errors before getting here. |
NOTREACHED() << "Could not convert web app to extension."; |
@@ -727,12 +725,16 @@ void CrxInstaller::ReloadExtensionAfterInstall( |
// with base::string16 |
std::string extension_id = extension()->id(); |
std::string error; |
- installer_.set_extension( |
+ scoped_refptr<Extension> mutable_extension = |
file_util::LoadExtension( |
version_dir, |
install_source_, |
extension()->creation_flags() | Extension::REQUIRE_KEY, |
- &error).get()); |
+ &error).get(); |
+ if (mutable_extension) |
+ mutable_extension->set_is_syncable(is_syncable_); |
+ |
+ installer_.set_extension(mutable_extension); |
if (extension()) { |
ReportSuccessFromFileThread(); |