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

Unified Diff: chrome/browser/ui/ash/launcher/launcher_context_menu.cc

Issue 10984034: Revert 158691 - Give platform apps control over launcher right-click context menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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/ash/launcher/launcher_context_menu.h ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/launcher_context_menu.cc
===================================================================
--- chrome/browser/ui/ash/launcher/launcher_context_menu.cc (revision 158704)
+++ chrome/browser/ui/ash/launcher/launcher_context_menu.cc (working copy)
@@ -7,31 +7,18 @@
#include "ash/launcher/launcher_context_menu.h"
#include "ash/shell.h"
#include "base/command_line.h"
-#include "chrome/browser/extensions/context_menu_matcher.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/common/chrome_switches.h"
-#include "content/public/common/context_menu_params.h"
#include "grit/ash_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-namespace {
-
-bool MenuItemHasLauncherContext(const extensions::MenuItem* item) {
- return item->contexts().Contains(extensions::MenuItem::LAUNCHER);
-}
-
-} // namespace
-
LauncherContextMenu::LauncherContextMenu(ChromeLauncherController* controller,
const ash::LauncherItem* item)
: ui::SimpleMenuModel(NULL),
controller_(controller),
- item_(item ? *item : ash::LauncherItem()),
- extension_items_(new extensions::ContextMenuMatcher(
- controller->profile(), this, this,
- base::Bind(MenuItemHasLauncherContext))) {
+ item_(item ? *item : ash::LauncherItem()) {
set_delegate(this);
if (is_valid_item()) {
@@ -80,14 +67,6 @@
}
AddSeparator(ui::NORMAL_SEPARATOR);
}
- std::string app_id = controller->GetAppIDForLauncherID(item_.id);
- if (!app_id.empty()) {
- int index = 0;
- extension_items_->AppendExtensionItems(
- app_id, string16(), &index);
- if (index > 0)
- AddSeparator(ui::NORMAL_SEPARATOR);
- }
AddCheckItemWithStringId(
MENU_AUTO_HIDE, ash::LauncherContextMenu::GetAutoHideResourceStringId());
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -118,7 +97,7 @@
case MENU_AUTO_HIDE:
return ash::LauncherContextMenu::IsAutoHideMenuHideChecked();
default:
- return extension_items_->IsCommandIdChecked(command_id);
+ return false;
}
}
@@ -128,7 +107,7 @@
return item_.type == ash::TYPE_PLATFORM_APP ||
controller_->IsPinnable(item_.id);
default:
- return extension_items_->IsCommandIdEnabled(command_id);
+ return true;
}
}
@@ -177,8 +156,5 @@
break;
case MENU_ALIGNMENT_MENU:
break;
- default:
- extension_items_->ExecuteCommand(command_id,
- content::ContextMenuParams());
}
}
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_context_menu.h ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698