Index: chrome/browser/tab_contents/render_view_context_menu.cc |
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc |
index ae12b2393dad9c229c7729d1d750abf78d2e2f87..3a0d07059ad0339565ae2ecc018b9eb8492981b9 100644 |
--- a/chrome/browser/tab_contents/render_view_context_menu.cc |
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc |
@@ -1808,8 +1808,14 @@ void RenderViewContextMenu::MenuClosed(ui::SimpleMenuModel* source) { |
bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { |
if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ TabContentsWrapper* tab_contents_wrapper = |
+ TabContentsWrapper::GetCurrentWrapperForContents( |
+ source_tab_contents_); |
+ if (!tab_contents_wrapper) |
+ return false; |
// Don't enable the web inspector if JavaScript is disabled. |
- if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
+ if (!tab_contents_wrapper->per_tab_prefs()->GetBoolean( |
+ prefs::kWebKitJavascriptEnabled) || |
command_line.HasSwitch(switches::kDisableJavaScript)) |
return false; |
// Don't enable the web inspector if the developer tools are disabled via |