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/firefox_importer_utils.h" | 5 #include "chrome/browser/importer/firefox_importer_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // FirefoxURLParameterFilter is used to remove parameter mentioning Firefox from | 29 // FirefoxURLParameterFilter is used to remove parameter mentioning Firefox from |
30 // the search URL when importing search engines. | 30 // the search URL when importing search engines. |
31 class FirefoxURLParameterFilter : public TemplateURLParser::ParameterFilter { | 31 class FirefoxURLParameterFilter : public TemplateURLParser::ParameterFilter { |
32 public: | 32 public: |
33 FirefoxURLParameterFilter() {} | 33 FirefoxURLParameterFilter() {} |
34 virtual ~FirefoxURLParameterFilter() {} | 34 virtual ~FirefoxURLParameterFilter() {} |
35 | 35 |
36 // TemplateURLParser::ParameterFilter method. | 36 // TemplateURLParser::ParameterFilter method. |
37 virtual bool KeepParameter(const std::string& key, | 37 virtual bool KeepParameter(const std::string& key, |
38 const std::string& value) { | 38 const std::string& value) OVERRIDE { |
39 std::string low_value = StringToLowerASCII(value); | 39 std::string low_value = StringToLowerASCII(value); |
40 if (low_value.find("mozilla") != std::string::npos || | 40 if (low_value.find("mozilla") != std::string::npos || |
41 low_value.find("firefox") != std::string::npos || | 41 low_value.find("firefox") != std::string::npos || |
42 low_value.find("moz:") != std::string::npos ) | 42 low_value.find("moz:") != std::string::npos ) |
43 return false; | 43 return false; |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 DISALLOW_COPY_AND_ASSIGN(FirefoxURLParameterFilter); | 48 DISALLOW_COPY_AND_ASSIGN(FirefoxURLParameterFilter); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 } | 456 } |
457 } | 457 } |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
461 StringToLowerASCII(&branding_name); | 461 StringToLowerASCII(&branding_name); |
462 if (branding_name.find("iceweasel") != std::string::npos) | 462 if (branding_name.find("iceweasel") != std::string::npos) |
463 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); | 463 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_ICEWEASEL); |
464 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); | 464 return l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX); |
465 } | 465 } |
OLD | NEW |