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

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

Issue 4291001: Convert implicit scoped_refptr constructor calls to explicit ones, part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/build
Patch Set: comments Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 865
866 const Extension* extension = 866 const Extension* extension =
867 GetExtensionByIdInternal(extension_id, false, true); 867 GetExtensionByIdInternal(extension_id, false, true);
868 if (!extension) { 868 if (!extension) {
869 return; 869 return;
870 } 870 }
871 871
872 extension_prefs_->SetExtensionState(extension, Extension::ENABLED); 872 extension_prefs_->SetExtensionState(extension, Extension::ENABLED);
873 873
874 // Move it over to the enabled list. 874 // Move it over to the enabled list.
875 extensions_.push_back(extension); 875 extensions_.push_back(make_scoped_refptr(extension));
876 ExtensionList::iterator iter = std::find(disabled_extensions_.begin(), 876 ExtensionList::iterator iter = std::find(disabled_extensions_.begin(),
877 disabled_extensions_.end(), 877 disabled_extensions_.end(),
878 extension); 878 extension);
879 disabled_extensions_.erase(iter); 879 disabled_extensions_.erase(iter);
880 880
881 ExtensionDOMUI::RegisterChromeURLOverrides(profile_, 881 ExtensionDOMUI::RegisterChromeURLOverrides(profile_,
882 extension->GetChromeURLOverrides()); 882 extension->GetChromeURLOverrides());
883 883
884 NotifyExtensionLoaded(extension); 884 NotifyExtensionLoaded(extension);
885 UpdateActiveExtensionsInCrashReporter(); 885 UpdateActiveExtensionsInCrashReporter();
886 } 886 }
887 887
888 void ExtensionsService::DisableExtension(const std::string& extension_id) { 888 void ExtensionsService::DisableExtension(const std::string& extension_id) {
889 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 889 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
890 890
891 const Extension* extension = 891 const Extension* extension =
892 GetExtensionByIdInternal(extension_id, true, false); 892 GetExtensionByIdInternal(extension_id, true, false);
893 // The extension may have been disabled already. 893 // The extension may have been disabled already.
894 if (!extension) 894 if (!extension)
895 return; 895 return;
896 896
897 extension_prefs_->SetExtensionState(extension, Extension::DISABLED); 897 extension_prefs_->SetExtensionState(extension, Extension::DISABLED);
898 898
899 // Move it over to the disabled list. 899 // Move it over to the disabled list.
900 disabled_extensions_.push_back(extension); 900 disabled_extensions_.push_back(make_scoped_refptr(extension));
901 ExtensionList::iterator iter = std::find(extensions_.begin(), 901 ExtensionList::iterator iter = std::find(extensions_.begin(),
902 extensions_.end(), 902 extensions_.end(),
903 extension); 903 extension);
904 extensions_.erase(iter); 904 extensions_.erase(iter);
905 905
906 ExtensionDOMUI::UnregisterChromeURLOverrides(profile_, 906 ExtensionDOMUI::UnregisterChromeURLOverrides(profile_,
907 extension->GetChromeURLOverrides()); 907 extension->GetChromeURLOverrides());
908 908
909 NotifyExtensionUnloaded(extension); 909 NotifyExtensionUnloaded(extension);
910 UpdateActiveExtensionsInCrashReporter(); 910 UpdateActiveExtensionsInCrashReporter();
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 ExtensionIdSet ExtensionsService::GetAppIds() const { 1871 ExtensionIdSet ExtensionsService::GetAppIds() const {
1872 ExtensionIdSet result; 1872 ExtensionIdSet result;
1873 for (ExtensionList::const_iterator it = extensions_.begin(); 1873 for (ExtensionList::const_iterator it = extensions_.begin();
1874 it != extensions_.end(); ++it) { 1874 it != extensions_.end(); ++it) {
1875 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT) 1875 if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT)
1876 result.insert((*it)->id()); 1876 result.insert((*it)->id());
1877 } 1877 }
1878 1878
1879 return result; 1879 return result;
1880 } 1880 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.cc ('k') | chrome/browser/extensions/extensions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698