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

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

Issue 11312228: Move extension_error_utils.* and url_pattern_set.* into (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hate Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/url_pattern_set.h
diff --git a/chrome/common/extensions/url_pattern_set.h b/chrome/common/extensions/url_pattern_set.h
deleted file mode 100644
index b39c61446fb9a08de5cf6ccc5d9fa73237c58dab..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/url_pattern_set.h
+++ /dev/null
@@ -1,97 +0,0 @@
-// 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_SET_H_
-#define CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_
-
-#include <set>
-
-#include "base/memory/scoped_ptr.h"
-#include "extensions/common/url_pattern.h"
-
-class GURL;
-
-namespace base {
-class ListValue;
-class Value;
-}
-
-// Represents the set of URLs an extension uses for web content.
-class URLPatternSet {
- public:
- typedef std::set<URLPattern>::const_iterator const_iterator;
- typedef std::set<URLPattern>::iterator iterator;
-
- // Clears |out| and populates the set with |set1| - |set2|.
- static void CreateDifference(const URLPatternSet& set1,
- const URLPatternSet& set2,
- URLPatternSet* out);
-
- // Clears |out| and populates the set with the intersection of |set1|
- // and |set2|.
- static void CreateIntersection(const URLPatternSet& set1,
- const URLPatternSet& set2,
- URLPatternSet* out);
-
- // Clears |out| and populates the set with the union of |set1| and |set2|.
- static void CreateUnion(const URLPatternSet& set1,
- const URLPatternSet& set2,
- URLPatternSet* out);
-
- // Clears |out| and populates it with the union of all sets in |sets|.
- static void CreateUnion(const std::vector<URLPatternSet>& sets,
- URLPatternSet* out);
-
- URLPatternSet();
- URLPatternSet(const URLPatternSet& rhs);
- explicit URLPatternSet(const std::set<URLPattern>& patterns);
- ~URLPatternSet();
-
- URLPatternSet& operator=(const URLPatternSet& rhs);
- bool operator==(const URLPatternSet& rhs) const;
-
- bool is_empty() const;
- size_t size() const;
- const std::set<URLPattern>& patterns() const { return patterns_; }
- const_iterator begin() const { return patterns_.begin(); }
- const_iterator end() const { return patterns_.end(); }
-
- // Adds a pattern to the set. Returns true if a new pattern was inserted,
- // false if the pattern was already in the set.
- bool AddPattern(const URLPattern& pattern);
-
- // Adds all patterns from |set| into this.
- void AddPatterns(const URLPatternSet& set);
-
- void ClearPatterns();
-
- // Returns true if the permission |set| is a subset of this.
- bool Contains(const URLPatternSet& set) const;
-
- // Test if the extent contains a URL.
- bool MatchesURL(const GURL& url) const;
-
- bool MatchesSecurityOrigin(const GURL& origin) const;
-
- // Returns true if there is a single URL that would be in two extents.
- bool OverlapsWith(const URLPatternSet& other) const;
-
- // Converts to and from Value for serialization to preferences.
- scoped_ptr<base::ListValue> ToValue() const;
- bool Populate(const base::ListValue& value,
- int valid_schemes,
- bool allow_file_access,
- std::string* error);
-
- bool Populate(const std::vector<std::string>& patterns,
- int valid_schemes,
- bool allow_file_access,
- std::string* error);
-
- private:
- // The list of URL patterns that comprise the extent.
- std::set<URLPattern> patterns_;
-};
-
-#endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_
« no previous file with comments | « chrome/common/extensions/permissions/permission_set_unittest.cc ('k') | chrome/common/extensions/url_pattern_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698