Commit 9d6e421c authored by mtomasz's avatar mtomasz Committed by Commit bot

[unpacker] Install the new zip unpacker extension by default.

The app will be installed as an external component, as we don't want it to be
uninstalled by users.

TEST=Tested manually that the extension gets downloaded on startup.
BUG=427775

Review URL: https://codereview.chromium.org/686993003

Cr-Commit-Position: refs/heads/master@{#302232}
parent 6ce2a31f
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
#include "extensions/common/extension_urls.h" #include "extensions/common/extension_urls.h"
#if defined(OS_CHROMEOS)
#include "chromeos/chromeos_switches.h"
#endif
namespace extensions { namespace extensions {
ExternalComponentLoader::ExternalComponentLoader(Profile* profile) ExternalComponentLoader::ExternalComponentLoader(Profile* profile)
...@@ -43,29 +47,43 @@ bool ExternalComponentLoader::IsModifiable(const Extension* extension) { ...@@ -43,29 +47,43 @@ bool ExternalComponentLoader::IsModifiable(const Extension* extension) {
} }
void ExternalComponentLoader::StartLoading() { void ExternalComponentLoader::StartLoading() {
CommandLine* const command_line = CommandLine::ForCurrentProcess();
prefs_.reset(new base::DictionaryValue()); prefs_.reset(new base::DictionaryValue());
std::string appId = extension_misc::kInAppPaymentsSupportAppId; std::string app_id = extension_misc::kInAppPaymentsSupportAppId;
prefs_->SetString(appId + ".external_update_url", prefs_->SetString(app_id + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec()); extension_urls::GetWebstoreUpdateUrl().spec());
if (HotwordServiceFactory::IsHotwordAllowed(profile_)) { if (HotwordServiceFactory::IsHotwordAllowed(profile_)) {
std::string hotwordId = extension_misc::kHotwordExtensionId; std::string hotword_id = extension_misc::kHotwordExtensionId;
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kEnableExperimentalHotwording)) { if (command_line->HasSwitch(switches::kEnableExperimentalHotwording)) {
hotwordId = extension_misc::kHotwordSharedModuleId; hotword_id = extension_misc::kHotwordSharedModuleId;
} }
prefs_->SetString(hotwordId + ".external_update_url", prefs_->SetString(hotword_id + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec()); extension_urls::GetWebstoreUpdateUrl().spec());
} }
InitBookmarksExperimentState(profile_); InitBookmarksExperimentState(profile_);
std::string ext_id; {
if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) && std::string extension_id;
!ext_id.empty()) { if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(),
prefs_->SetString(ext_id + ".external_update_url", &extension_id) &&
!extension_id.empty()) {
prefs_->SetString(extension_id + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec()); extension_urls::GetWebstoreUpdateUrl().spec());
} }
}
#if defined(OS_CHROMEOS)
{
if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) {
const std::string extension_id = extension_misc::kZIPUnpackerExtensionId;
prefs_->SetString(extension_id + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec());
}
}
#endif
LoadFinished(); LoadFinished();
} }
......
...@@ -87,6 +87,7 @@ const char kSpeechSynthesisExtensionId[] = ...@@ -87,6 +87,7 @@ const char kSpeechSynthesisExtensionId[] =
"gjjabgpgjpampikjhjpfhneeoapjbjaf"; "gjjabgpgjpampikjhjpfhneeoapjbjaf";
const char kWallpaperManagerId[] = "obklkkbkpaoaejdabbfldmcfplpdgolj"; const char kWallpaperManagerId[] = "obklkkbkpaoaejdabbfldmcfplpdgolj";
const char kFirstRunDialogId[] = "jdgcneonijmofocbhmijhacgchbihela"; const char kFirstRunDialogId[] = "jdgcneonijmofocbhmijhacgchbihela";
const char kZIPUnpackerExtensionId[] = "oedeeodfidgoollimchfdnbmhcpnklnd";
#else #else
// The extension id for the web store extension. // The extension id for the web store extension.
const char kChromeVoxExtensionId[] = const char kChromeVoxExtensionId[] =
......
...@@ -230,6 +230,8 @@ extern const char kSpeechSynthesisExtensionId[]; ...@@ -230,6 +230,8 @@ extern const char kSpeechSynthesisExtensionId[];
extern const char kWallpaperManagerId[]; extern const char kWallpaperManagerId[];
// The extension id of the first run dialog application. // The extension id of the first run dialog application.
extern const char kFirstRunDialogId[]; extern const char kFirstRunDialogId[];
// The extension id of the new ZIP unpacker extension.
extern const char kZIPUnpackerExtensionId[];
#endif #endif
// What causes an extension to be installed? Used in histograms, so don't // What causes an extension to be installed? Used in histograms, so don't
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment