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/browser/importer/in_process_importer_bridge.h" | 5 #include "chrome/browser/importer/in_process_importer_bridge.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // FirefoxURLParameterFilter is used to remove parameter mentioning Firefox from | 71 // FirefoxURLParameterFilter is used to remove parameter mentioning Firefox from |
72 // the search URL when importing search engines. | 72 // the search URL when importing search engines. |
73 class FirefoxURLParameterFilter : public TemplateURLParser::ParameterFilter { | 73 class FirefoxURLParameterFilter : public TemplateURLParser::ParameterFilter { |
74 public: | 74 public: |
75 FirefoxURLParameterFilter() {} | 75 FirefoxURLParameterFilter() {} |
76 ~FirefoxURLParameterFilter() override {} | 76 ~FirefoxURLParameterFilter() override {} |
77 | 77 |
78 // TemplateURLParser::ParameterFilter method. | 78 // TemplateURLParser::ParameterFilter method. |
79 bool KeepParameter(const std::string& key, | 79 bool KeepParameter(const std::string& key, |
80 const std::string& value) override { | 80 const std::string& value) override { |
81 std::string low_value = base::StringToLowerASCII(value); | 81 std::string low_value = base::ToLowerASCII(value); |
82 if (low_value.find("mozilla") != std::string::npos || | 82 if (low_value.find("mozilla") != std::string::npos || |
83 low_value.find("firefox") != std::string::npos || | 83 low_value.find("firefox") != std::string::npos || |
84 low_value.find("moz:") != std::string::npos) { | 84 low_value.find("moz:") != std::string::npos) { |
85 return false; | 85 return false; |
86 } | 86 } |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 private: | 90 private: |
91 DISALLOW_COPY_AND_ASSIGN(FirefoxURLParameterFilter); | 91 DISALLOW_COPY_AND_ASSIGN(FirefoxURLParameterFilter); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 BrowserThread::PostTask( | 294 BrowserThread::PostTask( |
295 BrowserThread::UI, FROM_HERE, | 295 BrowserThread::UI, FROM_HERE, |
296 base::Bind(&ExternalProcessImporterHost::NotifyImportEnded, host_)); | 296 base::Bind(&ExternalProcessImporterHost::NotifyImportEnded, host_)); |
297 } | 297 } |
298 | 298 |
299 base::string16 InProcessImporterBridge::GetLocalizedString(int message_id) { | 299 base::string16 InProcessImporterBridge::GetLocalizedString(int message_id) { |
300 return l10n_util::GetStringUTF16(message_id); | 300 return l10n_util::GetStringUTF16(message_id); |
301 } | 301 } |
302 | 302 |
303 InProcessImporterBridge::~InProcessImporterBridge() {} | 303 InProcessImporterBridge::~InProcessImporterBridge() {} |
OLD | NEW |