summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 16:32:13 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 16:32:13 +0000
commit543432ee19b7d54e79a3726756eec8593f0b8022 (patch)
tree8f7905f43203a553a4af52bcf0c4e93ea2ae276f /chrome/browser/tab_contents
parent71ad9c6f69f69396f230e210a16ac5adeb6d180e (diff)
downloadchromium_src-543432ee19b7d54e79a3726756eec8593f0b8022.zip
chromium_src-543432ee19b7d54e79a3726756eec8593f0b8022.tar.gz
chromium_src-543432ee19b7d54e79a3726756eec8593f0b8022.tar.bz2
Add policy to disable Developer-Tools.
BUG=49600 TEST=none Review URL: http://codereview.chromium.org/3965003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 68041ec..03d8223 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -64,7 +64,8 @@ const size_t RenderViewContextMenu::kMaxSelectionTextLength = 50;
// static
bool RenderViewContextMenu::IsDevToolsURL(const GURL& url) {
- return url.SchemeIs(chrome::kChromeDevToolsScheme);
+ return url.SchemeIs(chrome::kChromeDevToolsScheme) &&
+ url.host() == chrome::kChromeUIDevToolsHost;
}
// static
@@ -1406,7 +1407,8 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
bool debug_mode = true;
#endif
// Don't inspect new tab UI, etc.
- if (active_entry->url().SchemeIs(chrome::kChromeUIScheme) && !debug_mode)
+ 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.
@@ -1421,6 +1423,15 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
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 (IsDevToolsURL(active_entry->url()) &&
+ !command_line.HasSwitch(switches::kProcessPerTab))
+ return false;
+ // Don't enable the web inspector if the developer tools are disabled via
+ // the preference dev-tools-disabled.
+ if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled))
+ return false;
}
return true;