summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run.h
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 23:34:30 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 23:34:30 +0000
commitc25a66d6ad7c502c30dba5d4457c26ec8afef31f (patch)
treebe8f2abeffce4fd8251c9652238041d7bd8e217f /chrome/browser/first_run.h
parentb44a68148fb3f7a919010a4e5765b7b746453cbf (diff)
downloadchromium_src-c25a66d6ad7c502c30dba5d4457c26ec8afef31f.zip
chromium_src-c25a66d6ad7c502c30dba5d4457c26ec8afef31f.tar.gz
chromium_src-c25a66d6ad7c502c30dba5d4457c26ec8afef31f.tar.bz2
Revert 43277 - Port the option to import bookmarks from a file to Linux
Call ImportNow from browser_main.cc Move necessary functions and a class from first_run_win.cc to first_run.cc and update first_run.h accordingly. Add some #defines for different OSes and some TODO(port) comments. These changes will allow the use of the importfromfile option to import bookmarks from a file at first run. I have built and tested this on Linux and Windows. BUG=32728 TEST=run with importfromfile Patch from Brian G. Merrell <bgmerrell@gmail.com> Review URL: http://codereview.chromium.org/1515004 TBR=evan@chromium.org This broke BookmarkBarGtkBrowserTest.ClickOnFloatingTest Review URL: http://codereview.chromium.org/1591005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run.h')
-rw-r--r--chrome/browser/first_run.h44
1 files changed, 10 insertions, 34 deletions
diff --git a/chrome/browser/first_run.h b/chrome/browser/first_run.h
index 2fe71ce..d8a5cfd 100644
--- a/chrome/browser/first_run.h
+++ b/chrome/browser/first_run.h
@@ -10,8 +10,6 @@
#include "base/basictypes.h"
#include "chrome/browser/browser_process_impl.h"
-#include "chrome/browser/importer/importer.h"
-#include "chrome/common/result_codes.h"
#include "gfx/native_widget_types.h"
#include "googleurl/src/gurl.h"
@@ -47,12 +45,11 @@ class FirstRun {
// 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();
-#endif // OS_WIN
- // Import bookmarks and/or browser items (depending on platform support)
- // in this process. This function is paired with FirstRun::ImportSettings().
- // This function might or might not show a visible UI depending on the
- // cmdline parameters.
+ // Import bookmarks and browser items in this process. 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);
+#endif // OS_WIN
// The master preferences is a JSON file with the same entries as the
// 'Default\Preferences' file. This function locates this file from
@@ -103,19 +100,19 @@ class FirstRun {
private:
#if defined(OS_WIN)
+ // Import bookmarks from an html file. The path to the file is provided in
+ // the command line.
+ static int ImportFromFile(Profile* profile, const CommandLine& cmdline);
+ // Import browser items in this process. The browser and the items to
+ // import are encoded int the command line.
+ static int ImportFromBrowser(Profile* profile, const CommandLine& cmdline);
// Imports settings in a separate process. It is the implementation of the
// public version.
static bool ImportSettings(Profile* profile, int browser_type,
int items_to_import,
const std::wstring& import_path,
gfx::NativeView parent_window);
- // Import browser items in this process. The browser and the items to
- // import are encoded int the command line.
- static int ImportFromBrowser(Profile* profile, const CommandLine& cmdline);
#endif // OS_WIN
- // Import bookmarks from an html file. The path to the file is provided in
- // the command line.
- static int ImportFromFile(Profile* profile, const CommandLine& cmdline);
// This class is for scoping purposes.
DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun);
};
@@ -178,27 +175,6 @@ class FirstRunBrowserProcess : public BrowserProcessImpl {
DISALLOW_COPY_AND_ASSIGN(FirstRunBrowserProcess);
};
-// This class is used by FirstRun::ImportNow to get notified of the outcome of
-// the import operation. It differs from ImportProcessRunner in that this
-// class executes in the context of importing child process.
-// The values that it handles are meant to be used as the process exit code.
-class FirstRunImportObserver : public ImportObserver {
- public:
- FirstRunImportObserver()
- : loop_running_(false), import_result_(ResultCodes::NORMAL_EXIT) {
- }
- int import_result() const;
- virtual void ImportCanceled();
- virtual void ImportComplete();
- void RunLoop();
- private:
- void Finish();
- bool loop_running_;
- int import_result_;
- DISALLOW_COPY_AND_ASSIGN(FirstRunImportObserver);
-};
-
-
// Show the First Run UI to the user, allowing them to create shortcuts for
// the app, import their bookmarks and other data from another browser into
// |profile| and perhaps some other tasks.