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

Unified Diff: chrome/common/extensions/extension_set.cc

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 1) Fixed broken redirection for in-page WebKit-initiated navigations. All redirections work now. 2)… Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
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)) ==

Powered by Google App Engine
This is Rietveld 408576698