summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-07-06 15:09:00 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-06 22:10:42 +0000
commitd97eede0d9eb25ebffc918c8ebfcf9a9d9703a88 (patch)
treee83dc87df21704e72e63423961e82b02244ac015 /extensions
parent7d47f7a394e09e1a6e3e546932051649f185d47e (diff)
downloadchromium_src-d97eede0d9eb25ebffc918c8ebfcf9a9d9703a88.zip
chromium_src-d97eede0d9eb25ebffc918c8ebfcf9a9d9703a88.tar.gz
chromium_src-d97eede0d9eb25ebffc918c8ebfcf9a9d9703a88.tar.bz2
Move MatchPattern to its own header and the base namespace.
BUG= Review URL: https://codereview.chromium.org/1226673003 Cr-Commit-Position: refs/heads/master@{#337488}
Diffstat (limited to 'extensions')
-rw-r--r--extensions/common/manifest_handlers/webview_info.cc3
-rw-r--r--extensions/common/manifest_test.cc6
-rw-r--r--extensions/common/url_pattern.cc3
-rw-r--r--extensions/common/user_script.cc3
-rw-r--r--extensions/shell/browser/shell_nacl_browser_delegate_unittest.cc5
-rw-r--r--extensions/shell/common/shell_content_client_unittest.cc3
-rw-r--r--extensions/utility/unpacker_unittest.cc18
7 files changed, 25 insertions, 16 deletions
diff --git a/extensions/common/manifest_handlers/webview_info.cc b/extensions/common/manifest_handlers/webview_info.cc
index 99e9d40..5040002 100644
--- a/extensions/common/manifest_handlers/webview_info.cc
+++ b/extensions/common/manifest_handlers/webview_info.cc
@@ -5,6 +5,7 @@
#include "extensions/common/manifest_handlers/webview_info.h"
#include "base/memory/scoped_ptr.h"
+#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -30,7 +31,7 @@ class PartitionItem {
}
bool Matches(const std::string& partition_id) const {
- return MatchPattern(partition_id, partition_pattern_);
+ return base::MatchPattern(partition_id, partition_pattern_);
}
// Adds a pattern to the set. Returns true if a new pattern was inserted,
diff --git a/extensions/common/manifest_test.cc b/extensions/common/manifest_test.cc
index a3712d0..2dfdaaa 100644
--- a/extensions/common/manifest_test.cc
+++ b/extensions/common/manifest_test.cc
@@ -8,6 +8,7 @@
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/path_service.h"
+#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "extensions/common/extension_l10n_util.h"
@@ -167,8 +168,9 @@ void ManifestTest::VerifyExpectedError(
EXPECT_FALSE(extension) <<
"Expected failure loading extension '" << name <<
"', but didn't get one.";
- EXPECT_TRUE(MatchPattern(error, expected_error)) << name <<
- " expected '" << expected_error << "' but got '" << error << "'";
+ EXPECT_TRUE(base::MatchPattern(error, expected_error))
+ << name << " expected '" << expected_error << "' but got '" << error
+ << "'";
}
void ManifestTest::LoadAndExpectError(
diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc
index ab24ccf..b72ce30 100644
--- a/extensions/common/url_pattern.cc
+++ b/extensions/common/url_pattern.cc
@@ -6,6 +6,7 @@
#include <ostream>
+#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
@@ -478,7 +479,7 @@ bool URLPattern::MatchesPath(const std::string& test) const {
if (test + "/*" == path_escaped_)
return true;
- return MatchPattern(test, path_escaped_);
+ return base::MatchPattern(test, path_escaped_);
}
const std::string& URLPattern::GetAsString() const {
diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc
index 5be4880..b3d82bb 100644
--- a/extensions/common/user_script.cc
+++ b/extensions/common/user_script.cc
@@ -7,6 +7,7 @@
#include "base/atomic_sequence_num.h"
#include "base/command_line.h"
#include "base/pickle.h"
+#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "extensions/common/switches.h"
@@ -20,7 +21,7 @@ bool UrlMatchesGlobs(const std::vector<std::string>* globs,
const GURL& url) {
for (std::vector<std::string>::const_iterator glob = globs->begin();
glob != globs->end(); ++glob) {
- if (MatchPattern(url.spec(), *glob))
+ if (base::MatchPattern(url.spec(), *glob))
return true;
}
diff --git a/extensions/shell/browser/shell_nacl_browser_delegate_unittest.cc b/extensions/shell/browser/shell_nacl_browser_delegate_unittest.cc
index e42fb33..0e1d178 100644
--- a/extensions/shell/browser/shell_nacl_browser_delegate_unittest.cc
+++ b/extensions/shell/browser/shell_nacl_browser_delegate_unittest.cc
@@ -4,6 +4,7 @@
#include "extensions/shell/browser/shell_nacl_browser_delegate.h"
+#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "content/public/test/test_browser_context.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -19,8 +20,8 @@ TEST_F(ShellNaClBrowserDelegateTest, VersionString) {
// Version should look like "1.2.3.4 (5)".
std::string version = delegate.GetVersionString();
- EXPECT_TRUE(MatchPattern(version, "*.*.*.* (*)")) << "bad version "
- << version;
+ EXPECT_TRUE(base::MatchPattern(version, "*.*.*.* (*)")) << "bad version "
+ << version;
}
} // namespace extensions
diff --git a/extensions/shell/common/shell_content_client_unittest.cc b/extensions/shell/common/shell_content_client_unittest.cc
index bf5779f..eb9694d 100644
--- a/extensions/shell/common/shell_content_client_unittest.cc
+++ b/extensions/shell/common/shell_content_client_unittest.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -23,7 +24,7 @@ TEST_F(ShellContentClientTest, UserAgentFormat) {
<< user_agent;
// Must contain a substring like "Chrome/1.2.3.4".
- EXPECT_TRUE(MatchPattern(user_agent, "*Chrome/*.*.*.*")) << user_agent;
+ EXPECT_TRUE(base::MatchPattern(user_agent, "*Chrome/*.*.*.*")) << user_agent;
}
} // namespace extensions
diff --git a/extensions/utility/unpacker_unittest.cc b/extensions/utility/unpacker_unittest.cc
index b323e01..bb99aae 100644
--- a/extensions/utility/unpacker_unittest.cc
+++ b/extensions/utility/unpacker_unittest.cc
@@ -5,6 +5,7 @@
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
+#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -80,11 +81,11 @@ TEST_F(UnpackerTest, InvalidDefaultLocale) {
TEST_F(UnpackerTest, InvalidMessagesFile) {
SetupUnpacker("invalid_messages_file.crx");
EXPECT_FALSE(unpacker_->Run());
- EXPECT_TRUE(
- MatchPattern(unpacker_->error_message(),
- ASCIIToUTF16(
- "*_locales?en_US?messages.json: Line: 2, column: 11,"
- " Syntax error.")))
+ EXPECT_TRUE(base::MatchPattern(
+ unpacker_->error_message(),
+ ASCIIToUTF16(
+ "*_locales?en_US?messages.json: Line: 2, column: 11,"
+ " Syntax error.")))
<< unpacker_->error_message();
}
@@ -105,9 +106,10 @@ TEST_F(UnpackerTest, MissingDefaultLocaleHasLocalesFolder) {
TEST_F(UnpackerTest, MissingMessagesFile) {
SetupUnpacker("missing_messages_file.crx");
EXPECT_FALSE(unpacker_->Run());
- EXPECT_TRUE(MatchPattern(unpacker_->error_message(),
- ASCIIToUTF16(errors::kLocalesMessagesFileMissing) +
- ASCIIToUTF16("*_locales?en_US?messages.json")));
+ EXPECT_TRUE(
+ base::MatchPattern(unpacker_->error_message(),
+ ASCIIToUTF16(errors::kLocalesMessagesFileMissing) +
+ ASCIIToUTF16("*_locales?en_US?messages.json")));
}
TEST_F(UnpackerTest, NoLocaleData) {