| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_FIRST_RUN_H_ | 5 #ifndef CHROME_BROWSER_FIRST_RUN_H_ |
| 6 #define CHROME_BROWSER_FIRST_RUN_H_ | 6 #define CHROME_BROWSER_FIRST_RUN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 std::vector<GURL> new_tabs; | 38 std::vector<GURL> new_tabs; |
| 39 std::vector<GURL> bookmarks; | 39 std::vector<GURL> bookmarks; |
| 40 }; | 40 }; |
| 41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 42 // Creates the desktop shortcut to chrome for the current user. Returns | 42 // Creates the desktop shortcut to chrome for the current user. Returns |
| 43 // false if it fails. It will overwrite the shortcut if it exists. | 43 // false if it fails. It will overwrite the shortcut if it exists. |
| 44 static bool CreateChromeDesktopShortcut(); | 44 static bool CreateChromeDesktopShortcut(); |
| 45 // Creates the quick launch shortcut to chrome for the current user. Returns | 45 // Creates the quick launch shortcut to chrome for the current user. Returns |
| 46 // false if it fails. It will overwrite the shortcut if it exists. | 46 // false if it fails. It will overwrite the shortcut if it exists. |
| 47 static bool CreateChromeQuickLaunchShortcut(); | 47 static bool CreateChromeQuickLaunchShortcut(); |
| 48 // Import browser items in this process. The browser and the items to | 48 // Import bookmarks and browser items in this process. This function is |
| 49 // import are encoded int the command line. This function is paired with | 49 // paired with FirstRun::ImportSettings(). This function might or might not |
| 50 // FirstRun::ImportSettings(). This function might or might not show | 50 // show a visible UI depending on the cmdline parameters. |
| 51 // a visible UI depending on the cmdline parameters. | |
| 52 static int ImportNow(Profile* profile, const CommandLine& cmdline); | 51 static int ImportNow(Profile* profile, const CommandLine& cmdline); |
| 53 #endif // OS_WIN | 52 #endif // OS_WIN |
| 54 | 53 |
| 55 // The master preferences is a JSON file with the same entries as the | 54 // The master preferences is a JSON file with the same entries as the |
| 56 // 'Default\Preferences' file. This function locates this file from | 55 // 'Default\Preferences' file. This function locates this file from |
| 57 // master_pref_path or if that path is empty from the default location | 56 // master_pref_path or if that path is empty from the default location |
| 58 // which is '<path to chrome.exe>\master_preferences', and process it | 57 // which is '<path to chrome.exe>\master_preferences', and process it |
| 59 // so it becomes the default preferences in profile pointed by user_data_dir. | 58 // so it becomes the default preferences in profile pointed by user_data_dir. |
| 60 // After processing the file, the function returns true if showing the | 59 // After processing the file, the function returns true if showing the |
| 61 // first run dialog is needed, and returns false if skipping first run | 60 // first run dialog is needed, and returns false if skipping first run |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // browser shows the OEM first run bubble once the main message loop | 92 // browser shows the OEM first run bubble once the main message loop |
| 94 // gets going. Returns false if the pref could not be set. | 93 // gets going. Returns false if the pref could not be set. |
| 95 static bool SetOEMFirstRunBubblePref(); | 94 static bool SetOEMFirstRunBubblePref(); |
| 96 | 95 |
| 97 // Sets the kShouldShowWelcomePage local state pref so that the browser | 96 // Sets the kShouldShowWelcomePage local state pref so that the browser |
| 98 // loads the welcome tab once the message loop gets going. Returns false | 97 // loads the welcome tab once the message loop gets going. Returns false |
| 99 // if the pref could not be set. | 98 // if the pref could not be set. |
| 100 static bool SetShowWelcomePagePref(); | 99 static bool SetShowWelcomePagePref(); |
| 101 | 100 |
| 102 private: | 101 private: |
| 102 #if defined(OS_WIN) |
| 103 // Import bookmarks from an html file. The path to the file is provided in |
| 104 // the command line. |
| 105 static int ImportFromFile(Profile* profile, const CommandLine& cmdline); |
| 106 // Import browser items in this process. The browser and the items to |
| 107 // import are encoded int the command line. |
| 108 static int ImportFromBrowser(Profile* profile, const CommandLine& cmdline); |
| 109 #endif // OS_WIN |
| 103 // This class is for scoping purposes. | 110 // This class is for scoping purposes. |
| 104 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun); | 111 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun); |
| 105 }; | 112 }; |
| 106 | 113 |
| 107 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
| 108 // This class contains the actions that need to be performed when an upgrade | 115 // This class contains the actions that need to be performed when an upgrade |
| 109 // is required. This involves mainly swapping the chrome exe and relaunching | 116 // is required. This involves mainly swapping the chrome exe and relaunching |
| 110 // the new browser. | 117 // the new browser. |
| 111 class Upgrade { | 118 class Upgrade { |
| 112 public: | 119 public: |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // preferences and will override default behavior of importer. | 182 // preferences and will override default behavior of importer. |
| 176 // Returns true if the user clicked "Start", false if the user pressed "Cancel" | 183 // Returns true if the user clicked "Start", false if the user pressed "Cancel" |
| 177 // or closed the dialog. | 184 // or closed the dialog. |
| 178 bool OpenFirstRunDialog(Profile* profile, | 185 bool OpenFirstRunDialog(Profile* profile, |
| 179 bool homepage_defined, | 186 bool homepage_defined, |
| 180 int import_items, | 187 int import_items, |
| 181 int dont_import_items, | 188 int dont_import_items, |
| 182 ProcessSingleton* process_singleton); | 189 ProcessSingleton* process_singleton); |
| 183 | 190 |
| 184 #endif // CHROME_BROWSER_FIRST_RUN_H_ | 191 #endif // CHROME_BROWSER_FIRST_RUN_H_ |
| OLD | NEW |