Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: extensions/browser/extension_prefs.cc

Issue 1073153002: Code Cleanup for extension_prefs, as AddDisableReasons() is not required same behavior can be achie… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/extension_prefs.h" 5 #include "extensions/browser/extension_prefs.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_notifier.h" 10 #include "base/prefs/pref_notifier.h"
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 const std::string& extension_id, 742 const std::string& extension_id,
743 Extension::DisableReason disable_reason) const { 743 Extension::DisableReason disable_reason) const {
744 return (GetDisableReasons(extension_id) & disable_reason) != 0; 744 return (GetDisableReasons(extension_id) & disable_reason) != 0;
745 } 745 }
746 746
747 void ExtensionPrefs::AddDisableReason(const std::string& extension_id, 747 void ExtensionPrefs::AddDisableReason(const std::string& extension_id,
748 Extension::DisableReason disable_reason) { 748 Extension::DisableReason disable_reason) {
749 ModifyDisableReasons(extension_id, disable_reason, DISABLE_REASON_ADD); 749 ModifyDisableReasons(extension_id, disable_reason, DISABLE_REASON_ADD);
750 } 750 }
751 751
752 void ExtensionPrefs::AddDisableReasons(const std::string& extension_id,
753 int disable_reasons) {
754 ModifyDisableReasons(extension_id, disable_reasons, DISABLE_REASON_ADD);
755 }
756
757 void ExtensionPrefs::RemoveDisableReason( 752 void ExtensionPrefs::RemoveDisableReason(
758 const std::string& extension_id, 753 const std::string& extension_id,
759 Extension::DisableReason disable_reason) { 754 Extension::DisableReason disable_reason) {
760 ModifyDisableReasons(extension_id, disable_reason, DISABLE_REASON_REMOVE); 755 ModifyDisableReasons(extension_id, disable_reason, DISABLE_REASON_REMOVE);
761 } 756 }
762 757
763 void ExtensionPrefs::ClearDisableReasons(const std::string& extension_id) { 758 void ExtensionPrefs::ClearDisableReasons(const std::string& extension_id) {
764 ModifyDisableReasons(extension_id, Extension::DISABLE_NONE, 759 ModifyDisableReasons(extension_id, Extension::DISABLE_NONE,
765 DISABLE_REASON_CLEAR); 760 DISABLE_REASON_CLEAR);
766 } 761 }
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 extension_pref_value_map_->RegisterExtension( 2121 extension_pref_value_map_->RegisterExtension(
2127 extension_id, install_time, is_enabled, is_incognito_enabled); 2122 extension_id, install_time, is_enabled, is_incognito_enabled);
2128 2123
2129 FOR_EACH_OBSERVER( 2124 FOR_EACH_OBSERVER(
2130 ExtensionPrefsObserver, 2125 ExtensionPrefsObserver,
2131 observer_list_, 2126 observer_list_,
2132 OnExtensionRegistered(extension_id, install_time, is_enabled)); 2127 OnExtensionRegistered(extension_id, install_time, is_enabled));
2133 } 2128 }
2134 2129
2135 } // namespace extensions 2130 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698