| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/file_util.h" |
| 9 #include "base/values.h" | 10 #include "base/values.h" |
| 10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 11 #include "webkit/glue/password_form.h" | 12 #include "webkit/glue/password_form.h" |
| 12 | 13 |
| 13 class GURL; | 14 class GURL; |
| 14 class TemplateURL; | 15 class TemplateURL; |
| 15 | 16 |
| 16 // Detects which version of Firefox is installed. Returns its | 17 // Detects which version of Firefox is installed from registry. Returns its |
| 17 // major version, and drops the minor version. Returns 0 if | 18 // major version, and drops the minor version. Returns 0 if |
| 18 // failed. If there are indicators of both FF2 and FF3 it is | 19 // failed. If there are indicators of both FF2 and FF3 it is |
| 19 // biased to return the biggest version. | 20 // biased to return the biggest version. |
| 20 int GetCurrentFirefoxMajorVersion(); | 21 int GetCurrentFirefoxMajorVersion(); |
| 21 | 22 |
| 22 #if defined(OS_WIN) | 23 #if defined(OS_WIN) || defined(OS_LINUX) |
| 24 // Detects version of Firefox and installation path from given Firefox profile |
| 25 bool GetFirefoxVersionAndPathFromProfile(const std::wstring& profile_path, |
| 26 int* version, |
| 27 std::wstring* app_path); |
| 28 |
| 23 // Gets the full path of the profiles.ini file. This file records | 29 // Gets the full path of the profiles.ini file. This file records |
| 24 // the profiles that can be used by Firefox. Returns an empty | 30 // the profiles that can be used by Firefox. Returns an empty |
| 25 // string if failed. | 31 // string if failed. |
| 26 std::wstring GetProfilesINI(); | 32 FilePath GetProfilesINI(); |
| 27 | 33 |
| 28 // Parses the profile.ini file, and stores its information in |root|. | 34 // Parses the profile.ini file, and stores its information in |root|. |
| 29 // This file is a plain-text file. Key/value pairs are stored one per | 35 // This file is a plain-text file. Key/value pairs are stored one per |
| 30 // line, and they are separeated in different sections. For example: | 36 // line, and they are separeated in different sections. For example: |
| 31 // [General] | 37 // [General] |
| 32 // StartWithLastProfile=1 | 38 // StartWithLastProfile=1 |
| 33 // | 39 // |
| 34 // [Profile0] | 40 // [Profile0] |
| 35 // Name=default | 41 // Name=default |
| 36 // IsRelative=1 | 42 // IsRelative=1 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 HMODULE softokn3_dll_; | 214 HMODULE softokn3_dll_; |
| 209 #endif | 215 #endif |
| 210 | 216 |
| 211 // True if NSS_Init() has been called | 217 // True if NSS_Init() has been called |
| 212 bool is_nss_initialized_; | 218 bool is_nss_initialized_; |
| 213 | 219 |
| 214 DISALLOW_COPY_AND_ASSIGN(NSSDecryptor); | 220 DISALLOW_COPY_AND_ASSIGN(NSSDecryptor); |
| 215 }; | 221 }; |
| 216 | 222 |
| 217 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ | 223 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ |
| OLD | NEW |