OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/extensions/user_script.h" | 5 #include "extensions/common/user_script.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "extensions/common/switches.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 bool UrlMatchesGlobs(const std::vector<std::string>* globs, | 14 bool UrlMatchesGlobs(const std::vector<std::string>* globs, |
15 const GURL& url) { | 15 const GURL& url) { |
16 for (std::vector<std::string>::const_iterator glob = globs->begin(); | 16 for (std::vector<std::string>::const_iterator glob = globs->begin(); |
17 glob != globs->end(); ++glob) { | 17 glob != globs->end(); ++glob) { |
18 if (MatchPattern(url.spec(), *glob)) | 18 if (MatchPattern(url.spec(), *glob)) |
19 return true; | 19 return true; |
20 } | 20 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 CHECK(pickle.ReadUInt64(iter, &num_files)); | 227 CHECK(pickle.ReadUInt64(iter, &num_files)); |
228 scripts->clear(); | 228 scripts->clear(); |
229 for (uint64 i = 0; i < num_files; ++i) { | 229 for (uint64 i = 0; i < num_files; ++i) { |
230 File file; | 230 File file; |
231 file.Unpickle(pickle, iter); | 231 file.Unpickle(pickle, iter); |
232 scripts->push_back(file); | 232 scripts->push_back(file); |
233 } | 233 } |
234 } | 234 } |
235 | 235 |
236 } // namespace extensions | 236 } // namespace extensions |
OLD | NEW |