summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_prefs.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.cc')
-rw-r--r--chrome/browser/extensions/extension_prefs.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index ed44ec4..93f29c4 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -35,6 +35,9 @@ const wchar_t kPrefVersion[] = L"manifest.version";
// Indicates if an extension is blacklisted:
const wchar_t kPrefBlacklist[] = L"blacklist";
+// Indicates whether the toolbar should be shown on app tabs.
+const wchar_t kPrefAppTabToolbars[] = L"app_tab_toolbars";
+
// Indicates whether to show an install warning when the user enables.
const wchar_t kExtensionDidEscalatePermissions[] = L"install_warning_on_enable";
@@ -777,6 +780,32 @@ std::set<std::string> ExtensionPrefs::GetIdleInstallInfoIds() {
return result;
}
+bool ExtensionPrefs::AreAppTabToolbarsVisible(
+ const std::string& extension_id) {
+ // Default to hiding toolbars.
+ bool show_toolbars = false;
+ DictionaryValue* pref = GetExtensionPref(extension_id);
+ if (!pref)
+ return show_toolbars;
+
+ pref->GetBoolean(
+ ASCIIToWide(extension_id) + L"." + kPrefAppTabToolbars, &show_toolbars);
+ return show_toolbars;
+}
+
+void ExtensionPrefs::SetAppTabToolbarVisibility(
+ const std::string& extension_id, bool value) {
+ DictionaryValue* pref = GetOrCreateExtensionPref(extension_id);
+ std::wstring key = ASCIIToWide(extension_id) + L"." + kPrefAppTabToolbars;
+
+ if (value)
+ pref->SetBoolean(key, true);
+ else
+ pref->Remove(key, NULL); // False is the default value.
+
+ prefs_->ScheduleSavePersistentPrefs();
+}
+
// static
void ExtensionPrefs::RegisterUserPrefs(PrefService* prefs) {