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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 65983002: Revert 231221 - "Remove enabled/disabled state from extension and app sync." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 bool previously_disabled = 1878 bool previously_disabled =
1879 extension_prefs_->IsExtensionDisabled(extension->id()); 1879 extension_prefs_->IsExtensionDisabled(extension->id());
1880 // Legacy disabled extensions do not have a disable reason. Infer that if 1880 // Legacy disabled extensions do not have a disable reason. Infer that if
1881 // there was no permission increase, it was likely disabled by the user. 1881 // there was no permission increase, it was likely disabled by the user.
1882 if (previously_disabled && disable_reasons == Extension::DISABLE_NONE && 1882 if (previously_disabled && disable_reasons == Extension::DISABLE_NONE &&
1883 !extension_prefs_->DidExtensionEscalatePermissions(extension->id())) { 1883 !extension_prefs_->DidExtensionEscalatePermissions(extension->id())) {
1884 disable_reasons |= Extension::DISABLE_USER_ACTION; 1884 disable_reasons |= Extension::DISABLE_USER_ACTION;
1885 } 1885 }
1886 // Extensions that came to us disabled from sync need a similar inference, 1886 // Extensions that came to us disabled from sync need a similar inference,
1887 // except based on the new version's permissions. 1887 // except based on the new version's permissions.
1888 // TODO(yoz): Since we no longer sync disabled state, simplify this.
1889 if (previously_disabled && 1888 if (previously_disabled &&
1890 disable_reasons == Extension::DISABLE_UNKNOWN_FROM_SYNC) { 1889 disable_reasons == Extension::DISABLE_UNKNOWN_FROM_SYNC) {
1891 // Remove the DISABLE_UNKNOWN_FROM_SYNC reason. 1890 // Remove the DISABLE_UNKNOWN_FROM_SYNC reason.
1892 extension_prefs_->ClearDisableReasons(extension->id()); 1891 extension_prefs_->ClearDisableReasons(extension->id());
1893 if (!is_privilege_increase) 1892 if (!is_privilege_increase)
1894 disable_reasons |= Extension::DISABLE_USER_ACTION; 1893 disable_reasons |= Extension::DISABLE_USER_ACTION;
1895 } 1894 }
1896 disable_reasons &= ~Extension::DISABLE_UNKNOWN_FROM_SYNC; 1895 disable_reasons &= ~Extension::DISABLE_UNKNOWN_FROM_SYNC;
1897 } 1896 }
1898 1897
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2789 } 2788 }
2790 2789
2791 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { 2790 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) {
2792 update_observers_.AddObserver(observer); 2791 update_observers_.AddObserver(observer);
2793 } 2792 }
2794 2793
2795 void ExtensionService::RemoveUpdateObserver( 2794 void ExtensionService::RemoveUpdateObserver(
2796 extensions::UpdateObserver* observer) { 2795 extensions::UpdateObserver* observer) {
2797 update_observers_.RemoveObserver(observer); 2796 update_observers_.RemoveObserver(observer);
2798 } 2797 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698