summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 16:53:59 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 16:53:59 +0000
commitfc701137f192ee798ee6d9a41cf11fcb34d218bb (patch)
tree81b0c517118d3653dfd8f8bde561680e722d5336 /chrome/browser/tab_contents
parent9a6d691886d482cd31850c49bb1f2d3d529d2547 (diff)
downloadchromium_src-fc701137f192ee798ee6d9a41cf11fcb34d218bb.zip
chromium_src-fc701137f192ee798ee6d9a41cf11fcb34d218bb.tar.gz
chromium_src-fc701137f192ee798ee6d9a41cf11fcb34d218bb.tar.bz2
DevTools: Only enable dev tools for dev tools if process-per-tab flag is set. At the same time, allow it in release mode as well.
BUG=27252 Review URL: http://codereview.chromium.org/384084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index f1f6fff..79134c7 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -778,8 +778,9 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
#else
bool debug_mode = true;
#endif
- // Don't inspect inspector, new tab UI, etc.
- if (active_entry->url().SchemeIs(chrome::kChromeUIScheme) && !debug_mode)
+ // Don't inspect new tab UI, etc.
+ if (active_entry->url().SchemeIs(chrome::kChromeUIScheme) && !debug_mode &&
+ active_entry->url().host() != chrome::kChromeUIDevToolsHost)
return false;
// Don't inspect about:network, about:memory, etc.
@@ -789,11 +790,17 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
!LowerCaseEqualsASCII(active_entry->virtual_url().path(), "blank"))
return false;
- // Don't enable the web inspector if JavaScript is disabled
if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) {
+ // Don't enable the web inspector if JavaScript is disabled.
if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) ||
command_line.HasSwitch(switches::kDisableJavaScript))
return false;
+ // Don't enable the web inspector on web inspector if there is no process
+ // per tab flag set.
+ if (active_entry->url().SchemeIs(chrome::kChromeUIScheme) &&
+ active_entry->url().host() == chrome::kChromeUIDevToolsHost &&
+ !command_line.HasSwitch(switches::kProcessPerTab))
+ return false;
}
return true;