Skip to content

Commit

Permalink
Cleanup: Remove unneeded extension_messages.h usage and ifdef out som…
Browse files Browse the repository at this point in the history
…e extensions code usage when extensions are disabled.

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

Cr-Commit-Position: refs/heads/master@{#295587}
  • Loading branch information
leizleiz authored and Commit bot committed Sep 18, 2014
1 parent 3e8588f commit b012bc3
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 15 deletions.
1 change: 0 additions & 1 deletion apps/launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "extensions/browser/process_manager.h"
#include "extensions/common/api/app_runtime.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
#include "net/base/filename_util.h"
#include "net/base/net_util.h"
Expand Down
19 changes: 18 additions & 1 deletion chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "components/nacl/common/nacl_switches.h"
#include "components/search/search_switches.h"
#include "content/public/browser/user_metrics.h"
#include "extensions/common/switches.h"
#include "media/base/media_switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_switches.h"
Expand Down Expand Up @@ -63,6 +62,10 @@
#include "ui/app_list/app_list_switches.h"
#endif

#if defined(ENABLE_EXTENSIONS)
#include "extensions/common/switches.h"
#endif

using base::UserMetricsAction;

namespace about_flags {
Expand Down Expand Up @@ -658,6 +661,7 @@ const Experiment kExperiments[] = {
MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
},
#endif
#if defined(ENABLE_EXTENSIONS)
{
"extension-apis", // FLAGS:RECORD_UMA
IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
Expand All @@ -672,20 +676,23 @@ const Experiment kExperiments[] = {
kOsAll,
SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)
},
#endif
{
"enable-fast-unload",
IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableFastUnload)
},
#if defined(ENABLE_EXTENSIONS)
{
"enable-app-window-controls",
IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
kOsDesktop,
SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)
},
#endif
{
"disable-hyperlink-auditing",
IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
Expand Down Expand Up @@ -1468,13 +1475,15 @@ const Experiment kExperiments[] = {
SINGLE_VALUE_TYPE(switches::kEnableAppList)
},
#endif
#if defined(ENABLE_EXTENSIONS)
{
"enable-app-view",
IDS_FLAGS_ENABLE_APP_VIEW_NAME,
IDS_FLAGS_ENABLE_APP_VIEW_DESCRIPTION,
kOsDesktop,
SINGLE_VALUE_TYPE(extensions::switches::kEnableAppView)
},
#endif
{
"disable-app-list-app-info",
IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST,
Expand Down Expand Up @@ -1588,13 +1597,15 @@ const Experiment kExperiments[] = {
SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)
},
#endif
#if defined(ENABLE_EXTENSIONS)
{
"enable-apps-show-on-first-paint",
IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
kOsDesktop,
SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
},
#endif
{
"enhanced-bookmarks-experiment",
IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
Expand Down Expand Up @@ -1811,13 +1822,15 @@ const Experiment kExperiments[] = {
switches::kDisableTextInputFocusManager)
},
#endif
#if defined(ENABLE_EXTENSIONS)
{
"extension-active-script-permission",
IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
kOsAll,
SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)
},
#endif
{
"harfbuzz-rendertext",
IDS_FLAGS_HARFBUZZ_RENDERTEXT_NAME,
Expand Down Expand Up @@ -1853,13 +1866,15 @@ const Experiment kExperiments[] = {
kOsDesktop,
SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwording)
},
#if defined(ENABLE_EXTENSIONS)
{
"enable-embedded-extension-options",
IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
kOsDesktop,
SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
},
#endif
{
"enable-website-settings-manager",
IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
Expand All @@ -1881,13 +1896,15 @@ const Experiment kExperiments[] = {
kOsAll,
MULTI_VALUE_TYPE(kEnableDropSyncCredentialChoices)
},
#if defined(ENABLE_EXTENSIONS)
{
"enable-extension-action-redesign",
IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
kOsWin | kOsLinux | kOsCrOS,
SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)
},
#endif
{
"autofill-sync-credential",
IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/apps/app_url_redirector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "content/public/browser/web_contents.h"
#include "extensions/browser/info_map.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/extension_set.h"
#include "net/url_request/url_request.h"

Expand Down
1 change: 0 additions & 1 deletion chrome/browser/extensions/api/messaging/message_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/manifest_handlers/externally_connectable.h"
Expand Down
7 changes: 7 additions & 0 deletions chrome/browser/sessions/session_tab_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"

#if defined(ENABLE_EXTENSIONS)
#include "extensions/common/extension_messages.h"
#endif

DEFINE_WEB_CONTENTS_USER_DATA_KEY(SessionTabHelper);

Expand All @@ -25,11 +28,13 @@ SessionTabHelper::~SessionTabHelper() {
void SessionTabHelper::SetWindowID(const SessionID& id) {
window_id_ = id;

#if defined(ENABLE_EXTENSIONS)
// Extension code in the renderer holds the ID of the window that hosts it.
// Notify it that the window ID changed.
web_contents()->GetRenderViewHost()->Send(
new ExtensionMsg_UpdateBrowserWindowId(
web_contents()->GetRenderViewHost()->GetRoutingID(), id.id()));
#endif
}

// static
Expand All @@ -47,12 +52,14 @@ SessionID::id_type SessionTabHelper::IdForWindowContainingTab(
return session_tab_helper ? session_tab_helper->window_id().id() : -1;
}

#if defined(ENABLE_EXTENSIONS)
void SessionTabHelper::RenderViewCreated(
content::RenderViewHost* render_view_host) {
render_view_host->Send(
new ExtensionMsg_UpdateBrowserWindowId(render_view_host->GetRoutingID(),
window_id_.id()));
}
#endif

void SessionTabHelper::UserAgentOverrideSet(const std::string& user_agent) {
#if defined(ENABLE_SESSION_SERVICE)
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/sessions/session_tab_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ class SessionTabHelper : public content::WebContentsObserver,
const content::WebContents* tab);

// content::WebContentsObserver:
#if defined(ENABLE_EXTENSIONS)
virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
#endif
virtual void UserAgentOverrideSet(const std::string& user_agent) OVERRIDE;

private:
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/themes/theme_syncable_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "content/public/test/test_browser_thread.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/api_permission_set.h"
#include "extensions/common/permissions/permission_set.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/ui/webui/sync_internals_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "extensions/common/extension_messages.h"
#include "grit/sync_internals_resources.h"

namespace {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/values.h"
#include "chrome/grit/generated_resources.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/feature_switch.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/manifest_permission.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/test_extensions_renderer_client.h"
Expand Down
1 change: 0 additions & 1 deletion extensions/browser/lazy_background_task_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/view_type.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "extensions/common/api/bluetooth/bluetooth_manifest_data.h"
#include "extensions/common/api/extensions_manifest_types.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
#include "grit/extensions_strings.h"
#include "ipc/ipc_message.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "extensions/common/api/extensions_manifest_types.h"
#include "extensions/common/api/sockets/sockets_manifest_data.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
#include "grit/extensions_strings.h"
#include "ipc/ipc_message.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "base/pickle.h"
#include "base/values.h"
#include "extensions/common/api/sockets/sockets_manifest_permission.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
#include "ipc/ipc_message.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "base/pickle.h"
#include "base/values.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/permissions/manifest_permission.h"
#include "extensions/common/permissions/manifest_permission_set.h"
#include "ipc/ipc_message.h"
Expand Down
2 changes: 1 addition & 1 deletion extensions/renderer/module_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "content/public/renderer/render_view.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/extension.h"
#include "extensions/common/extensions_client.h"
#include "extensions/renderer/console.h"
#include "extensions/renderer/safe_builtins.h"
Expand Down
1 change: 0 additions & 1 deletion extensions/renderer/user_script_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_thread.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/renderer/extensions_renderer_client.h"
Expand Down

0 comments on commit b012bc3

Please sign in to comment.