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

Side by Side Diff: chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc

Issue 8370033: Add a 'hidden' parameter to RenderViewContextMenuProxy::UpdateMenuItem(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h ('k') | 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/views/tab_contents/render_view_context_menu_views.h" 5 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" 10 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 *accel = views::Accelerator(ui::VKEY_A, false, true, false); 97 *accel = views::Accelerator(ui::VKEY_A, false, true, false);
98 return true; 98 return true;
99 99
100 default: 100 default:
101 return false; 101 return false;
102 } 102 }
103 } 103 }
104 104
105 void RenderViewContextMenuViews::UpdateMenuItem(int command_id, 105 void RenderViewContextMenuViews::UpdateMenuItem(int command_id,
106 bool enabled, 106 bool enabled,
107 bool hidden,
107 const string16& title) { 108 const string16& title) {
108 views::MenuItemView* item = menu_->GetMenuItemByID(command_id); 109 views::MenuItemView* item = menu_->GetMenuItemByID(command_id);
109 if (!item) 110 if (!item)
110 return; 111 return;
111 112
112 item->SetEnabled(enabled); 113 item->SetEnabled(enabled);
113 item->SetTitle(title); 114 item->SetTitle(title);
115 item->SetVisible(!hidden);
114 116
115 views::MenuItemView* parent = item->GetParentMenuItem(); 117 views::MenuItemView* parent = item->GetParentMenuItem();
116 if (!parent) 118 if (!parent)
117 return; 119 return;
118 120
119 parent->ChildrenChanged(); 121 parent->ChildrenChanged();
120 } 122 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698