OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
gab
2013/07/09 20:48:31
Do all of these method need to be common?
I feel
scottmg
2013/07/09 21:16:45
Possibly. The implementation of the functions was
gab
2013/07/09 21:29:43
sgtm.
| |
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_COMMON_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ |
6 #define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ | 6 #define CHROME_COMMON_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/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 class TemplateURL; | 16 class TemplateURL; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 // the resource file browserconfig.properties in the Firefox application | 78 // the resource file browserconfig.properties in the Firefox application |
79 // directory. | 79 // directory. |
80 bool IsDefaultHomepage(const GURL& homepage, const base::FilePath& app_path); | 80 bool IsDefaultHomepage(const GURL& homepage, const base::FilePath& app_path); |
81 | 81 |
82 // Parses the prefs found in the file |pref_file| and puts the key/value pairs | 82 // Parses the prefs found in the file |pref_file| and puts the key/value pairs |
83 // in |prefs|. Keys are strings, and values can be strings, booleans or | 83 // in |prefs|. Keys are strings, and values can be strings, booleans or |
84 // integers. Returns true if it succeeded, false otherwise (in which case | 84 // integers. Returns true if it succeeded, false otherwise (in which case |
85 // |prefs| is not filled). | 85 // |prefs| is not filled). |
86 // Note: for strings, only valid UTF-8 string values are supported. If a | 86 // Note: for strings, only valid UTF-8 string values are supported. If a |
87 // key/pair is not valid UTF-8, it is ignored and will not appear in |prefs|. | 87 // key/pair is not valid UTF-8, it is ignored and will not appear in |prefs|. |
88 bool ParsePrefFile(const base::FilePath& pref_file, base::DictionaryValue* prefs ); | 88 bool ParsePrefFile(const base::FilePath& pref_file, |
89 base::DictionaryValue* prefs); | |
89 | 90 |
90 // Parses the value of a particular firefox preference from a string that is the | 91 // Parses the value of a particular firefox preference from a string that is the |
91 // contents of the prefs file. | 92 // contents of the prefs file. |
92 std::string GetPrefsJsValue(const std::string& prefs, | 93 std::string GetPrefsJsValue(const std::string& prefs, |
93 const std::string& pref_key); | 94 const std::string& pref_key); |
94 | 95 |
95 // Returns the localized Firefox branding name. | 96 // Returns the localized Firefox branding name. |
96 // This is useful to differentiate between Firefox and Iceweasel. | 97 // This is useful to differentiate between Firefox and Iceweasel. |
97 // If anything goes wrong while trying to obtain the branding name, | 98 // If anything goes wrong while trying to obtain the branding name, |
98 // the function assumes it's Firefox. | 99 // the function assumes it's Firefox. |
99 string16 GetFirefoxImporterName(const base::FilePath& app_path); | 100 string16 GetFirefoxImporterName(const base::FilePath& app_path); |
100 | 101 |
101 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ | 102 #endif // CHROME_COMMON_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ |
OLD | NEW |