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

Side by Side Diff: chrome/browser/extensions/extension_service.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 | « no previous file | extensions/browser/extension_prefs.h » ('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 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 extension->location(), Manifest::NUM_LOCATIONS); 1798 extension->location(), Manifest::NUM_LOCATIONS);
1799 1799
1800 // A fully installed app cannot be demoted to an ephemeral app. 1800 // A fully installed app cannot be demoted to an ephemeral app.
1801 if ((install_flags & extensions::kInstallFlagIsEphemeral) && 1801 if ((install_flags & extensions::kInstallFlagIsEphemeral) &&
1802 !extension_prefs_->IsEphemeralApp(id)) { 1802 !extension_prefs_->IsEphemeralApp(id)) {
1803 install_flags &= ~static_cast<int>(extensions::kInstallFlagIsEphemeral); 1803 install_flags &= ~static_cast<int>(extensions::kInstallFlagIsEphemeral);
1804 } 1804 }
1805 } 1805 }
1806 1806
1807 if (disable_reasons) 1807 if (disable_reasons)
1808 extension_prefs_->AddDisableReasons(id, disable_reasons); 1808 extension_prefs_->AddDisableReason(id,
1809 static_cast<Extension::DisableReason>(disable_reasons));
1809 1810
1810 const Extension::State initial_state = 1811 const Extension::State initial_state =
1811 disable_reasons == Extension::DISABLE_NONE ? Extension::ENABLED 1812 disable_reasons == Extension::DISABLE_NONE ? Extension::ENABLED
1812 : Extension::DISABLED; 1813 : Extension::DISABLED;
1813 1814
1814 if (ShouldDelayExtensionUpdate( 1815 if (ShouldDelayExtensionUpdate(
1815 id, 1816 id,
1816 !!(install_flags & extensions::kInstallFlagInstallImmediately))) { 1817 !!(install_flags & extensions::kInstallFlagInstallImmediately))) {
1817 extension_prefs_->SetDelayedInstallInfo( 1818 extension_prefs_->SetDelayedInstallInfo(
1818 extension, 1819 extension,
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 } 2582 }
2582 2583
2583 void ExtensionService::OnProfileDestructionStarted() { 2584 void ExtensionService::OnProfileDestructionStarted() {
2584 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2585 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2585 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2586 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2586 it != ids_to_unload.end(); 2587 it != ids_to_unload.end();
2587 ++it) { 2588 ++it) {
2588 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2589 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2589 } 2590 }
2590 } 2591 }
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698