Chromium Code Reviews| Index: chrome/browser/extensions/extension_prefs.cc |
| diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc |
| index 2246e49a0413563493c7c38cd8ac057d76f6d812..3228d0df39bf52a22368e22c3136b4c41208bebc 100644 |
| --- a/chrome/browser/extensions/extension_prefs.cc |
| +++ b/chrome/browser/extensions/extension_prefs.cc |
| @@ -1318,13 +1318,17 @@ bool ExtensionPrefs::IsExtensionDisabled( |
| } |
| ExtensionPrefs::ExtensionIdSet ExtensionPrefs::GetToolbarOrder() { |
| - bool action_box_enabled = extensions::switch_utils::IsActionBoxEnabled(); |
| + bool extensions_in_action_box_enabled = |
| + extensions::switch_utils::IsExtensionsInActionBoxEnabled(); |
|
not at google - send to devlin
2012/08/14 04:09:53
add a method like GetToolbarKey or something, whic
yefimt
2012/08/14 20:59:07
Done.
|
| return GetExtensionPrefAsVector( |
| - action_box_enabled ? kExtensionActionBoxBar : kExtensionToolbar); |
| + extensions_in_action_box_enabled ? |
| + kExtensionActionBoxBar : kExtensionToolbar); |
| } |
| void ExtensionPrefs::SetToolbarOrder(const ExtensionIdSet& extension_ids) { |
| - SetExtensionPrefFromVector(extensions::switch_utils::IsActionBoxEnabled() ? |
| + bool extensions_in_action_box_enabled = |
| + extensions::switch_utils::IsExtensionsInActionBoxEnabled(); |
| + SetExtensionPrefFromVector(extensions_in_action_box_enabled ? |
| kExtensionActionBoxBar : kExtensionToolbar, extension_ids); |
| } |
| @@ -1421,16 +1425,18 @@ void ExtensionPrefs::SetExtensionState(const std::string& extension_id, |
| } |
| bool ExtensionPrefs::GetBrowserActionVisibility(const Extension* extension) { |
| - bool action_box_enabled = switch_utils::IsActionBoxEnabled(); |
| - bool default_value = !action_box_enabled; |
| + bool extensions_in_action_box_enabled = |
| + switch_utils::IsExtensionsInActionBoxEnabled(); |
| + bool default_value = !(extensions_in_action_box_enabled); |
|
not at google - send to devlin
2012/08/14 04:09:53
parens unnecessary?
yefimt
2012/08/14 20:59:07
Done.
|
| const DictionaryValue* extension_prefs = GetExtensionPref(extension->id()); |
| if (!extension_prefs) |
| return default_value; |
| bool visible = false; |
| - const char* browser_action_pref = action_box_enabled ? kBrowserActionPinned : |
| - kBrowserActionVisible; |
| + const char* browser_action_pref = |
| + extensions_in_action_box_enabled ? |
| + kBrowserActionPinned : kBrowserActionVisible; |
|
not at google - send to devlin
2012/08/14 04:09:53
likewise, add GetToolbarVisibilityKey() perhaps, w
yefimt
2012/08/14 20:59:07
Done.
|
| bool pref_exists = extension_prefs->GetBoolean(browser_action_pref, &visible); |
| if (!pref_exists) |
| return default_value; |
| @@ -1443,9 +1449,10 @@ void ExtensionPrefs::SetBrowserActionVisibility(const Extension* extension, |
| if (GetBrowserActionVisibility(extension) == visible) |
| return; |
| - bool action_box_enabled = switch_utils::IsActionBoxEnabled(); |
| - const char* browser_action_pref = action_box_enabled ? kBrowserActionPinned : |
| - kBrowserActionVisible; |
| + bool extensions_in_action_box_enabled = |
| + switch_utils::IsExtensionsInActionBoxEnabled(); |
| + const char* browser_action_pref = extensions_in_action_box_enabled ? |
| + kBrowserActionPinned : kBrowserActionVisible; |
| UpdateExtensionPref(extension->id(), browser_action_pref, |
| Value::CreateBooleanValue(visible)); |
| content::NotificationService::current()->Notify( |