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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 2713333002: Remove redundant separator at end of the spelling correction context menu (Closed)
Patch Set: Remove redundant separator at end of context menu Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 846
847 if (content_type_->SupportsGroup( 847 if (content_type_->SupportsGroup(
848 ContextMenuContentType::ITEM_GROUP_DEVTOOLS_UNPACKED_EXT)) { 848 ContextMenuContentType::ITEM_GROUP_DEVTOOLS_UNPACKED_EXT)) {
849 AppendDevtoolsForUnpackedExtensions(); 849 AppendDevtoolsForUnpackedExtensions();
850 } 850 }
851 851
852 if (content_type_->SupportsGroup( 852 if (content_type_->SupportsGroup(
853 ContextMenuContentType::ITEM_GROUP_PRINT_PREVIEW)) { 853 ContextMenuContentType::ITEM_GROUP_PRINT_PREVIEW)) {
854 AppendPrintPreviewItems(); 854 AppendPrintPreviewItems();
855 } 855 }
856
857 // Remove any redundant spearators.
858 if (menu_model_.GetCommandIdAt(menu_model_.GetItemCount() - 1) == -1)
859 menu_model_.RemoveItemAt(menu_model_.GetItemCount() - 1);
856 } 860 }
857 861
858 Profile* RenderViewContextMenu::GetProfile() { 862 Profile* RenderViewContextMenu::GetProfile() {
859 return Profile::FromBrowserContext(browser_context_); 863 return Profile::FromBrowserContext(browser_context_);
860 } 864 }
861 865
862 void RenderViewContextMenu::RecordUsedItem(int id) { 866 void RenderViewContextMenu::RecordUsedItem(int id) {
863 int enum_id = FindUMAEnumValueForCommand(id, GENERAL_ENUM_ID); 867 int enum_id = FindUMAEnumValueForCommand(id, GENERAL_ENUM_ID);
864 if (enum_id != -1) { 868 if (enum_id != -1) {
865 const size_t kMappingSize = arraysize(kUmaEnumToControlId); 869 const size_t kMappingSize = arraysize(kUmaEnumToControlId);
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 void RenderViewContextMenu::PluginActionAt( 2509 void RenderViewContextMenu::PluginActionAt(
2506 const gfx::Point& location, 2510 const gfx::Point& location,
2507 const WebPluginAction& action) { 2511 const WebPluginAction& action) {
2508 source_web_contents_->GetRenderViewHost()-> 2512 source_web_contents_->GetRenderViewHost()->
2509 ExecutePluginActionAtLocation(location, action); 2513 ExecutePluginActionAtLocation(location, action);
2510 } 2514 }
2511 2515
2512 Browser* RenderViewContextMenu::GetBrowser() const { 2516 Browser* RenderViewContextMenu::GetBrowser() const {
2513 return chrome::FindBrowserWithWebContents(embedder_web_contents_); 2517 return chrome::FindBrowserWithWebContents(embedder_web_contents_);
2514 } 2518 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698