Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1779 terminated_extensions_.erase(iter); | 1779 terminated_extensions_.erase(iter); |
| 1780 return; | 1780 return; |
| 1781 } | 1781 } |
| 1782 } | 1782 } |
| 1783 } | 1783 } |
| 1784 | 1784 |
| 1785 const Extension* ExtensionService::GetWebStoreApp() { | 1785 const Extension* ExtensionService::GetWebStoreApp() { |
| 1786 return GetExtensionById(extension_misc::kWebStoreAppId, false); | 1786 return GetExtensionById(extension_misc::kWebStoreAppId, false); |
| 1787 } | 1787 } |
| 1788 | 1788 |
| 1789 void ExtensionService::SetAppLauncherOrder( | |
|
Aaron Boodman
2011/01/22 23:42:57
This method seems like it makes more sense directl
jstritar
2011/01/24 01:00:42
Done.
| |
| 1790 const std::vector<std::string>& extension_ids) { | |
| 1791 for (size_t i = 0; i < extension_ids.size(); ++i) | |
| 1792 extension_prefs_->SetAppLaunchIndex(extension_ids.at(i), i); | |
| 1793 | |
| 1794 NotificationService::current()->Notify( | |
| 1795 NotificationType::EXTENSION_LAUNCHER_REORDERED, | |
| 1796 Source<Profile>(profile_), | |
| 1797 NotificationService::NoDetails()); | |
| 1798 } | |
| 1799 | |
| 1789 const Extension* ExtensionService::GetExtensionByURL(const GURL& url) { | 1800 const Extension* ExtensionService::GetExtensionByURL(const GURL& url) { |
| 1790 return url.scheme() != chrome::kExtensionScheme ? NULL : | 1801 return url.scheme() != chrome::kExtensionScheme ? NULL : |
| 1791 GetExtensionById(url.host(), false); | 1802 GetExtensionById(url.host(), false); |
| 1792 } | 1803 } |
| 1793 | 1804 |
| 1794 const Extension* ExtensionService::GetExtensionByWebExtent(const GURL& url) { | 1805 const Extension* ExtensionService::GetExtensionByWebExtent(const GURL& url) { |
| 1795 for (size_t i = 0; i < extensions_.size(); ++i) { | 1806 for (size_t i = 0; i < extensions_.size(); ++i) { |
| 1796 if (extensions_[i]->web_extent().ContainsURL(url)) | 1807 if (extensions_[i]->web_extent().ContainsURL(url)) |
| 1797 return extensions_[i]; | 1808 return extensions_[i]; |
| 1798 } | 1809 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1985 } | 1996 } |
| 1986 | 1997 |
| 1987 void ExtensionService::SetBeingUpgraded(const Extension* extension, | 1998 void ExtensionService::SetBeingUpgraded(const Extension* extension, |
| 1988 bool value) { | 1999 bool value) { |
| 1989 extension_runtime_data_[extension->id()].being_upgraded = value; | 2000 extension_runtime_data_[extension->id()].being_upgraded = value; |
| 1990 } | 2001 } |
| 1991 | 2002 |
| 1992 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { | 2003 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { |
| 1993 return &extension_runtime_data_[extension->id()].property_bag; | 2004 return &extension_runtime_data_[extension->id()].property_bag; |
| 1994 } | 2005 } |
| OLD | NEW |