diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 02:57:09 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 02:57:09 +0000 |
commit | 3d7297219dc6164c4807fd533fd7e78aacb0e566 (patch) | |
tree | 036e3828d658a3d50f46c3f0878946248d7230c1 | |
parent | 95e30e7c7712f4a98768c9dc04233e21acd30a4f (diff) | |
download | chromium_src-3d7297219dc6164c4807fd533fd7e78aacb0e566.zip chromium_src-3d7297219dc6164c4807fd533fd7e78aacb0e566.tar.gz chromium_src-3d7297219dc6164c4807fd533fd7e78aacb0e566.tar.bz2 |
Preserve 'from_webstore' state when an extension is updated.
BUG=97139
TEST=unit_tests, --gtest_filter=ExtensionServiceTest.FromWebStore
Review URL: http://codereview.chromium.org/7966004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101905 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_service_unittest.cc | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 60a864f..bf77408 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -804,6 +804,8 @@ bool ExtensionService::UpdateExtension( installer->set_install_source(extension->location()); if (pending_extension_info.install_silently()) installer->set_allow_silent_install(true); + if (extension && extension->from_webstore()) + installer->set_is_gallery_install(true); installer->set_delete_source(true); installer->set_original_url(download_url); installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 83bafa1..51931de 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -1958,6 +1958,12 @@ TEST_F(ExtensionServiceTest, FromWebStore) { service_->ReloadExtensions(); extension = service_->extensions()->at(0); ASSERT_TRUE(extension->from_webstore()); + + // Upgrade to version 2.0 + path = data_dir_.AppendASCII("good2.crx"); + UpdateExtension(good_crx, path, ENABLED); + ValidatePrefKeyCount(1); + ValidateBooleanPref(good_crx, "from_webstore", true); } // Test upgrading a signed extension. |