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 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ |
6 #define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ | 6 #define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/string16.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 | 14 |
14 class FilePath; | 15 class FilePath; |
15 class GURL; | 16 class GURL; |
16 class TemplateURL; | 17 class TemplateURL; |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class DictionaryValue; | 20 class DictionaryValue; |
20 } | 21 } |
21 | 22 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // |prefs| is not filled). | 90 // |prefs| is not filled). |
90 // Note: for strings, only valid UTF-8 string values are supported. If a | 91 // Note: for strings, only valid UTF-8 string values are supported. If a |
91 // key/pair is not valid UTF-8, it is ignored and will not appear in |prefs|. | 92 // key/pair is not valid UTF-8, it is ignored and will not appear in |prefs|. |
92 bool ParsePrefFile(const FilePath& pref_file, base::DictionaryValue* prefs); | 93 bool ParsePrefFile(const FilePath& pref_file, base::DictionaryValue* prefs); |
93 | 94 |
94 // Parses the value of a particular firefox preference from a string that is the | 95 // Parses the value of a particular firefox preference from a string that is the |
95 // contents of the prefs file. | 96 // contents of the prefs file. |
96 std::string GetPrefsJsValue(const std::string& prefs, | 97 std::string GetPrefsJsValue(const std::string& prefs, |
97 const std::string& pref_key); | 98 const std::string& pref_key); |
98 | 99 |
| 100 // Returns the localized Firefox branding name. |
| 101 // This is useful to differentiate between Firefox and Iceweasel. |
| 102 // If anything goes wrong while trying to obtain the branding name, |
| 103 // the function assumes it's Firefox. |
| 104 string16 GetFirefoxImporterName(const FilePath& app_path); |
| 105 |
99 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ | 106 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ |
OLD | NEW |