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

Unified Diff: chrome/browser/extensions/crx_installer.cc

Issue 308003005: app_list: Drive app integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pref is_syancable -> do_not_sync, remove AppListModel deps and no auto uninstall new_app Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698