From 889d59d5f6db7140cf7a154a75e1cea113540c8e Mon Sep 17 00:00:00 2001 From: "mek@chromium.org" Date: Wed, 10 Oct 2012 00:12:43 +0000 Subject: [PATCH] Add a separator between app's context menu commands and developer mode commands. BUG=154642 Review URL: https://chromiumcodereview.appspot.com/11087012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160991 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents/render_view_context_menu.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index c1e64936f229b5..1cff6df1aeec44 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -506,7 +506,7 @@ void RenderViewContextMenu::AppendPlatformAppItems() { bool has_selection = !params_.selection_text.empty(); - // Add undo/redo, cut/copy/paste etc for text fields + // Add undo/redo, cut/copy/paste etc for text fields. if (params_.is_editable) AppendEditableItems(); else if (has_selection) @@ -520,6 +520,12 @@ void RenderViewContextMenu::AppendPlatformAppItems() { if (platform_app->location() == Extension::LOAD || CommandLine::ForCurrentProcess()->HasSwitch( switches::kDebugPackedApps)) { + // Add a separator if there are any items already in the menu. + if (menu_model_.GetItemCount() && + menu_model_.GetTypeAt(menu_model_.GetItemCount() - 1) != + ui::MenuModel::TYPE_SEPARATOR) + menu_model_.AddSeparator(ui::NORMAL_SEPARATOR); + menu_model_.AddItemWithStringId(IDC_RELOAD, IDS_CONTENT_CONTEXT_RELOAD_PAGE); menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP,