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

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 174162: Don't show "Inspect Element" in the context menu if we can't inspect. (Closed)
Patch Set: ... Created 11 years, 4 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
« no previous file with comments | « chrome/browser/gtk/standard_menus.cc ('k') | chrome/browser/views/toolbar_view.cc » ('j') | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/standard_menus.cc ('k') | chrome/browser/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698