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

Unified Diff: chrome/common/extensions/url_pattern.h

Issue 7811006: Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged out Created 8 years, 9 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/url_pattern.h
diff --git a/chrome/common/extensions/url_pattern.h b/chrome/common/extensions/url_pattern.h
index 6a83c017ce7c3b5a3dd2cd0348a16fd009352b14..884d919082a5dcf41cca282e6ba987faf1fa6808 100644
--- a/chrome/common/extensions/url_pattern.h
+++ b/chrome/common/extensions/url_pattern.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_
@@ -119,6 +119,12 @@ class URLPattern {
bool match_all_urls() const { return match_all_urls_; }
void SetMatchAllURLs(bool val);
+ // Returns true if this pattern matches nested URL paths.
+ // If false, a path match other than '*' will always fail on a nested URL.
+ // If true, a path match other than '*' will always fail on a non-nested URL.
Aaron Boodman 2012/03/21 23:51:57 Can we do something even more specific, just for t
ericu 2012/03/22 00:22:14 My goal was actually to support filesystem URLs tr
+ bool match_nested_url_path() const { return match_nested_url_path_; }
+ void SetMatchNestedURLPath(bool val);
+
// Sets the scheme for pattern matches. This can be a single '*' if the
// pattern matches all valid schemes (as defined by the valid_schemes_
// property). Returns false on failure (if the scheme is not valid).
@@ -145,7 +151,9 @@ class URLPattern {
bool MatchesHost(const GURL& test) const;
// Returns true if |test| matches our path.
- bool MatchesPath(const std::string& test) const;
+ // Set nested_url to true if the test URL had an inner_url().
+ // See SetMatchNestedURLPath for behavior.
+ bool MatchesPath(const std::string& test, bool nested_url) const;
// Returns true if |port| matches our port.
bool MatchesPort(int port) const;
@@ -204,6 +212,11 @@ class URLPattern {
// True if this is a special-case "<all_urls>" pattern.
bool match_all_urls_;
+ // True if we match path_ against the full path of a nested URL, e.g.
+ // if given filesystem:http://a.com/temporary/foo.txt, use /temporary/foo.txt.
+ // Otherwise we match only against the path of a non-nested URL.
+ bool match_nested_url_path_;
+
// The scheme for the pattern.
std::string scheme_;

Powered by Google App Engine
This is Rietveld 408576698