| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 | 13 |
| 14 class DictionaryValue; | 14 class DictionaryValue; |
| 15 class GURL; | 15 class GURL; |
| 16 class TemplateURL; | 16 class TemplateURL; |
| 17 | 17 |
| 18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 19 // Detects which version of Firefox is installed from registry. Returns its | 19 // Detects which version of Firefox is installed from registry. Returns its |
| 20 // major version, and drops the minor version. Returns 0 if | 20 // major version, and drops the minor version. Returns 0 if |
| 21 // failed. If there are indicators of both FF2 and FF3 it is | 21 // failed. If there are indicators of both FF2 and FF3 it is |
| 22 // biased to return the biggest version. | 22 // biased to return the biggest version. |
| 23 int GetCurrentFirefoxMajorVersionFromRegistry(); | 23 int GetCurrentFirefoxMajorVersionFromRegistry(); |
| 24 | 24 |
| 25 // Detects where Firefox lives. Returns a empty string if Firefox | 25 // Detects where Firefox lives. Returns a empty string if Firefox |
| 26 // is not installed. | 26 // is not installed. |
| 27 std::wstring GetFirefoxInstallPathFromRegistry(); | 27 std::wstring GetFirefoxInstallPathFromRegistry(); |
| 28 #endif | 28 #endif // OS_WIN |
| 29 |
| 30 #if defined(OS_MACOSX) |
| 31 |
| 32 // Get the directory in which the Firefox .dylibs live, we need to load these |
| 33 // in order to decoded FF profile passwords. |
| 34 // The Path is usuall FF App Bundle/Contents/Mac OS/ |
| 35 // Returns empty path on failure. |
| 36 FilePath GetFirefoxDylibPath(); |
| 37 #endif // OS_MACOSX |
| 29 | 38 |
| 30 // Detects version of Firefox and installation path from given Firefox profile | 39 // Detects version of Firefox and installation path from given Firefox profile |
| 31 bool GetFirefoxVersionAndPathFromProfile(const std::wstring& profile_path, | 40 bool GetFirefoxVersionAndPathFromProfile(const std::wstring& profile_path, |
| 32 int* version, | 41 int* version, |
| 33 std::wstring* app_path); | 42 std::wstring* app_path); |
| 34 | 43 |
| 35 // Gets the full path of the profiles.ini file. This file records | 44 // Gets the full path of the profiles.ini file. This file records |
| 36 // the profiles that can be used by Firefox. Returns an empty | 45 // the profiles that can be used by Firefox. Returns an empty |
| 37 // string if failed. | 46 // string if failed. |
| 38 FilePath GetProfilesINI(); | 47 FilePath GetProfilesINI(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 69 // Returns the home page set in Firefox in a particular profile. | 78 // Returns the home page set in Firefox in a particular profile. |
| 70 GURL GetHomepage(const std::wstring& profile_path); | 79 GURL GetHomepage(const std::wstring& profile_path); |
| 71 | 80 |
| 72 // Checks to see if this home page is a default home page, as specified by | 81 // Checks to see if this home page is a default home page, as specified by |
| 73 // the resource file browserconfig.properties in the Firefox application | 82 // the resource file browserconfig.properties in the Firefox application |
| 74 // directory. | 83 // directory. |
| 75 bool IsDefaultHomepage(const GURL& homepage, const std::wstring& app_path); | 84 bool IsDefaultHomepage(const GURL& homepage, const std::wstring& app_path); |
| 76 | 85 |
| 77 | 86 |
| 78 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ | 87 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_ |
| OLD | NEW |