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

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 10264004: Generate a browser action for any extension which doesn't have a browser or (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/extensions/extension_settings_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index 75915b69f6ea2bcf914851af68aa97627e3c09f4..11271cd8d74de21d5aeaaa53d5329c00f66f6724 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -56,37 +56,6 @@ using content::RenderViewHost;
using content::WebContents;
using extensions::ExtensionUpdater;
-namespace {
-
-bool ShouldShowExtension(const Extension* extension) {
- // Don't show themes since this page's UI isn't really useful for themes.
- if (extension->is_theme())
- return false;
-
- // Don't show component extensions because they are only extensions as an
- // implementation detail of Chrome.
- if (extension->location() == Extension::COMPONENT &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kShowComponentExtensionOptions))
- return false;
-
- // Always show unpacked extensions and apps.
- if (extension->location() == Extension::LOAD)
- return true;
-
- // Unless they are unpacked, never show hosted apps. Note: We intentionally
- // show packaged apps and platform apps because there are some pieces of
- // functionality that are only available in chrome://extensions/ but which
- // are needed for packaged and platform apps. For example, inspecting
- // background pages. See http://crbug.com/116134.
- if (extension->is_hosted_app())
- return false;
-
- return true;
-}
-
-} // namespace
-
///////////////////////////////////////////////////////////////////////////////
//
// ExtensionSettingsHandler
@@ -467,7 +436,7 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData(
const ExtensionSet* extensions = extension_service_->extensions();
for (ExtensionSet::const_iterator extension = extensions->begin();
extension != extensions->end(); ++extension) {
- if (ShouldShowExtension(*extension)) {
+ if ((*extension)->ShouldDisplayInExtensionSettings()) {
extensions_list->Append(CreateExtensionDetailValue(
*extension,
GetInspectablePagesForExtension(*extension, true),
@@ -477,7 +446,7 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData(
extensions = extension_service_->disabled_extensions();
for (ExtensionSet::const_iterator extension = extensions->begin();
extension != extensions->end(); ++extension) {
- if (ShouldShowExtension(*extension)) {
+ if ((*extension)->ShouldDisplayInExtensionSettings()) {
extensions_list->Append(CreateExtensionDetailValue(
*extension,
GetInspectablePagesForExtension(*extension, false),
@@ -488,7 +457,7 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData(
std::vector<ExtensionPage> empty_pages;
for (ExtensionSet::const_iterator extension = extensions->begin();
extension != extensions->end(); ++extension) {
- if (ShouldShowExtension(*extension)) {
+ if ((*extension)->ShouldDisplayInExtensionSettings()) {
extensions_list->Append(CreateExtensionDetailValue(
*extension,
empty_pages, // Terminated process has no active pages.
« no previous file with comments | « no previous file | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698