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 @@
#include "extensions/common/extension.h"
#include "extensions/common/extension_urls.h"
#if defined(OS_CHROMEOS)
#include "chromeos/chromeos_switches.h"
#endif
namespace extensions {
ExternalComponentLoader::ExternalComponentLoader(Profile* profile)
......@@ -43,29 +47,43 @@ bool ExternalComponentLoader::IsModifiable(const Extension* extension) {
}
void ExternalComponentLoader::StartLoading() {
CommandLine* const command_line = CommandLine::ForCurrentProcess();
prefs_.reset(new base::DictionaryValue());
std::string appId = extension_misc::kInAppPaymentsSupportAppId;
prefs_->SetString(appId + ".external_update_url",
std::string app_id = extension_misc::kInAppPaymentsSupportAppId;
prefs_->SetString(app_id + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec());
if (HotwordServiceFactory::IsHotwordAllowed(profile_)) {
std::string hotwordId = extension_misc::kHotwordExtensionId;
CommandLine* command_line = CommandLine::ForCurrentProcess();
std::string hotword_id = extension_misc::kHotwordExtensionId;
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());
}
InitBookmarksExperimentState(profile_);
std::string ext_id;
if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) &&
!ext_id.empty()) {
prefs_->SetString(ext_id + ".external_update_url",
{
std::string extension_id;
if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(),
&extension_id) &&
!extension_id.empty()) {
prefs_->SetString(extension_id + ".external_update_url",
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();
}
......
......@@ -87,6 +87,7 @@ const char kSpeechSynthesisExtensionId[] =
"gjjabgpgjpampikjhjpfhneeoapjbjaf";
const char kWallpaperManagerId[] = "obklkkbkpaoaejdabbfldmcfplpdgolj";
const char kFirstRunDialogId[] = "jdgcneonijmofocbhmijhacgchbihela";
const char kZIPUnpackerExtensionId[] = "oedeeodfidgoollimchfdnbmhcpnklnd";
#else
// The extension id for the web store extension.
const char kChromeVoxExtensionId[] =
......
......@@ -230,6 +230,8 @@ extern const char kSpeechSynthesisExtensionId[];
extern const char kWallpaperManagerId[];
// The extension id of the first run dialog application.
extern const char kFirstRunDialogId[];
// The extension id of the new ZIP unpacker extension.
extern const char kZIPUnpackerExtensionId[];
#endif
// 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