OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |