OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/tab_contents/render_view_context_menu.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/clipboard.h" | 8 #include "base/clipboard.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 if (node_type.type & ContextNodeType::EDITABLE) | 77 if (node_type.type & ContextNodeType::EDITABLE) |
78 AppendEditableItems(); | 78 AppendEditableItems(); |
79 else if (node_type.type & ContextNodeType::SELECTION || | 79 else if (node_type.type & ContextNodeType::SELECTION || |
80 node_type.type & ContextNodeType::LINK) | 80 node_type.type & ContextNodeType::LINK) |
81 AppendCopyItem(); | 81 AppendCopyItem(); |
82 | 82 |
83 if (node_type.type & ContextNodeType::SELECTION) | 83 if (node_type.type & ContextNodeType::SELECTION) |
84 AppendSearchProvider(); | 84 AppendSearchProvider(); |
85 AppendSeparator(); | 85 |
86 AppendDeveloperItems(); | 86 AppendDeveloperItems(); |
87 } | 87 } |
88 | 88 |
89 void RenderViewContextMenu::AppendDeveloperItems() { | 89 void RenderViewContextMenu::AppendDeveloperItems() { |
90 AppendMenuItem(IDS_CONTENT_CONTEXT_INSPECTELEMENT); | 90 if (g_browser_process->have_inspector_files()) { |
| 91 AppendSeparator(); |
| 92 AppendMenuItem(IDS_CONTENT_CONTEXT_INSPECTELEMENT); |
| 93 } |
91 } | 94 } |
92 | 95 |
93 void RenderViewContextMenu::AppendLinkItems() { | 96 void RenderViewContextMenu::AppendLinkItems() { |
94 AppendMenuItem(IDS_CONTENT_CONTEXT_OPENLINKNEWTAB); | 97 AppendMenuItem(IDS_CONTENT_CONTEXT_OPENLINKNEWTAB); |
95 AppendMenuItem(IDS_CONTENT_CONTEXT_OPENLINKNEWWINDOW); | 98 AppendMenuItem(IDS_CONTENT_CONTEXT_OPENLINKNEWWINDOW); |
96 AppendMenuItem(IDS_CONTENT_CONTEXT_OPENLINKOFFTHERECORD); | 99 AppendMenuItem(IDS_CONTENT_CONTEXT_OPENLINKOFFTHERECORD); |
97 AppendMenuItem(IDS_CONTENT_CONTEXT_SAVELINKAS); | 100 AppendMenuItem(IDS_CONTENT_CONTEXT_SAVELINKAS); |
98 | 101 |
99 if (params_.link_url.SchemeIs(chrome::kMailToScheme)) { | 102 if (params_.link_url.SchemeIs(chrome::kMailToScheme)) { |
100 AppendMenuItem(IDS_CONTENT_CONTEXT_COPYLINKLOCATION, | 103 AppendMenuItem(IDS_CONTENT_CONTEXT_COPYLINKLOCATION, |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 WriteTextToClipboard(UTF8ToUTF16(utf8_text)); | 776 WriteTextToClipboard(UTF8ToUTF16(utf8_text)); |
774 DidWriteURLToClipboard(utf8_text); | 777 DidWriteURLToClipboard(utf8_text); |
775 } | 778 } |
776 | 779 |
777 void RenderViewContextMenu::MediaPlayerActionAt( | 780 void RenderViewContextMenu::MediaPlayerActionAt( |
778 int x, | 781 int x, |
779 int y, | 782 int y, |
780 const MediaPlayerAction& action) { | 783 const MediaPlayerAction& action) { |
781 source_tab_contents_->render_view_host()->MediaPlayerActionAt(x, y, action); | 784 source_tab_contents_->render_view_host()->MediaPlayerActionAt(x, y, action); |
782 } | 785 } |
OLD | NEW |