Index: chrome/common/extensions/extension_set.cc |
diff --git a/chrome/common/extensions/extension_set.cc b/chrome/common/extensions/extension_set.cc |
index 8b68fb6aeef376d02e44e52b3fe5b281e61c87f9..586596d3b51617093f43e94e379e43791badb63a 100644 |
--- a/chrome/common/extensions/extension_set.cc |
+++ b/chrome/common/extensions/extension_set.cc |
@@ -5,7 +5,9 @@ |
#include "chrome/common/extensions/extension_set.h" |
#include "base/logging.h" |
+#include "chrome/common/extensions/api/url_handlers/url_handlers_parser.h" |
#include "chrome/common/extensions/extension.h" |
+#include "chrome/common/extensions/extension_manifest_constants.h" |
#include "chrome/common/extensions/manifest_handlers/sandboxed_page_info.h" |
#include "chrome/common/url_constants.h" |
#include "extensions/common/constants.h" |
@@ -124,6 +126,26 @@ const Extension* ExtensionSet::GetHostedAppByOverlappingWebExtent( |
return NULL; |
} |
+const extensions::UrlHandlerInfo* |
+ExtensionSet::GetHandlingAppForURL(const GURL& url) const { |
not at google - send to devlin
2013/08/19 23:32:24
the name of this method and the thing it returns i
sergeygs
2013/08/29 08:24:42
Done. This whole function has disappeared, replace
|
+ for (ExtensionMap::const_iterator extIt = extensions_.begin(); |
+ extIt != extensions_.end(); ++extIt) { |
not at google - send to devlin
2013/08/19 23:32:24
s/extIt/it/
sergeygs
2013/08/29 08:24:42
Done.
|
+ if (extIt->second->is_app()) { |
not at google - send to devlin
2013/08/19 23:32:24
I don't really see the point in checking is_app he
sergeygs
2013/08/29 08:24:42
Done.
|
+ const std::vector<extensions::UrlHandlerInfo>* handlers = |
+ extensions::UrlHandlers::GetUrlHandlers(extIt->second); |
+ if (handlers) { |
+ for (std::vector<extensions::UrlHandlerInfo>::const_iterator handlerIt = |
not at google - send to devlin
2013/08/19 23:32:24
add a method to UrlHandlers that does this?
sergeygs
2013/08/29 08:24:42
Done.
|
+ handlers->begin(); handlerIt != handlers->end(); handlerIt++) { |
+ if (handlerIt->patterns.MatchesURL(url)) |
+ return &(*handlerIt); |
+ } |
+ } |
+ } |
+ } |
+ |
+ return NULL; |
+} |
+ |
bool ExtensionSet::InSameExtent(const GURL& old_url, |
const GURL& new_url) const { |
return GetExtensionOrAppByURL(ExtensionURLInfo(old_url)) == |