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