diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 18:03:22 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 18:03:22 +0000 |
commit | 30be1ce62471386dbdebf8d8f4f87e31a772661c (patch) | |
tree | 1cced9c953931f3722f0e41a4ca34afecc4beab0 /chrome/browser/extensions/extensions_ui.cc | |
parent | a4a4ffde20dff2c18909c738fdb84e0c8f68007c (diff) | |
download | chromium_src-30be1ce62471386dbdebf8d8f4f87e31a772661c.zip chromium_src-30be1ce62471386dbdebf8d8f4f87e31a772661c.tar.gz chromium_src-30be1ce62471386dbdebf8d8f4f87e31a772661c.tar.bz2 |
Further polish to extensions_ui page.
This changes the details text from gray to black. It also persists in the preferences the state of devMode (whether the developer tools are showing). Lastly, it adds a fade/slide effect on page elements which are shown in devMode.
BUG=25471
Review URL: http://codereview.chromium.org/329018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_ui.cc')
-rw-r--r-- | chrome/browser/extensions/extensions_ui.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index ef05466..3a121ea 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -28,6 +28,8 @@ #include "chrome/common/jstemplate_builder.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" +#include "chrome/common/pref_names.h" +#include "chrome/common/pref_service.h" #include "chrome/common/url_constants.h" #include "net/base/net_util.h" @@ -88,6 +90,8 @@ ExtensionsDOMHandler::ExtensionsDOMHandler(ExtensionsService* extension_service) void ExtensionsDOMHandler::RegisterMessages() { dom_ui_->RegisterMessageCallback("requestExtensionsData", NewCallback(this, &ExtensionsDOMHandler::HandleRequestExtensionsData)); + dom_ui_->RegisterMessageCallback("toggleDeveloperMode", + NewCallback(this, &ExtensionsDOMHandler::HandleToggleDeveloperMode)); dom_ui_->RegisterMessageCallback("inspect", NewCallback(this, &ExtensionsDOMHandler::HandleInspectMessage)); dom_ui_->RegisterMessageCallback("reload", @@ -133,6 +137,10 @@ void ExtensionsDOMHandler::HandleRequestExtensionsData(const Value* value) { } results.Set(L"extensions", extensions_list); + bool developer_mode = dom_ui_->GetProfile()->GetPrefs() + ->GetBoolean(prefs::kExtensionsUIDeveloperMode); + results.SetBoolean(L"developerMode", developer_mode); + dom_ui_->CallJavascriptFunction(L"returnExtensionsData", results); // Register for notifications that we need to reload the page. @@ -147,6 +155,13 @@ void ExtensionsDOMHandler::HandleRequestExtensionsData(const Value* value) { NotificationService::AllSources()); } +void ExtensionsDOMHandler::HandleToggleDeveloperMode(const Value* value) { + bool developer_mode = dom_ui_->GetProfile()->GetPrefs() + ->GetBoolean(prefs::kExtensionsUIDeveloperMode); + dom_ui_->GetProfile()->GetPrefs()->SetBoolean( + prefs::kExtensionsUIDeveloperMode, !developer_mode); +} + void ExtensionsDOMHandler::HandleInspectMessage(const Value* value) { std::string render_process_id_str; std::string render_view_id_str; @@ -514,3 +529,8 @@ RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { return ResourceBundle::GetSharedInstance(). LoadImageResourceBytes(IDR_PLUGIN); } + +// static +void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { + prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); +} |