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 FileBrowserHandler()10FileBrowserHandler::FileBrowserHandler() { 11 } 12 ~FileBrowserHandler()13FileBrowserHandler::~FileBrowserHandler() { 14 } 15 AddPattern(const URLPattern & pattern)16void FileBrowserHandler::AddPattern(const URLPattern& pattern) { 17 patterns_.push_back(pattern); 18 } 19 ClearPatterns()20void FileBrowserHandler::ClearPatterns() { 21 patterns_.clear(); 22 } 23 MatchesURL(const GURL & url) const24bool 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 33