diff options
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/render_view_context_menu.cc | 13 |
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; |