OLD | NEW |
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/context_menu_content_type_panel.h
" | 5 #include "chrome/browser/renderer_context_menu/context_menu_content_type_panel.h
" |
6 | 6 |
7 ContextMenuContentTypePanel::ContextMenuContentTypePanel( | 7 ContextMenuContentTypePanel::ContextMenuContentTypePanel( |
8 content::RenderFrameHost* render_frame_host, | 8 content::RenderFrameHost* render_frame_host, |
9 const content::ContextMenuParams& params) | 9 const content::ContextMenuParams& params) |
10 : ContextMenuContentType(render_frame_host, params, false) { | 10 : ContextMenuContentType(render_frame_host, params, false) { |
11 } | 11 } |
12 | 12 |
13 ContextMenuContentTypePanel::~ContextMenuContentTypePanel() { | 13 ContextMenuContentTypePanel::~ContextMenuContentTypePanel() { |
14 } | 14 } |
15 | 15 |
16 bool ContextMenuContentTypePanel::SupportsGroup(int group) { | 16 bool ContextMenuContentTypePanel::SupportsGroup(int group) { |
17 switch (group) { | 17 switch (group) { |
18 case ITEM_GROUP_LINK: | 18 case ITEM_GROUP_LINK: |
19 // Checking link should take precedence before checking selection since on | 19 // Checking link should take precedence before checking selection since on |
20 // Mac right-clicking a link will also make it selected. | 20 // Mac right-clicking a link will also make it selected. |
21 return params_.unfiltered_link_url.is_valid(); | 21 return params().unfiltered_link_url.is_valid(); |
22 case ITEM_GROUP_EDITABLE: | 22 case ITEM_GROUP_EDITABLE: |
23 case ITEM_GROUP_COPY: | 23 case ITEM_GROUP_COPY: |
24 return ContextMenuContentType::SupportsGroup(group); | 24 return ContextMenuContentType::SupportsGroup(group); |
25 case ITEM_GROUP_CURRENT_EXTENSION: | 25 case ITEM_GROUP_CURRENT_EXTENSION: |
26 return true; | 26 return true; |
27 default: | 27 default: |
28 return false; | 28 return false; |
29 } | 29 } |
30 } | 30 } |
OLD | NEW |