diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-28 20:12:08 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-28 20:12:08 +0000 |
commit | 7da7f343ce147cb2fd628fa0dd3ab7cd281efc06 (patch) | |
tree | a755766ebd897c03284bf3c14bdff3eb5e76f4a4 /chrome | |
parent | 21674df8085ee01ca91bbd4fe41ee1ea240a0cda (diff) | |
download | chromium_src-7da7f343ce147cb2fd628fa0dd3ab7cd281efc06.zip chromium_src-7da7f343ce147cb2fd628fa0dd3ab7cd281efc06.tar.gz chromium_src-7da7f343ce147cb2fd628fa0dd3ab7cd281efc06.tar.bz2 |
Cleanup a few FirstRun methods that are only applicable to Windows.
BUG=11971
TEST=No functional change. Make sure first-run/import still works on all three platforms.
Review URL: http://codereview.chromium.org/340020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_main.cc | 8 | ||||
-rw-r--r-- | chrome/browser/first_run.h | 28 | ||||
-rw-r--r-- | chrome/browser/first_run_gtk.cc | 19 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 32 |
4 files changed, 22 insertions, 65 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index c559f70..5ae1806 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -349,7 +349,6 @@ int BrowserMain(const MainFunctionParams& parameters) { bool is_first_run = FirstRun::IsChromeFirstRun() || parsed_command_line.HasSwitch(switches::kFirstRun); - bool first_run_ui_bypass = false; scoped_ptr<BrowserProcess> browser_process; if (parsed_command_line.HasSwitch(switches::kImport)) { @@ -490,11 +489,15 @@ int BrowserMain(const MainFunctionParams& parameters) { BrowserInit browser_init; +#if defined(OS_WIN) int rlz_ping_delay = 0; +#endif bool homepage_defined = false; int import_items = 0; int dont_import_items = 0; + bool first_run_ui_bypass = false; if (is_first_run) { +#if defined(OS_WIN) // On first run, we need to process the master preferences before the // browser's profile_manager object is created, but after ResourceBundle // is initialized. @@ -505,6 +508,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // The master prefs might specify a set of urls to display. if (first_run_tabs.size()) AddFirstRunNewTabs(&browser_init, first_run_tabs); +#endif // OS_WIN // If we are running in App mode, we do not want to show the importer // (first run) UI. @@ -637,8 +641,10 @@ int BrowserMain(const MainFunctionParams& parameters) { // Importing other browser settings is done in a browser-like process // that exits when this task has finished. +#if defined(OS_WIN) if (parsed_command_line.HasSwitch(switches::kImport)) return FirstRun::ImportNow(profile, parsed_command_line); +#endif // When another process is running, use it instead of starting us. switch (process_singleton.NotifyOtherProcess()) { diff --git a/chrome/browser/first_run.h b/chrome/browser/first_run.h index e728d64..2f4ca92 100644 --- a/chrome/browser/first_run.h +++ b/chrome/browser/first_run.h @@ -28,30 +28,18 @@ class ProcessSingleton; // install work for this user. After that the sentinel file is created. class FirstRun { public: - // Returns true if this is the first time chrome is run for this user. - static bool IsChromeFirstRun(); +#if defined(OS_WIN) // Creates the desktop shortcut to chrome for the current user. Returns // false if it fails. It will overwrite the shortcut if it exists. static bool CreateChromeDesktopShortcut(); // Creates the quick launch shortcut to chrome for the current user. Returns // false if it fails. It will overwrite the shortcut if it exists. static bool CreateChromeQuickLaunchShortcut(); - // Creates the sentinel file that signals that chrome has been configured. - static bool CreateSentinel(); - // Removes the sentinel file created in ConfigDone(). Returns false if the - // sentinel file could not be removed. - static bool RemoveSentinel(); - // Imports settings in a separate process. It spawns a second dedicated - // browser process that just does the import with the import progress UI. - static bool ImportSettings(Profile* profile, int browser_type, - int items_to_import, - gfx::NativeView parent_window); // Import browser items in this process. The browser and the items to // import are encoded int the command line. This function is paired with // FirstRun::ImportSettings(). This function might or might not show // a visible UI depending on the cmdline parameters. static int ImportNow(Profile* profile, const CommandLine& cmdline); - // The master preferences is a JSON file with the same entries as the // 'Default\Preferences' file. This function locates this file from // master_pref_path or if that path is empty from the default location @@ -74,6 +62,20 @@ class FirstRun { bool* homepage_defined, int* do_import_items, int* dont_import_items); +#endif // OS_WIN + + // Returns true if this is the first time chrome is run for this user. + static bool IsChromeFirstRun(); + // Creates the sentinel file that signals that chrome has been configured. + static bool CreateSentinel(); + // Removes the sentinel file created in ConfigDone(). Returns false if the + // sentinel file could not be removed. + static bool RemoveSentinel(); + // Imports settings in a separate process. It spawns a second dedicated + // browser process that just does the import with the import progress UI. + static bool ImportSettings(Profile* profile, int browser_type, + int items_to_import, + gfx::NativeView parent_window); // Sets the kShouldShowFirstRunBubble local state pref so that the browser // shows the bubble once the main message loop gets going. Returns false if diff --git a/chrome/browser/first_run_gtk.cc b/chrome/browser/first_run_gtk.cc index 2c5d144..3d4a091 100644 --- a/chrome/browser/first_run_gtk.cc +++ b/chrome/browser/first_run_gtk.cc @@ -10,24 +10,5 @@ bool OpenFirstRunDialog(Profile* profile, bool homepage_defined, int import_items, int dont_import_items, ProcessSingleton* process_singleton) { - // TODO(port): Use process_singleton to make sure Chrome can not be started - // while this process is active. return FirstRunDialog::Show(profile, process_singleton); } - -bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, - const FilePath& master_prefs_path, - std::vector<std::wstring>* new_tabs, - int* ping_delay, - bool* homepage_defined, - int* do_import_items, - int* dont_import_items) { - // http://code.google.com/p/chromium/issues/detail?id=11971 - return true; -} - -// static -int FirstRun::ImportNow(Profile* profile, const CommandLine& cmdline) { - // http://code.google.com/p/chromium/issues/detail?id=11971 - return 0; -} diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index 284cabb..c7d665a 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -80,38 +80,6 @@ void AutomationProvider::OnMessageFromExternalHost( #endif // defined(OS_MACOSX) //-------------------------------------------------------------------------- - -#if defined(OS_MACOSX) -// static -bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, - const FilePath& master_prefs_path, - std::vector<std::wstring>* new_tabs, - int* ping_delay, - bool* homepage_defined, - int* do_import_items, - int* dont_import_items) { - // http://code.google.com/p/chromium/issues/detail?id=11971 - // Pretend we processed them correctly. - return true; -} - -// static -int FirstRun::ImportNow(Profile* profile, const CommandLine& cmdline) { - // http://code.google.com/p/chromium/issues/detail?id=11971 - return 0; -} -#endif - -bool FirstRun::CreateChromeDesktopShortcut() { - NOTIMPLEMENTED(); - return false; -} - -bool FirstRun::CreateChromeQuickLaunchShortcut() { - NOTIMPLEMENTED(); - return false; -} - // static bool Upgrade::IsBrowserAlreadyRunning() { // http://code.google.com/p/chromium/issues/detail?id=9295 |