diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-18 21:48:55 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-18 21:48:55 +0000 |
commit | 8a45312a31b186af8076913d2fb663008b73c618 (patch) | |
tree | 8e4d8b76d599777f7949f1a88cb0446cf3e6bbbc | |
parent | 3a1799426cd7f28e52837c040e7b19159def2b14 (diff) | |
download | chromium_src-8a45312a31b186af8076913d2fb663008b73c618.zip chromium_src-8a45312a31b186af8076913d2fb663008b73c618.tar.gz chromium_src-8a45312a31b186af8076913d2fb663008b73c618.tar.bz2 |
Revert r50278.
TBR=rafaelw@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50284 0039d316-1c4b-4281-b951-d872f2087c98
54 files changed, 251 insertions, 275 deletions
diff --git a/chrome/browser/browser_theme_pack.cc b/chrome/browser/browser_theme_pack.cc index bf40435..fb85301 100644 --- a/chrome/browser/browser_theme_pack.cc +++ b/chrome/browser/browser_theme_pack.cc @@ -326,7 +326,7 @@ BrowserThemePack::~BrowserThemePack() { BrowserThemePack* BrowserThemePack::BuildFromExtension(Extension* extension) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); DCHECK(extension); - DCHECK(extension->is_theme()); + DCHECK(extension->IsTheme()); BrowserThemePack* pack = new BrowserThemePack; pack->BuildHeader(extension); diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index b26ff4e..cdbb684 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -269,7 +269,7 @@ void BrowserThemeProvider::SetTheme(Extension* extension) { FreePlatformCaches(); DCHECK(extension); - DCHECK(extension->is_theme()); + DCHECK(extension->IsTheme()); BuildFromExtension(extension); SaveThemeID(extension->id()); @@ -289,7 +289,7 @@ void BrowserThemeProvider::RemoveUnusedThemes() { const ExtensionList* extensions = service->extensions(); for (ExtensionList::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - if ((*it)->is_theme() && (*it)->id() != current_theme) { + if ((*it)->IsTheme() && (*it)->id() != current_theme) { remove_list.push_back((*it)->id()); } } diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc index 31384cb..5fe6ba5 100644 --- a/chrome/browser/dom_ui/app_launcher_handler.cc +++ b/chrome/browser/dom_ui/app_launcher_handler.cc @@ -115,7 +115,7 @@ void AppLauncherHandler::HandleGetApps(const Value* value) { const ExtensionList* extensions = extensions_service_->extensions(); for (ExtensionList::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - if ((*it)->is_app()) { + if ((*it)->IsApp()) { DictionaryValue* app_info = new DictionaryValue(); CreateAppInfo(*it, app_info); list->Append(app_info); diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index e5bed66..832318c 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -137,7 +137,7 @@ void CrxInstaller::OnUnpackSuccess(const FilePath& temp_dir, // Determine whether to allow installation. We always allow themes and // external installs. - if (!extensions_enabled_ && !extension->is_theme() && + if (!extensions_enabled_ && !extension->IsTheme() && !Extension::IsExternalLocation(install_source_)) { ReportFailureFromFileThread("Extensions are not enabled."); return; diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc index c5c22f6..dfd3ef6 100644 --- a/chrome/browser/extensions/extension_install_ui.cc +++ b/chrome/browser/extensions/extension_install_ui.cc @@ -158,7 +158,7 @@ void ExtensionInstallUI::ConfirmInstall(Delegate* delegate, // We special-case themes to not show any confirm UI. Instead they are // immediately installed, and then we show an infobar (see OnInstallSuccess) // to allow the user to revert if they don't like it. - if (extension->is_theme()) { + if (extension->IsTheme()) { // Remember the current theme in case the user pressed undo. Extension* previous_theme = profile_->GetTheme(); if (previous_theme) @@ -190,7 +190,7 @@ void ExtensionInstallUI::ConfirmUninstall(Delegate* delegate, } void ExtensionInstallUI::OnInstallSuccess(Extension* extension) { - if (extension->is_theme()) { + if (extension->IsTheme()) { ShowThemeInfoBar(previous_theme_id_, previous_use_system_theme_, extension, profile_); return; @@ -302,7 +302,7 @@ void ExtensionInstallUI::OnImageLoaded( void ExtensionInstallUI::ShowThemeInfoBar( const std::string& previous_theme_id, bool previous_use_system_theme, Extension* new_theme, Profile* profile) { - if (!new_theme->is_theme()) + if (!new_theme->IsTheme()) return; // Get last active normal browser of profile. diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 781a200..f4a0443 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -166,7 +166,7 @@ void ManifestFetchesBuilder::AddExtension(const Extension& extension) { extension.id(), *extension.version(), extension.converted_from_user_script(), - extension.is_theme(), + extension.IsTheme(), extension.update_url()); } diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 57ef3e2..e474576 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -504,7 +504,7 @@ void ExtensionsService::ContinueLoadAllExtensions( if ((*ex)->location() == Extension::LOAD) continue; - if ((*ex)->is_theme()) { + if ((*ex)->IsTheme()) { theme_count++; } else if ((*ex)->converted_from_user_script()) { user_script_count++; @@ -780,7 +780,7 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension, // TODO(aa): Need to re-evaluate this branch. Does this still make sense now // that extensions are enabled by default? if (extensions_enabled() || - extension->is_theme() || + extension->IsTheme() || extension->location() == Extension::LOAD || Extension::IsExternalLocation(extension->location())) { Extension* old = GetExtensionByIdInternal(extension->id(), true, true); @@ -842,7 +842,7 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension, void ExtensionsService::UpdateActiveExtensionsInCrashReporter() { std::set<std::string> extension_ids; for (size_t i = 0; i < extensions_.size(); ++i) { - if (!extensions_[i]->is_theme()) + if (!extensions_[i]->IsTheme()) extension_ids.insert(extensions_[i]->id()); } @@ -854,9 +854,9 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension, PendingExtensionMap::iterator it = pending_extensions_.find(extension->id()); if (it != pending_extensions_.end() && - (it->second.is_theme != extension->is_theme())) { + (it->second.is_theme != extension->IsTheme())) { LOG(WARNING) << "Not installing pending extension " << extension->id() - << " with is_theme = " << extension->is_theme() + << " with is_theme = " << extension->IsTheme() << "; expected is_theme = " << it->second.is_theme; // Delete the extension directory since we're not going to load // it. @@ -871,7 +871,7 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension, // If the extension is a theme, tell the profile (and therefore ThemeProvider) // to apply it. - if (extension->is_theme()) { + if (extension->IsTheme()) { NotificationService::current()->Notify( NotificationType::THEME_INSTALLED, Source<Profile>(profile_), diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc index f3660cf..5d7aac7 100644 --- a/chrome/browser/extensions/extensions_service_unittest.cc +++ b/chrome/browser/extensions/extensions_service_unittest.cc @@ -61,6 +61,7 @@ const char* const good_crx = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; const char* const page_action = "obcimlgaoabeegjmmpldobjndiealpln"; const char* const theme_crx = "iamefpfkojoapidjnbafmgkgncegbkad"; const char* const theme2_crx = "pjpgmfcmabopnnfonnhmdjglfpjjfkbf"; +const char* const app_crx = "hnbefahlpjbkldcaldefcnonockppomb"; struct ExtensionsOrder { bool operator()(const Extension* a, const Extension* b) { @@ -381,22 +382,6 @@ class ExtensionsServiceTest void TestExternalProvider(MockExtensionProvider* provider, Extension::Location location); - void PackAndInstallExtension(const FilePath& dir_path, - bool should_succeed) { - FilePath crx_path; - ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &crx_path)); - crx_path = crx_path.AppendASCII("temp.crx"); - FilePath pem_path = crx_path.DirName().AppendASCII("temp.pem"); - - ASSERT_TRUE(file_util::Delete(crx_path, false)); - ASSERT_TRUE(file_util::Delete(pem_path, false)); - scoped_ptr<ExtensionCreator> creator(new ExtensionCreator()); - ASSERT_TRUE(creator->Run(dir_path, crx_path, FilePath(), pem_path)); - ASSERT_TRUE(file_util::PathExists(crx_path)); - - InstallExtension(crx_path, should_succeed); - } - void InstallExtension(const FilePath& path, bool should_succeed) { ASSERT_TRUE(file_util::PathExists(path)); @@ -996,15 +981,28 @@ TEST_F(ExtensionsServiceTest, LoadLocalizedTheme) { } TEST_F(ExtensionsServiceTest, InstallLocalizedTheme) { + // Pack. InitializeEmptyExtensionsService(); - FilePath theme_path; - ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &theme_path)); - theme_path = theme_path + FilePath extension_path; + ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &extension_path)); + extension_path = extension_path .AppendASCII("extensions") .AppendASCII("theme_i18n"); - PackAndInstallExtension(theme_path, true); + FilePath crx_path; + ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &crx_path)); + crx_path = crx_path.AppendASCII("theme.crx"); + FilePath pem_path = crx_path.DirName().AppendASCII("theme.pem"); + + ASSERT_TRUE(file_util::Delete(crx_path, false)); + ASSERT_TRUE(file_util::Delete(pem_path, false)); + scoped_ptr<ExtensionCreator> creator(new ExtensionCreator()); + ASSERT_TRUE(creator->Run(extension_path, crx_path, FilePath(), pem_path)); + ASSERT_TRUE(file_util::PathExists(crx_path)); + // Install. + service_->UnloadAllExtensions(); + InstallExtension(crx_path, true); EXPECT_EQ(0u, GetErrors().size()); EXPECT_EQ(1u, service_->extensions()->size()); EXPECT_EQ("name", service_->extensions()->at(0)->name()); @@ -1018,20 +1016,18 @@ TEST_F(ExtensionsServiceTest, InstallApps) { extensions_path = extensions_path.AppendASCII("extensions"); // An empty app. - PackAndInstallExtension(extensions_path.AppendASCII("app1"), true); + InstallExtension(extensions_path.AppendASCII("app1.crx"), true); int pref_count = 0; ValidatePrefKeyCount(++pref_count); - ASSERT_EQ(1u, service_->extensions()->size()); - std::string id = service_->extensions()->at(0)->id(); - ValidateIntegerPref(id, L"state", Extension::ENABLED); - ValidateIntegerPref(id, L"location", Extension::INTERNAL); + ValidateIntegerPref(app_crx, L"state", Extension::ENABLED); + ValidateIntegerPref(app_crx, L"location", Extension::INTERNAL); // Another app with non-overlapping extent. Should succeed. - PackAndInstallExtension(extensions_path.AppendASCII("app2"), true); + InstallExtension(extensions_path.AppendASCII("app2.crx"), true); ValidatePrefKeyCount(++pref_count); // A third app whose extent overlaps the first. Should fail. - PackAndInstallExtension(extensions_path.AppendASCII("app3"), false); + InstallExtension(extensions_path.AppendASCII("app3.crx"), false); ValidatePrefKeyCount(pref_count); } @@ -1303,7 +1299,7 @@ TEST_F(ExtensionsServiceTest, UpdatePendingExtensionAlreadyInstalled) { // balk. service_->AddPendingExtensionInternal( good->id(), good->update_url(), *good->version(), - good->is_theme(), kGoodInstallSilently); + good->IsTheme(), kGoodInstallSilently); UpdateExtension(good->id(), path, true, true, false); diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index 8c6664b..9155705 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -55,7 +55,7 @@ namespace { static bool ShouldShowExtension(Extension* extension) { // Don't show the themes since this page's UI isn't really useful for // themes. - if (extension->is_theme()) + if (extension->IsTheme()) return false; // Don't show component extensions because they are only extensions as an diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc index ab72325..600d832 100644 --- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc @@ -276,7 +276,10 @@ DictionaryValue* SandboxedExtensionUnpacker::RewriteManifestFile( static_cast<DictionaryValue*>(manifest.DeepCopy())); final_manifest->SetString(extension_manifest_keys::kPublicKey, public_key_); - if (final_manifest->HasKey(extension_manifest_keys::kApp)) { + bool web_content_enabled = false; + if (final_manifest->GetBoolean(extension_manifest_keys::kWebContentEnabled, + &web_content_enabled) && + web_content_enabled) { bool has_web_origin = final_manifest->Get(extension_manifest_keys::kWebOrigin, NULL); if (force_web_origin_override_) { diff --git a/chrome/browser/gtk/extension_install_prompt2_gtk.cc b/chrome/browser/gtk/extension_install_prompt2_gtk.cc index 106a0eb..6a442f2 100644 --- a/chrome/browser/gtk/extension_install_prompt2_gtk.cc +++ b/chrome/browser/gtk/extension_install_prompt2_gtk.cc @@ -107,7 +107,7 @@ void ShowInstallPromptDialog2(GtkWindow* parent, SkBitmap* skia_icon, !show_permissions, !show_permissions, 0); if (show_permissions) { - int label = extension->is_app() ? + int label = extension->IsApp() ? IDS_EXTENSION_PROMPT2_APP_WILL_HAVE_ACCESS_TO : IDS_EXTENSION_PROMPT2_WILL_HAVE_ACCESS_TO; GtkWidget* warning_label = gtk_label_new(l10n_util::GetStringUTF8( diff --git a/chrome/browser/sync/glue/extension_util.cc b/chrome/browser/sync/glue/extension_util.cc index 9cc8f7f..e2b7505 100644 --- a/chrome/browser/sync/glue/extension_util.cc +++ b/chrome/browser/sync/glue/extension_util.cc @@ -17,11 +17,11 @@ namespace browser_sync { bool IsExtensionSyncable(const Extension& extension) { - if (extension.is_theme()) { + if (extension.IsTheme()) { return false; } - // TODO(akalin): Add Extensions::is_app(). + // TODO(akalin): Add Extensions::IsApp(). // TODO(akalin): Figure out if we want to treat extensions and apps // identically after all. if (!extension.GetFullLaunchURL().is_empty()) { diff --git a/chrome/browser/sync/glue/theme_change_processor.cc b/chrome/browser/sync/glue/theme_change_processor.cc index c4e4f68..c44dbb1 100644 --- a/chrome/browser/sync/glue/theme_change_processor.cc +++ b/chrome/browser/sync/glue/theme_change_processor.cc @@ -19,7 +19,7 @@ namespace browser_sync { namespace { std::string GetThemeId(Extension* current_theme) { if (current_theme) { - DCHECK(current_theme->is_theme()); + DCHECK(current_theme->IsTheme()); } return current_theme ? current_theme->id() : "default/system"; } @@ -56,7 +56,7 @@ void ThemeChangeProcessor::Observe(NotificationType type, DCHECK_EQ(Source<BrowserThemeProvider>(source).ptr(), profile_->GetThemeProvider()); if (extension != NULL) { - DCHECK(extension->is_theme()); + DCHECK(extension->IsTheme()); DCHECK_EQ(extension->id(), current_or_future_theme_id); if (!current_theme || (current_theme->id() != extension->id())) { return; @@ -71,7 +71,7 @@ void ThemeChangeProcessor::Observe(NotificationType type, // installed successfully. DCHECK_EQ(Source<Profile>(source).ptr(), profile_); CHECK(extension); - if (!extension->is_theme()) { + if (!extension->IsTheme()) { return; } LOG(INFO) << "Got EXTENSION_LOADED notification for theme " @@ -87,7 +87,7 @@ void ThemeChangeProcessor::Observe(NotificationType type, // theme). DCHECK_EQ(Source<Profile>(source).ptr(), profile_); CHECK(extension); - if (!extension->is_theme()) { + if (!extension->IsTheme()) { return; } LOG(INFO) << "Got EXTENSION_UNLOADED notification for theme " @@ -101,7 +101,7 @@ void ThemeChangeProcessor::Observe(NotificationType type, DCHECK_EQ(extension, current_theme); if (extension) { - DCHECK(extension->is_theme()); + DCHECK(extension->IsTheme()); } LOG(INFO) << "Theme changed to " << GetThemeId(extension); diff --git a/chrome/browser/sync/glue/theme_util.cc b/chrome/browser/sync/glue/theme_util.cc index 4ea65a4..75f768a 100644 --- a/chrome/browser/sync/glue/theme_util.cc +++ b/chrome/browser/sync/glue/theme_util.cc @@ -91,7 +91,7 @@ void SetCurrentThemeFromThemeSpecifics( CHECK(extensions_service); Extension* extension = extensions_service->GetExtensionById(id, true); if (extension) { - if (!extension->is_theme()) { + if (!extension->IsTheme()) { LOG(INFO) << "Extension " << id << " is not a theme; aborting"; return; } @@ -111,7 +111,7 @@ void SetCurrentThemeFromThemeSpecifics( { const Extension* current_theme = profile->GetTheme(); if (current_theme) { - DCHECK(current_theme->is_theme()); + DCHECK(current_theme->IsTheme()); previous_theme_id = current_theme->id(); } } @@ -159,7 +159,7 @@ void GetThemeSpecificsFromCurrentTheme( DCHECK(profile); const Extension* current_theme = profile->GetTheme(); if (current_theme) { - DCHECK(current_theme->is_theme()); + DCHECK(current_theme->IsTheme()); } GetThemeSpecificsFromCurrentThemeHelper( current_theme, @@ -183,7 +183,7 @@ void GetThemeSpecificsFromCurrentThemeHelper( } if (use_custom_theme) { DCHECK(current_theme); - DCHECK(current_theme->is_theme()); + DCHECK(current_theme->IsTheme()); theme_specifics->set_custom_theme_name(current_theme->name()); theme_specifics->set_custom_theme_id(current_theme->id()); theme_specifics->set_custom_theme_update_url( diff --git a/chrome/browser/views/extensions/extension_install_prompt2.cc b/chrome/browser/views/extensions/extension_install_prompt2.cc index 397ade7..cb6dab9 100644 --- a/chrome/browser/views/extensions/extension_install_prompt2.cc +++ b/chrome/browser/views/extensions/extension_install_prompt2.cc @@ -139,7 +139,7 @@ InstallDialogContent2::InstallDialogContent2( right_column_width_ = kNoPermissionsRightColumnWidth; } else { right_column_width_ = kPermissionBoxWidth; - int label = extension->is_app() ? + int label = extension->IsApp() ? IDS_EXTENSION_PROMPT2_APP_WILL_HAVE_ACCESS_TO : IDS_EXTENSION_PROMPT2_WILL_HAVE_ACCESS_TO; will_have_access_to_ = new views::Label(l10n_util::GetString(label)); diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index d2b3d3b..a5780c2 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -518,20 +518,38 @@ bool Extension::ContainsNonThemeKeys(const DictionaryValue& source) { return false; } -bool Extension::LoadIsApp(const DictionaryValue* manifest, - std::string* error) { - if (manifest->HasKey(keys::kApp)) { - if (!apps_enabled_) { +bool Extension::CheckAppsAreEnabled(const DictionaryValue* manifest, + std::string* error) { + if (!apps_enabled_) { + if (manifest->HasKey(keys::kWebContent) || + manifest->HasKey(keys::kLaunch)) { *error = errors::kAppsNotEnabled; return false; - } else { - is_app_ = true; } } return true; } +bool Extension::LoadWebContentEnabled(const DictionaryValue* manifest, + std::string* error) { + Value* temp = NULL; + if (manifest->Get(keys::kWebContentEnabled, &temp)) { + if (!temp->GetAsBoolean(&web_content_enabled_)) { + *error = errors::kInvalidWebContentEnabled; + return false; + } + } + + // The enabled flag must be set to use the web_content dictionary at all. + if (!web_content_enabled_ && manifest->HasKey(keys::kWebContent)) { + *error = errors::kWebContentMustBeEnabled; + return false; + } + + return true; +} + bool Extension::LoadWebOrigin(const DictionaryValue* manifest, std::string* error) { Value* temp = NULL; @@ -648,9 +666,6 @@ bool Extension::LoadLaunchURL(const DictionaryValue* manifest, } launch_web_url_ = launch_url; - } else if (is_app_) { - *error = errors::kLaunchURLRequired; - return false; } return true; @@ -668,6 +683,11 @@ bool Extension::LoadLaunchContainer(const DictionaryValue* manifest, return false; } + if (launch_local_path_.empty() && launch_web_url_.empty()) { + *error = errors::kLaunchContainerWithoutURL; + return false; + } + if (launch_container_string == values::kLaunchContainerPanel) { launch_container_ = LAUNCH_PANEL; } else if (launch_container_string == values::kLaunchContainerTab) { @@ -699,7 +719,7 @@ bool Extension::LoadLaunchFullscreen(const DictionaryValue* manifest, Extension::Extension(const FilePath& path) : converted_from_user_script_(false), is_theme_(false), - is_app_(false), + web_content_enabled_(false), launch_container_(LAUNCH_TAB), launch_fullscreen_(false), background_page_ready_(false), @@ -1448,7 +1468,8 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, } } - if (!LoadIsApp(manifest_value_.get(), error) || + if (!CheckAppsAreEnabled(manifest_value_.get(), error) || + !LoadWebContentEnabled(manifest_value_.get(), error) || !LoadWebOrigin(manifest_value_.get(), error) || !LoadWebPaths(manifest_value_.get(), error) || !LoadLaunchURL(manifest_value_.get(), error) || @@ -1518,6 +1539,10 @@ std::set<FilePath> Extension::GetBrowserImages() { return image_paths; } +bool Extension::IsApp() const { + return !GetFullLaunchURL().is_empty(); +} + GURL Extension::GetFullLaunchURL() const { if (!launch_local_path_.empty()) { return extension_url_.Resolve(launch_local_path_); diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 512c7c0..4e1ce9b 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -299,7 +299,7 @@ class Extension { DictionaryValue* GetThemeDisplayProperties() const { return theme_display_properties_.get(); } - bool is_theme() const { return is_theme_; } + bool IsTheme() const { return is_theme_; } // Returns a list of paths (relative to the extension dir) for images that // the browser might load (like themes and page action icons). @@ -329,8 +329,12 @@ class Extension { const std::string omnibox_keyword() const { return omnibox_keyword_; } - bool is_app() const { return is_app_; } + // Is this extension an App? + bool IsApp() const; + + bool web_content_enabled() const { return web_content_enabled_; } const ExtensionExtent& web_extent() const { return web_extent_; } + const std::string& launch_local_path() const { return launch_local_path_; } const std::string& launch_web_url() const { return launch_web_url_; } LaunchContainer launch_container() const { return launch_container_; } @@ -379,8 +383,13 @@ class Extension { void(UserScript::*add_method)(const std::string& glob), UserScript *instance); + // Checks that apps features are enabled if the manifest tries to use any of + // them. + bool CheckAppsAreEnabled(const DictionaryValue* manifest, std::string* error); + // Helpers to load various chunks of the manifest. - bool LoadIsApp(const DictionaryValue* manifest, std::string* error); + bool LoadWebContentEnabled(const DictionaryValue* manifest, + std::string* error); bool LoadWebOrigin(const DictionaryValue* manifest, std::string* error); bool LoadWebPaths(const DictionaryValue* manifest, std::string* error); bool LoadLaunchContainer(const DictionaryValue* manifest, std::string* error); @@ -501,8 +510,8 @@ class Extension { // Defaults to the value from --enable-extension-apps. bool apps_enabled_; - // Whether this extension uses app features. - bool is_app_; + // Whether the extension can contain live web content. Defaults to false. + bool web_content_enabled_; // Defines the set of URLs in the extension's web content. ExtensionExtent web_extent_; diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc index be58611..d0a64e1 100644 --- a/chrome/common/extensions/extension_constants.cc +++ b/chrome/common/extensions/extension_constants.cc @@ -7,7 +7,6 @@ namespace extension_manifest_keys { const wchar_t* kAllFrames = L"all_frames"; -const wchar_t* kApp = L"app"; const wchar_t* kBackground = L"background_page"; const wchar_t* kBrowserAction = L"browser_action"; const wchar_t* kChromeURLOverrides = L"chrome_url_overrides"; @@ -19,11 +18,11 @@ const wchar_t* kDefaultLocale = L"default_locale"; const wchar_t* kDescription = L"description"; const wchar_t* kIcons = L"icons"; const wchar_t* kJs = L"js"; -const wchar_t* kLaunch = L"app.launch"; -const wchar_t* kLaunchContainer = L"app.launch.container"; -const wchar_t* kLaunchFullscreen = L"app.launch.fullscreen"; -const wchar_t* kLaunchLocalPath = L"app.launch.local_path"; -const wchar_t* kLaunchWebURL = L"app.launch.web_url"; +const wchar_t* kLaunch = L"launch"; +const wchar_t* kLaunchContainer = L"launch.container"; +const wchar_t* kLaunchFullscreen = L"launch.fullscreen"; +const wchar_t* kLaunchLocalPath = L"launch.local_path"; +const wchar_t* kLaunchWebURL = L"launch.web_url"; const wchar_t* kMatches = L"matches"; const wchar_t* kMinimumChromeVersion = L"minimum_chrome_version"; const wchar_t* kIncludeGlobs = L"include_globs"; @@ -59,9 +58,10 @@ const wchar_t* kType = L"type"; const wchar_t* kVersion = L"version"; const wchar_t* kUpdateURL = L"update_url"; const wchar_t* kOptionsPage = L"options_page"; -const wchar_t* kWebContent = L"app.web_content"; -const wchar_t* kWebOrigin = L"app.web_content.origin"; -const wchar_t* kWebPaths = L"app.web_content.paths"; +const wchar_t* kWebContent = L"web_content"; +const wchar_t* kWebContentEnabled = L"web_content.enabled"; +const wchar_t* kWebOrigin = L"web_content.origin"; +const wchar_t* kWebPaths = L"web_content.paths"; const wchar_t* kOmniboxKeyword = L"omnibox_keyword"; } // namespace extension_manifest_keys @@ -113,13 +113,13 @@ const char* kInvalidJs = const char* kInvalidJsList = "Required value 'content_scripts[*].js' is invalid."; const char* kInvalidLaunchContainer = - "Invalid value for 'app.launch.container'."; + "Invalid value for 'launch.container'."; const char* kInvalidLaunchFullscreen = - "Invalid value for 'app.launch.fullscreen'."; + "Invalid value for 'launch.fullscreen'."; const char* kInvalidLaunchLocalPath = - "Invalid value for 'app.launch.local_path'."; + "Invalid value for 'launch.local_path'."; const char* kInvalidLaunchWebURL = - "Invalid value for 'app.launch.web_url'."; + "Invalid value for 'launch.web_url'."; const char* kInvalidKey = "Value 'key' is missing or invalid."; const char* kInvalidManifest = @@ -209,23 +209,23 @@ const char* kInvalidThemeTints = const char* kInvalidUpdateURL = "Invalid value for update url: '[*]'."; const char* kInvalidWebContentEnabled = - "Invalid value for 'app.web_content.enabled'."; + "Invalid value for 'web_content.enabled'."; const char* kInvalidWebOrigin = - "Invalid value for 'app.web_content.origin'."; + "Invalid value for 'web_content.origin'."; const char* kInvalidWebPaths = - "Invalid value for 'app.web_content.paths'."; + "Invalid value for 'web_content.paths'."; const char* kInvalidWebPath = - "Invalid value for 'app.web_contents.paths[*]'."; + "Invalid value for 'web_contents.paths[*]'."; const char* kInvalidDefaultLocale = "Invalid value for default locale - locale name must be a string."; const char* kOneUISurfaceOnly = "An extension cannot have both a page action and a browser action."; const char* kThemesCannotContainExtensions = "A theme cannot contain extensions code."; +const char* kLaunchContainerWithoutURL = + "Launch container specified, but no local_path or web_url to launch."; const char* kLaunchPathAndURLAreExclusive = - "The 'app.launch.local_path' and 'launch.web_url' keys cannot both be set."; -const char* kLaunchURLRequired = - "Either 'app.launch.local_path' or 'app.launch.web_url' is required."; + "The 'launch.local_path' and 'launch.web_url' keys cannot both be set."; const char* kLocalesNoDefaultLocaleSpecified = "Localization used, but default_locale wasn't specified in the manifest."; const char* kLocalesNoDefaultMessages = @@ -243,6 +243,8 @@ const char* kReservedMessageFound = const char* kCannotAccessPage = "Cannot access contents of url \"*\". " "Extension manifest must request permission to access this host."; const char* kCannotScriptGallery = "The extensions gallery cannot be scripted."; +const char* kWebContentMustBeEnabled = "The 'web_content.enabled' property " + "must be set to true in order to use any other web content features."; const char* kInvalidOmniboxKeyword = "Invalid value for 'omnibox_keyword'."; const char* kOmniboxExperimental = diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h index c515c72..35c4555 100644 --- a/chrome/common/extensions/extension_constants.h +++ b/chrome/common/extensions/extension_constants.h @@ -8,7 +8,6 @@ // Keys used in JSON representation of extensions. namespace extension_manifest_keys { extern const wchar_t* kAllFrames; - extern const wchar_t* kApp; extern const wchar_t* kBackground; extern const wchar_t* kBrowserAction; extern const wchar_t* kMinimumChromeVersion; @@ -61,6 +60,7 @@ namespace extension_manifest_keys { extern const wchar_t* kUpdateURL; extern const wchar_t* kOptionsPage; extern const wchar_t* kWebContent; + extern const wchar_t* kWebContentEnabled; extern const wchar_t* kWebLaunchUrl; extern const wchar_t* kWebOrigin; extern const wchar_t* kWebPaths; @@ -150,8 +150,8 @@ namespace extension_manifest_errors { extern const char* kMultipleOverrides; extern const char* kInvalidUpdateURL; extern const char* kInvalidDefaultLocale; + extern const char* kLaunchContainerWithoutURL; extern const char* kLaunchPathAndURLAreExclusive; - extern const char* kLaunchURLRequired; extern const char* kLocalesNoDefaultLocaleSpecified; extern const char* kLocalesNoDefaultMessages; extern const char* kLocalesNoValidLocaleNamesListed; diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc index f62fc23..c25df25 100644 --- a/chrome/common/extensions/extension_file_util.cc +++ b/chrome/common/extensions/extension_file_util.cc @@ -146,7 +146,7 @@ bool ValidateExtension(Extension* extension, std::string* error) { } // Theme resource validation. - if (extension->is_theme()) { + if (extension->IsTheme()) { DictionaryValue* images_value = extension->GetThemeImages(); if (images_value) { for (DictionaryValue::key_iterator iter = images_value->begin_keys(); diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc index cc0047e..f1e59c3 100644 --- a/chrome/common/extensions/extension_manifests_unittest.cc +++ b/chrome/common/extensions/extension_manifests_unittest.cc @@ -82,11 +82,13 @@ TEST_F(ManifestTest, AppsDisabledByDefault) { #endif enable_apps_ = false; + LoadAndExpectError("web_content_disabled.json", errors::kAppsNotEnabled); LoadAndExpectError("launch_local_path.json", errors::kAppsNotEnabled); } TEST_F(ManifestTest, ValidApp) { scoped_ptr<Extension> extension(LoadAndExpectSuccess("valid_app.json")); + EXPECT_TRUE(extension->web_content_enabled()); EXPECT_EQ(GURL("http://www.google.com/"), extension->web_extent().origin()); EXPECT_EQ(2u, extension->web_extent().paths().size()); EXPECT_EQ("mail/", extension->web_extent().paths()[0]); @@ -96,6 +98,15 @@ TEST_F(ManifestTest, ValidApp) { EXPECT_EQ("mail/", extension->launch_web_url()); } +TEST_F(ManifestTest, AppWebContentEnabled) { + LoadAndExpectError("web_content_enabled_invalid.json", + errors::kInvalidWebContentEnabled); + LoadAndExpectError("web_content_disabled.json", + errors::kWebContentMustBeEnabled); + LoadAndExpectError("web_content_not_enabled.json", + errors::kWebContentMustBeEnabled); +} + TEST_F(ManifestTest, AppWebOrigin) { LoadAndExpectError("web_origin_wrong_type.json", errors::kInvalidWebOrigin); @@ -141,7 +152,7 @@ TEST_F(ManifestTest, AppLaunchContainer) { LoadAndExpectError("launch_container_invalid_value.json", errors::kInvalidLaunchContainer); LoadAndExpectError("launch_container_without_launch_url.json", - errors::kLaunchURLRequired); + errors::kLaunchContainerWithoutURL); LoadAndExpectError("launch_fullscreen_invalid.json", errors::kInvalidLaunchFullscreen); } diff --git a/chrome/test/data/extensions/app1.crx b/chrome/test/data/extensions/app1.crx Binary files differnew file mode 100644 index 0000000..df016a9 --- /dev/null +++ b/chrome/test/data/extensions/app1.crx diff --git a/chrome/test/data/extensions/app1/manifest.json b/chrome/test/data/extensions/app1/manifest.json deleted file mode 100644 index 9692490..0000000 --- a/chrome/test/data/extensions/app1/manifest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "Test App 1", - "version": "1", - "app": { - "web_content": { - "origin": "http://www.example.com/", - "paths": ["path1", "path2"] - }, - "launch": { - "web_url": "foo.html" - } - } -} diff --git a/chrome/test/data/extensions/app2.crx b/chrome/test/data/extensions/app2.crx Binary files differnew file mode 100644 index 0000000..5dd5ea7 --- /dev/null +++ b/chrome/test/data/extensions/app2.crx diff --git a/chrome/test/data/extensions/app2/manifest.json b/chrome/test/data/extensions/app2/manifest.json deleted file mode 100644 index b32b5c2..0000000 --- a/chrome/test/data/extensions/app2/manifest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "Test App 2", - "version": "1", - "app": { - "web_content": { - "origin": "http://www.example.com/", - "paths": ["path3", "path4"] - }, - "launch": { - "web_url": "foo.html" - } - } -} diff --git a/chrome/test/data/extensions/app3.crx b/chrome/test/data/extensions/app3.crx Binary files differnew file mode 100644 index 0000000..e840374 --- /dev/null +++ b/chrome/test/data/extensions/app3.crx diff --git a/chrome/test/data/extensions/app3/manifest.json b/chrome/test/data/extensions/app3/manifest.json deleted file mode 100644 index 08c616d..0000000 --- a/chrome/test/data/extensions/app3/manifest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "Test App 3", - "version": "1", - "app": { - "web_content": { - "origin": "http://www.example.com/", - "paths": ["path1/should_overlap", "path5"] - }, - "launch": { - "web_url": "foo.html" - } - } -} diff --git a/chrome/test/data/extensions/manifest_tests/launch_container_invalid_type.json b/chrome/test/data/extensions/manifest_tests/launch_container_invalid_type.json index 009ed45..3aa5a52 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_container_invalid_type.json +++ b/chrome/test/data/extensions/manifest_tests/launch_container_invalid_type.json @@ -1,10 +1,8 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": 42, - "local_path": "hot.html" - } + "launch": { + "container": 42, + "local_path": "hot.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_container_invalid_value.json b/chrome/test/data/extensions/manifest_tests/launch_container_invalid_value.json index 89b5fcd..f1b2ed6 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_container_invalid_value.json +++ b/chrome/test/data/extensions/manifest_tests/launch_container_invalid_value.json @@ -1,10 +1,8 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": "foobar", - "local_path": "dog.html" - } + "launch": { + "container": "foobar", + "local_path": "dog.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_container_without_launch_url.json b/chrome/test/data/extensions/manifest_tests/launch_container_without_launch_url.json index 34da266..66ea2e5 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_container_without_launch_url.json +++ b/chrome/test/data/extensions/manifest_tests/launch_container_without_launch_url.json @@ -1,9 +1,7 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": "tab" - } + "launch": { + "container": "tab" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_fullscreen.json b/chrome/test/data/extensions/manifest_tests/launch_fullscreen.json index 9137105..f2bb685 100755 --- a/chrome/test/data/extensions/manifest_tests/launch_fullscreen.json +++ b/chrome/test/data/extensions/manifest_tests/launch_fullscreen.json @@ -1,11 +1,9 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": "window", - "fullscreen": true, - "local_path": "bar.html" - } + "launch": { + "container": "window", + "fullscreen": true, + "local_path": "bar.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_fullscreen_invalid.json b/chrome/test/data/extensions/manifest_tests/launch_fullscreen_invalid.json index 21cdfc9..01100ff 100755 --- a/chrome/test/data/extensions/manifest_tests/launch_fullscreen_invalid.json +++ b/chrome/test/data/extensions/manifest_tests/launch_fullscreen_invalid.json @@ -1,11 +1,9 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": "window", - "fullscreen": "true", - "local_path": "bar.html" - } + "launch": { + "container": "window", + "fullscreen": "true", + "local_path": "bar.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_local_path.json b/chrome/test/data/extensions/manifest_tests/launch_local_path.json index 79ec3f4..72dd2e0 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_local_path.json +++ b/chrome/test/data/extensions/manifest_tests/launch_local_path.json @@ -1,9 +1,7 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "local_path": "launch.html" - } + "launch": { + "local_path": "launch.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_panel.json b/chrome/test/data/extensions/manifest_tests/launch_panel.json index d7186ad..381cf35 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_panel.json +++ b/chrome/test/data/extensions/manifest_tests/launch_panel.json @@ -1,10 +1,8 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": "panel", - "web_url": "http://www.google.com/hot.html" - } + "launch": { + "container": "panel", + "web_url": "http://www.google.com/hot.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_path_and_url.json b/chrome/test/data/extensions/manifest_tests/launch_path_and_url.json index 0162f8c..93cb1bc 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_path_and_url.json +++ b/chrome/test/data/extensions/manifest_tests/launch_path_and_url.json @@ -1,10 +1,8 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "local_path": "foo", - "web_url": "http://www.google.com/" - } + "launch": { + "local_path": "foo", + "web_url": "http://www.google.com/" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_path_invalid_type.json b/chrome/test/data/extensions/manifest_tests/launch_path_invalid_type.json index 5d52292..583c61b 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_path_invalid_type.json +++ b/chrome/test/data/extensions/manifest_tests/launch_path_invalid_type.json @@ -1,9 +1,7 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "local_path": 42 - } + "launch": { + "local_path": 42 } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_path_invalid_value.json b/chrome/test/data/extensions/manifest_tests/launch_path_invalid_value.json index 802efd1..fd95800 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_path_invalid_value.json +++ b/chrome/test/data/extensions/manifest_tests/launch_path_invalid_value.json @@ -1,9 +1,7 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "local_path": "http://www.google.com/" - } + "launch": { + "local_path": "http://www.google.com/" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_tab.json b/chrome/test/data/extensions/manifest_tests/launch_tab.json index 60f6c45..650dd95 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_tab.json +++ b/chrome/test/data/extensions/manifest_tests/launch_tab.json @@ -1,10 +1,8 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": "tab", - "local_path": "foo.html" - } + "launch": { + "container": "tab", + "local_path": "foo.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_url_invalid_type.json b/chrome/test/data/extensions/manifest_tests/launch_url_invalid_type.json index 17a7d88..e6fa384 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_url_invalid_type.json +++ b/chrome/test/data/extensions/manifest_tests/launch_url_invalid_type.json @@ -1,9 +1,7 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "web_url": 42 - } + "launch": { + "web_url": 42 } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_web_url_absolute.json b/chrome/test/data/extensions/manifest_tests/launch_web_url_absolute.json index 669fe2f..b3e4270 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_web_url_absolute.json +++ b/chrome/test/data/extensions/manifest_tests/launch_web_url_absolute.json @@ -1,9 +1,7 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "web_url": "http://www.google.com/launch.html" - } + "launch": { + "web_url": "http://www.google.com/launch.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_web_url_relative.json b/chrome/test/data/extensions/manifest_tests/launch_web_url_relative.json index 1652c36..f62dad9 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_web_url_relative.json +++ b/chrome/test/data/extensions/manifest_tests/launch_web_url_relative.json @@ -1,12 +1,11 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "origin": "http://www.google.com/" - }, - "launch": { - "web_url": "launch.html" - } + "web_content": { + "enabled": true, + "origin": "http://www.google.com/" + }, + "launch": { + "web_url": "launch.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/launch_window.json b/chrome/test/data/extensions/manifest_tests/launch_window.json index fe1ea13..d73a9bf 100644 --- a/chrome/test/data/extensions/manifest_tests/launch_window.json +++ b/chrome/test/data/extensions/manifest_tests/launch_window.json @@ -1,10 +1,8 @@ { "name": "test", "version": "1", - "app": { - "launch": { - "container": "window", - "local_path": "bar.html" - } + "launch": { + "container": "window", + "local_path": "bar.html" } } diff --git a/chrome/test/data/extensions/manifest_tests/valid_app.json b/chrome/test/data/extensions/manifest_tests/valid_app.json index db53b3b..734cffb 100644 --- a/chrome/test/data/extensions/manifest_tests/valid_app.json +++ b/chrome/test/data/extensions/manifest_tests/valid_app.json @@ -1,18 +1,17 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "origin": "http://www.google.com/", - "paths": [ - "mail/", - "foobar/" - ] - }, - "launch": { - "container": "window", - "web_url": "mail/" - } + "web_content": { + "enabled": true, + "origin": "http://www.google.com/", + "paths": [ + "mail/", + "foobar/" + ] + }, + "launch": { + "container": "window", + "web_url": "mail/" }, "permissions": [ "notifications" diff --git a/chrome/test/data/extensions/manifest_tests/web_content_disabled.json b/chrome/test/data/extensions/manifest_tests/web_content_disabled.json new file mode 100644 index 0000000..a355142 --- /dev/null +++ b/chrome/test/data/extensions/manifest_tests/web_content_disabled.json @@ -0,0 +1,7 @@ +{ + "name": "test", + "version": "1", + "web_content": { + "enabled": false + } +} diff --git a/chrome/test/data/extensions/manifest_tests/web_content_enabled_invalid.json b/chrome/test/data/extensions/manifest_tests/web_content_enabled_invalid.json new file mode 100644 index 0000000..2411c2d --- /dev/null +++ b/chrome/test/data/extensions/manifest_tests/web_content_enabled_invalid.json @@ -0,0 +1,7 @@ +{ + "name": "test", + "version": "1", + "web_content": { + "enabled": 42 + } +} diff --git a/chrome/test/data/extensions/manifest_tests/web_content_not_enabled.json b/chrome/test/data/extensions/manifest_tests/web_content_not_enabled.json new file mode 100644 index 0000000..28f6469a --- /dev/null +++ b/chrome/test/data/extensions/manifest_tests/web_content_not_enabled.json @@ -0,0 +1,6 @@ +{ + "name": "test", + "version": "1", + "web_content": { + } +} diff --git a/chrome/test/data/extensions/manifest_tests/web_origin_invalid_1.json b/chrome/test/data/extensions/manifest_tests/web_origin_invalid_1.json index 171745a..69ad622 100644 --- a/chrome/test/data/extensions/manifest_tests/web_origin_invalid_1.json +++ b/chrome/test/data/extensions/manifest_tests/web_origin_invalid_1.json @@ -1,12 +1,8 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "origin": "wiggity" - }, - "launch": { - "web_url": "foo.html" - } + "web_content": { + "enabled": true, + "origin": "wiggity" } } diff --git a/chrome/test/data/extensions/manifest_tests/web_origin_invalid_2.json b/chrome/test/data/extensions/manifest_tests/web_origin_invalid_2.json index e8ec0ef..801b0b9 100644 --- a/chrome/test/data/extensions/manifest_tests/web_origin_invalid_2.json +++ b/chrome/test/data/extensions/manifest_tests/web_origin_invalid_2.json @@ -1,12 +1,8 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "origin": "ftp://www.google.com/" - }, - "launch": { - "web_url": "foo.html" - } + "web_content": { + "enabled": true, + "origin": "ftp://www.google.com/" } } diff --git a/chrome/test/data/extensions/manifest_tests/web_origin_invalid_3.json b/chrome/test/data/extensions/manifest_tests/web_origin_invalid_3.json index af93225..c6c3672 100644 --- a/chrome/test/data/extensions/manifest_tests/web_origin_invalid_3.json +++ b/chrome/test/data/extensions/manifest_tests/web_origin_invalid_3.json @@ -1,12 +1,8 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "origin": "https://www.google.com/monkey" - }, - "launch": { - "web_url": "foo.html" - } + "web_content": { + "enabled": true, + "origin": "https://www.google.com/monkey" } } diff --git a/chrome/test/data/extensions/manifest_tests/web_origin_web_content_disabled.json b/chrome/test/data/extensions/manifest_tests/web_origin_web_content_disabled.json new file mode 100644 index 0000000..5389879 --- /dev/null +++ b/chrome/test/data/extensions/manifest_tests/web_origin_web_content_disabled.json @@ -0,0 +1,7 @@ +{ + "name": "test", + "version": "1", + "web_content": { + "origin": "http://www.google.com/" + } +} diff --git a/chrome/test/data/extensions/manifest_tests/web_origin_wrong_type.json b/chrome/test/data/extensions/manifest_tests/web_origin_wrong_type.json index 930038b..42a2ae3 100644 --- a/chrome/test/data/extensions/manifest_tests/web_origin_wrong_type.json +++ b/chrome/test/data/extensions/manifest_tests/web_origin_wrong_type.json @@ -1,12 +1,8 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "origin": 42 - }, - "launch": { - "web_url": "foo.html" - } + "web_content": { + "enabled": true, + "origin": 42 } } diff --git a/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_1.json b/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_1.json index f29782e..f259790 100644 --- a/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_1.json +++ b/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_1.json @@ -1,14 +1,10 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "paths": [ - 42 - ] - }, - "launch": { - "web_url": "foo.html" - } + "web_content": { + "enabled": true, + "paths": [ + 42 + ] } } diff --git a/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_2.json b/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_2.json index faa9460..d435ee4 100644 --- a/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_2.json +++ b/chrome/test/data/extensions/manifest_tests/web_paths_invalid_path_2.json @@ -1,14 +1,10 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "paths": [ - "http://www.google.com/monkey" - ] - }, - "launch": { - "web_url": "foo.html" - } + "web_content": { + "enabled": true, + "paths": [ + "http://www.google.com/monkey" + ] } } diff --git a/chrome/test/data/extensions/manifest_tests/web_paths_wrong_type.json b/chrome/test/data/extensions/manifest_tests/web_paths_wrong_type.json index 356e6a2..56e0b28 100644 --- a/chrome/test/data/extensions/manifest_tests/web_paths_wrong_type.json +++ b/chrome/test/data/extensions/manifest_tests/web_paths_wrong_type.json @@ -1,12 +1,8 @@ { "name": "test", "version": "1", - "app": { - "web_content": { - "paths": 42 - }, - "launch": { - "web_url": "foo.html" - } + "web_content": { + "enabled": true, + "paths": 42 } } |