OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/extensions/file_browser_handler.h" |
| 6 |
| 7 #include "chrome/common/extensions/url_pattern.h" |
| 8 #include "googleurl/src/gurl.h" |
| 9 |
| 10 FileBrowserHandler::FileBrowserHandler() { |
| 11 } |
| 12 |
| 13 FileBrowserHandler::~FileBrowserHandler() { |
| 14 } |
| 15 |
| 16 void FileBrowserHandler::AddPattern(const URLPattern& pattern) { |
| 17 patterns_.push_back(pattern); |
| 18 } |
| 19 |
| 20 void FileBrowserHandler::ClearPatterns() { |
| 21 patterns_.clear(); |
| 22 } |
| 23 |
| 24 bool FileBrowserHandler::MatchesURL(const GURL& url) const { |
| 25 for (PatternList::const_iterator pattern = patterns_.begin(); |
| 26 pattern != patterns_.end(); ++pattern) { |
| 27 if (pattern->MatchesUrl(url)) |
| 28 return true; |
| 29 } |
| 30 return false; |
| 31 } |
| 32 |
OLD | NEW |