diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-27 14:51:21 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-27 14:51:21 +0000 |
commit | 96d3fb5954088dc929dcedfd82c5b6a05e0e3116 (patch) | |
tree | 76ed5f9f30336f17016d26856b85c55443664820 /chrome/browser/debugger/devtools_manager.cc | |
parent | 4079724701312d23a68a148158c8024f0433fbd8 (diff) | |
download | chromium_src-96d3fb5954088dc929dcedfd82c5b6a05e0e3116.zip chromium_src-96d3fb5954088dc929dcedfd82c5b6a05e0e3116.tar.gz chromium_src-96d3fb5954088dc929dcedfd82c5b6a05e0e3116.tar.bz2 |
DevTools: Add 'Enable Developer Tools' option into the Advanced tab. Hide developer tools by default.
Review URL: http://codereview.chromium.org/117003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger/devtools_manager.cc')
-rw-r--r-- | chrome/browser/debugger/devtools_manager.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/debugger/devtools_manager.cc b/chrome/browser/debugger/devtools_manager.cc index 582cc90..67e3aa8 100644 --- a/chrome/browser/debugger/devtools_manager.cc +++ b/chrome/browser/debugger/devtools_manager.cc @@ -6,9 +6,12 @@ #include "chrome/browser/debugger/devtools_window.h" #include "chrome/browser/debugger/devtools_client_host.h" +#include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/site_instance.h" #include "chrome/common/devtools_messages.h" +#include "chrome/common/pref_names.h" +#include "chrome/common/pref_service.h" #include "googleurl/src/gurl.h" DevToolsManager::DevToolsManager() { @@ -85,6 +88,7 @@ void DevToolsManager::ForwardToDevToolsClient(RenderViewHost* inspected_rvh, } void DevToolsManager::OpenDevToolsWindow(RenderViewHost* inspected_rvh) { + EnableDevToolsInPrefs(inspected_rvh); DevToolsClientHost* host = GetDevToolsClientHostFor(inspected_rvh); if (!host) { host = new DevToolsWindow( @@ -165,3 +169,13 @@ void DevToolsManager::SendDetachToAgent(RenderViewHost* inspected_rvh) { inspected_rvh->Send(m); } } + +void DevToolsManager::EnableDevToolsInPrefs(RenderViewHost* inspected_rvh) { + Profile* profile = inspected_rvh->site_instance()->browsing_instance()-> + profile(); + if (!profile->GetPrefs()->GetBoolean(prefs::kWebKitDeveloperExtrasEnabled)) { + //TODO(pfeldman): Show message box with warning to the user. + profile->GetPrefs()->SetBoolean(prefs::kWebKitDeveloperExtrasEnabled, + true); + } +} |