diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-31 23:34:30 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-31 23:34:30 +0000 |
commit | c25a66d6ad7c502c30dba5d4457c26ec8afef31f (patch) | |
tree | be8f2abeffce4fd8251c9652238041d7bd8e217f /chrome/browser/first_run.cc | |
parent | b44a68148fb3f7a919010a4e5765b7b746453cbf (diff) | |
download | chromium_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.cc')
-rw-r--r-- | chrome/browser/first_run.cc | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index 7304494..c6d7ac7 100644 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -14,10 +14,8 @@ #include "base/file_util.h" #include "base/path_service.h" -#include "chrome/browser/importer/importer.h" #include "chrome/browser/pref_service.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" namespace { @@ -114,54 +112,6 @@ bool FirstRun::SetOEMFirstRunBubblePref() { return true; } -int FirstRun::ImportFromFile(Profile* profile, const CommandLine& cmdline) { - std::wstring file_path = cmdline.GetSwitchValue(switches::kImportFromFile); - if (file_path.empty()) { - NOTREACHED(); - return false; - } - scoped_refptr<ImporterHost> importer_host = new ImporterHost(); - FirstRunImportObserver observer; - - importer_host->set_headless(); - - ProfileInfo profile_info; - profile_info.browser_type = importer::BOOKMARKS_HTML; - profile_info.source_path = file_path; - - StartImportingWithUI( - NULL, - importer::FAVORITES, - importer_host, - profile_info, - profile, - &observer, - true); - - observer.RunLoop(); - return observer.import_result(); -} - -// TODO(port): Import switches need ported to both Mac and Linux. Not all -// import switches here are implemented for Linux. None are implemented for -// Mac (as this function will not be called on Mac). -int FirstRun::ImportNow(Profile* profile, const CommandLine& cmdline) { - int return_code = true; - if (cmdline.HasSwitch(switches::kImportFromFile)) { - // Silently import preset bookmarks from file. - // This is an OEM scenario. - return_code = ImportFromFile(profile, cmdline); - } - if (cmdline.HasSwitch(switches::kImport)) { -#if defined(OS_WIN) - return_code = ImportFromBrowser(profile, cmdline); -#else - NOTIMPLEMENTED(); -#endif - } - return return_code; -} - #if defined(OS_MACOSX) bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, const FilePath& master_prefs_path, MasterPrefs* out_prefs) { @@ -169,27 +119,3 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, return true; } #endif - -int FirstRunImportObserver::import_result() const { - return import_result_; -} - -void FirstRunImportObserver::ImportCanceled() { - import_result_ = ResultCodes::IMPORTER_CANCEL; - Finish(); -} -void FirstRunImportObserver::ImportComplete() { - import_result_ = ResultCodes::NORMAL_EXIT; - Finish(); -} - -void FirstRunImportObserver::RunLoop() { - loop_running_ = true; - MessageLoop::current()->Run(); -} - -void FirstRunImportObserver::Finish() { - if (loop_running_) - MessageLoop::current()->Quit(); -} - |