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

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

Issue 10784035: Refactored SettingsFrontend and forwarding of calls to the backends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment Created 8 years, 5 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 | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 // Keep information about the extension so that we can reload it later 1797 // Keep information about the extension so that we can reload it later
1798 // even if it's not permanently installed. 1798 // even if it's not permanently installed.
1799 unloaded_extension_paths_[extension->id()] = extension->path(); 1799 unloaded_extension_paths_[extension->id()] = extension->path();
1800 1800
1801 // Clean up if the extension is meant to be enabled after a reload. 1801 // Clean up if the extension is meant to be enabled after a reload.
1802 disabled_extension_paths_.erase(extension->id()); 1802 disabled_extension_paths_.erase(extension->id());
1803 1803
1804 // Clean up runtime data. 1804 // Clean up runtime data.
1805 extension_runtime_data_.erase(extension_id); 1805 extension_runtime_data_.erase(extension_id);
1806 1806
1807 if (disabled_extensions_.Contains(extension->id())) { 1807 if (disabled_extensions_.Contains(extension->id())) {
1808 UnloadedExtensionInfo details(extension, reason); 1808 UnloadedExtensionInfo details(extension, reason);
1809 details.already_disabled = true; 1809 details.already_disabled = true;
1810 disabled_extensions_.Remove(extension->id()); 1810 disabled_extensions_.Remove(extension->id());
1811 content::NotificationService::current()->Notify( 1811 content::NotificationService::current()->Notify(
1812 chrome::NOTIFICATION_EXTENSION_UNLOADED, 1812 chrome::NOTIFICATION_EXTENSION_UNLOADED,
1813 content::Source<Profile>(profile_), 1813 content::Source<Profile>(profile_),
1814 content::Details<UnloadedExtensionInfo>(&details)); 1814 content::Details<UnloadedExtensionInfo>(&details));
1815 // Make sure the profile cleans up its RequestContexts when an already 1815 // Make sure the profile cleans up its RequestContexts when an already
1816 // disabled extension is unloaded (since they are also tracking the disabled 1816 // disabled extension is unloaded (since they are also tracking the disabled
1817 // extensions). 1817 // extensions).
1818 system_->UnregisterExtensionWithRequestContexts(extension_id, reason); 1818 system_->UnregisterExtensionWithRequestContexts(extension_id, reason);
1819 return; 1819 return;
1820 } 1820 }
1821 1821
1822 // Remove the extension from our list. 1822 // Remove the extension from our list.
1823 extensions_.Remove(extension->id()); 1823 extensions_.Remove(extension->id());
1824 1824
1825 NotifyExtensionUnloaded(extension.get(), reason); 1825 NotifyExtensionUnloaded(extension.get(), reason);
1826 } 1826 }
1827 1827
1828 void ExtensionService::UnloadAllExtensions() { 1828 void ExtensionService::UnloadAllExtensions() {
1829 profile_->GetExtensionSpecialStoragePolicy()-> 1829 profile_->GetExtensionSpecialStoragePolicy()->
1830 RevokeRightsForAllExtensions(); 1830 RevokeRightsForAllExtensions();
1831 1831
1832 extensions_.Clear(); 1832 extensions_.Clear();
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 2553
2554 // To coexist with certain unit tests that don't have a work-thread message 2554 // To coexist with certain unit tests that don't have a work-thread message
2555 // loop available at ExtensionService shutdown, we lazy-initialize this 2555 // loop available at ExtensionService shutdown, we lazy-initialize this
2556 // object so that those cases neither create nor destroy an 2556 // object so that those cases neither create nor destroy an
2557 // APIResourceController. 2557 // APIResourceController.
2558 if (!api_resource_controller_.get()) { 2558 if (!api_resource_controller_.get()) {
2559 api_resource_controller_.reset(new extensions::APIResourceController()); 2559 api_resource_controller_.reset(new extensions::APIResourceController());
2560 } 2560 }
2561 return api_resource_controller_.get(); 2561 return api_resource_controller_.get();
2562 } 2562 }
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