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

Unified Diff: chrome/browser/extensions/context_menu_matcher.cc

Issue 470693003: Cleanup: Remove more unneeded ifdefs in chrome/browser/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/extensions/context_menu_matcher.h ('k') | chrome/browser/extensions/data_deleter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/context_menu_matcher.cc
diff --git a/chrome/browser/extensions/context_menu_matcher.cc b/chrome/browser/extensions/context_menu_matcher.cc
index 18a0058d5b60204ca6c05a449a9f2b41ac308884..d4736c9b0e31dbdb5ffade0c31fe93bac0f47720 100644
--- a/chrome/browser/extensions/context_menu_matcher.cc
+++ b/chrome/browser/extensions/context_menu_matcher.cc
@@ -8,26 +8,19 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/extensions/extension_service.h"
Devlin 2014/08/14 21:39:49 if you remove the service I commented on, don't ne
Lei Zhang 2014/08/14 21:47:14 Done.
#include "chrome/browser/extensions/extension_util.h"
+#include "chrome/common/extensions/api/context_menus.h"
#include "content/public/browser/browser_context.h"
#include "content/public/common/context_menu_params.h"
#include "extensions/browser/extension_system.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/image/image.h"
-#if defined(ENABLE_EXTENSIONS)
-#include "chrome/common/extensions/api/context_menus.h"
-#endif
-
namespace extensions {
namespace {
int GetActionMenuTopLevelLimit() {
Devlin 2014/08/14 21:39:50 could we just use ACTION_MENU_TOP_LEVEL_LIMIT dire
Lei Zhang 2014/08/14 21:47:14 Done.
-#if defined(ENABLE_EXTENSIONS)
return api::context_menus::ACTION_MENU_TOP_LEVEL_LIMIT;
-#else
- return 0;
-#endif
}
// The range of command IDs reserved for extension's custom menus.
@@ -77,7 +70,7 @@ void ContextMenuMatcher::AppendExtensionItems(
MenuItem::List items;
bool can_cross_incognito;
if (!GetRelevantExtensionTopLevelItems(
- extension_key, &extension, &can_cross_incognito, items))
+ extension_key, &extension, &can_cross_incognito, &items))
return;
if (items.empty())
@@ -151,7 +144,7 @@ base::string16 ContextMenuMatcher::GetTopLevelContextMenuTitle(
MenuItem::List items;
bool can_cross_incognito;
GetRelevantExtensionTopLevelItems(
- extension_key, &extension, &can_cross_incognito, items);
+ extension_key, &extension, &can_cross_incognito, &items);
base::string16 title;
@@ -196,9 +189,9 @@ bool ContextMenuMatcher::GetRelevantExtensionTopLevelItems(
const MenuItem::ExtensionKey& extension_key,
const Extension** extension,
bool* can_cross_incognito,
- MenuItem::List& items) {
+ MenuItem::List* items) {
ExtensionService* service =
- extensions::ExtensionSystem::Get(browser_context_)->extension_service();
+ ExtensionSystem::Get(browser_context_)->extension_service();
*extension = service->GetExtensionById(extension_key.extension_id, false);
Devlin 2014/08/14 21:39:49 Since you're hear, mind changing this to Extension
Lei Zhang 2014/08/14 21:47:14 Done.
if (!*extension)
@@ -211,8 +204,7 @@ bool ContextMenuMatcher::GetRelevantExtensionTopLevelItems(
return false;
*can_cross_incognito = util::CanCrossIncognito(*extension, browser_context_);
- items = GetRelevantExtensionItems(*all_items,
- *can_cross_incognito);
+ *items = GetRelevantExtensionItems(*all_items, *can_cross_incognito);
return true;
}
« no previous file with comments | « chrome/browser/extensions/context_menu_matcher.h ('k') | chrome/browser/extensions/data_deleter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698