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

Unified Diff: chrome/browser/ui/browser_commands.cc

Issue 664553007: Cleanup: Put more chrome/ code behind ENABLE_EXTENSIONS ifdefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: fix android Created 6 years, 2 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 | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index f48b1ccb9e0e198ce4bc40ad2adc65ffa5caf7da..05cf5a2575707536b3f124d4e856953519d2667c 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -17,9 +17,6 @@
#include "chrome/browser/chrome_page_zoom.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/dom_distiller/tab_utils.h"
-#include "chrome/browser/extensions/api/commands/command_service.h"
-#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
-#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/platform_util.h"
@@ -53,14 +50,11 @@
#include "chrome/browser/ui/status_bubble.h"
#include "chrome/browser/ui/tab_contents/core_tab_helper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
#include "chrome/browser/ui/zoom/zoom_controller.h"
#include "chrome/browser/upgrade_detector.h"
-#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/content_restriction.h"
-#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "chrome/common/pref_names.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
@@ -88,6 +82,12 @@
#endif
#if defined(ENABLE_EXTENSIONS)
+#include "chrome/browser/extensions/api/commands/command_service.h"
+#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
+#include "chrome/browser/extensions/tab_helper.h"
+#include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
+#include "chrome/browser/web_applications/web_app.h"
+#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
@@ -130,12 +130,12 @@ bool CanBookmarkCurrentPageInternal(const Browser* browser,
!chrome::ShouldRemoveBookmarkThisPageUI(browser->profile()));
}
+#if defined(ENABLE_EXTENSIONS)
bool GetBookmarkOverrideCommand(
Profile* profile,
const extensions::Extension** extension,
extensions::Command* command,
extensions::CommandService::ExtensionCommandType* command_type) {
-#if defined(ENABLE_EXTENSIONS)
DCHECK(extension);
DCHECK(command);
DCHECK(command_type);
@@ -164,10 +164,9 @@ bool GetBookmarkOverrideCommand(
return true;
}
}
-#endif
-
return false;
}
+#endif
void BookmarkCurrentPageInternal(Browser* browser) {
content::RecordAction(UserMetricsAction("Star"));
@@ -745,6 +744,7 @@ void Exit() {
void BookmarkCurrentPage(Browser* browser) {
DCHECK(!chrome::ShouldRemoveBookmarkThisPageUI(browser->profile()));
+#if defined(ENABLE_EXTENSIONS)
const extensions::Extension* extension = NULL;
extensions::Command command;
extensions::CommandService::ExtensionCommandType command_type;
@@ -766,6 +766,7 @@ void BookmarkCurrentPage(Browser* browser) {
}
return;
}
+#endif
BookmarkCurrentPageInternal(browser);
}
@@ -1242,6 +1243,7 @@ bool CanViewSource(const Browser* browser) {
CanViewSource();
}
+#if defined(ENABLE_EXTENSIONS)
void CreateApplicationShortcuts(Browser* browser) {
content::RecordAction(UserMetricsAction("CreateShortcut"));
extensions::TabHelper::FromWebContents(
@@ -1289,5 +1291,6 @@ void ConvertTabToAppWindow(Browser* browser,
contents->GetRenderViewHost()->SyncRendererPrefs();
app_browser->window()->Show();
}
+#endif // defined(ENABLE_EXTENSIONS)
} // namespace chrome
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698