| 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 "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "content/browser/renderer_host/render_widget_host_view.h" | 9 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return true; | 103 return true; |
| 104 | 104 |
| 105 case IDC_CONTENT_CONTEXT_SELECTALL: | 105 case IDC_CONTENT_CONTEXT_SELECTALL: |
| 106 *accel = views::Accelerator(ui::VKEY_A, false, true, false); | 106 *accel = views::Accelerator(ui::VKEY_A, false, true, false); |
| 107 return true; | 107 return true; |
| 108 | 108 |
| 109 default: | 109 default: |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 |
| 114 void RenderViewContextMenuViews::UpdateMenuItem(int command_id, |
| 115 bool enabled, |
| 116 const string16& title) { |
| 117 views::MenuItemView* item = menu_->GetMenuItemByID(command_id); |
| 118 if (!item) |
| 119 return; |
| 120 |
| 121 item->SetEnabled(enabled); |
| 122 item->SetTitle(UTF16ToWide(title)); |
| 123 |
| 124 views::MenuItemView* parent = item->GetParentMenuItem(); |
| 125 if (!parent) |
| 126 return; |
| 127 |
| 128 parent->ChildrenChanged(); |
| 129 } |
| OLD | NEW |