summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 00:47:56 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 00:47:56 +0000
commitf8512886af68091631786fb1ffdad7fbe7b92981 (patch)
tree0129d966bfd61e40c6882f583268d725cee673d5 /chrome/browser
parent78c0c9e23c13864112a91dfcbfce4a282d689afc (diff)
downloadchromium_src-f8512886af68091631786fb1ffdad7fbe7b92981.zip
chromium_src-f8512886af68091631786fb1ffdad7fbe7b92981.tar.gz
chromium_src-f8512886af68091631786fb1ffdad7fbe7b92981.tar.bz2
Slight cleanup of some first-run/master-prefs stuff.
- let AddFirstRunNewTabs() run as elsewhere on Mac (the list of first-run tabs will be empty) - move various #if defined(OS_MACOSX) stuff to (existing!) Mac-specific files instead - remove an essentially-unused argument to FirstRun::ProcessMasterPreferences() (the location of the master prefs was never specified, so the standard location was always used) BUG=none TEST=everything still works Review URL: http://codereview.chromium.org/2077025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48345 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_main.cc12
-rw-r--r--chrome/browser/first_run.cc8
-rw-r--r--chrome/browser/first_run.h15
-rw-r--r--chrome/browser/first_run_gtk.cc15
-rw-r--r--chrome/browser/first_run_mac.mm8
-rw-r--r--chrome/browser/first_run_win.cc17
6 files changed, 27 insertions, 48 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 6b7d540..9c109cb 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -325,7 +325,6 @@ void SetFileDescriptorLimit(unsigned int max_descriptors) {
}
#endif
-#if !defined(OS_MACOSX)
void AddFirstRunNewTabs(BrowserInit* browser_init,
const std::vector<GURL>& new_tabs) {
for (std::vector<GURL>::const_iterator it = new_tabs.begin();
@@ -334,12 +333,6 @@ void AddFirstRunNewTabs(BrowserInit* browser_init,
browser_init->AddFirstRunTab(*it);
}
}
-#else // OS_MACOSX
-// TODO(cpu): implement first run experience for other platforms.
-void AddFirstRunNewTabs(BrowserInit* browser_init,
- const std::vector<GURL>& new_tabs) {
-}
-#endif
#if defined(USE_LINUX_BREAKPAD)
class GetLinuxDistroTask : public Task {
@@ -894,12 +887,11 @@ int BrowserMain(const MainFunctionParams& parameters) {
// On first run, we need to process the master preferences before the
// browser's profile_manager object is created, but after ResourceBundle
// is initialized.
- FirstRun::MasterPrefs master_prefs = {0};
+ FirstRun::MasterPrefs master_prefs = { 0 };
bool first_run_ui_bypass = false; // True to skip first run UI.
if (is_first_run) {
first_run_ui_bypass =
- !FirstRun::ProcessMasterPreferences(user_data_dir,
- FilePath(), &master_prefs);
+ !FirstRun::ProcessMasterPreferences(user_data_dir, &master_prefs);
AddFirstRunNewTabs(&browser_init, master_prefs.new_tabs);
// If we are running in App mode, we do not want to show the importer
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc
index f4952eb..4ef364b 100644
--- a/chrome/browser/first_run.cc
+++ b/chrome/browser/first_run.cc
@@ -174,14 +174,6 @@ int FirstRun::ImportNow(Profile* profile, const CommandLine& cmdline) {
return return_code;
}
-#if defined(OS_MACOSX)
-bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
- const FilePath& master_prefs_path, MasterPrefs* out_prefs) {
- NOTIMPLEMENTED();
- return true;
-}
-#endif
-
int FirstRunImportObserver::import_result() const {
return import_result_;
}
diff --git a/chrome/browser/first_run.h b/chrome/browser/first_run.h
index 0ac3da5..a08e753 100644
--- a/chrome/browser/first_run.h
+++ b/chrome/browser/first_run.h
@@ -65,14 +65,12 @@ class FirstRun {
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
- // which is '<path to chrome.exe>\master_preferences', and process it
- // so it becomes the default preferences in profile pointed by user_data_dir.
- // After processing the file, the function returns true if showing the
- // first run dialog is needed, and returns false if skipping first run
- // dialogs. The detailed settings in the preference file is reported via
- // preference_details.
+ // 'Default\Preferences' file. This function locates this file from a standard
+ // location and processes it so it becomes the default preferences in the
+ // profile pointed to by |user_data_dir|. After processing the file, the
+ // function returns true if and only if showing the first run dialog is
+ // needed. The detailed settings in the preference file are reported via
+ // |preference_details|.
//
// This function destroys any existing prefs file and it is meant to be
// invoked only on first run.
@@ -80,7 +78,6 @@ class FirstRun {
// See chrome/installer/util/master_preferences.h for a description of
// 'master_preferences' file.
static bool ProcessMasterPreferences(const FilePath& user_data_dir,
- const FilePath& master_prefs_path,
MasterPrefs* out_prefs);
// Returns true if this is the first time chrome is run for this user.
diff --git a/chrome/browser/first_run_gtk.cc b/chrome/browser/first_run_gtk.cc
index 2b48d3b..4183fe3 100644
--- a/chrome/browser/first_run_gtk.cc
+++ b/chrome/browser/first_run_gtk.cc
@@ -42,17 +42,14 @@ FilePath GetDefaultPrefFilePath(bool create_profile_dir,
}
bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
- const FilePath& master_prefs_path,
MasterPrefs* out_prefs) {
DCHECK(!user_data_dir.empty());
- FilePath master_prefs = master_prefs_path;
- if (master_prefs.empty()) {
- // The default location of the master prefs is next to the chrome binary.
- if (!PathService::Get(base::DIR_EXE, &master_prefs))
- return true;
- master_prefs =
- master_prefs.AppendASCII(installer_util::kDefaultMasterPrefs);
- }
+
+ // The standard location of the master prefs is next to the chrome binary.
+ FilePath master_prefs;
+ if (!PathService::Get(base::DIR_EXE, &master_prefs))
+ return true;
+ master_prefs = master_prefs.AppendASCII(installer_util::kDefaultMasterPrefs);
scoped_ptr<DictionaryValue> prefs(
installer_util::ParseDistributionPreferences(master_prefs));
diff --git a/chrome/browser/first_run_mac.mm b/chrome/browser/first_run_mac.mm
index 16ef3e7..b6bcbab 100644
--- a/chrome/browser/first_run_mac.mm
+++ b/chrome/browser/first_run_mac.mm
@@ -40,7 +40,6 @@ class FirstRunController : public ImportObserver {
// first run tasks are done.
void FirstRunDone();
-
scoped_refptr<ImporterHost> importer_host_;
DISALLOW_COPY_AND_ASSIGN(FirstRunController);
@@ -57,6 +56,13 @@ bool OpenFirstRunDialog(Profile* profile,
return controller->DoFirstRun(profile, process_singleton);
}
+bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
+ MasterPrefs* out_prefs) {
+ // TODO(jeremy,viettrungluu): http://crbug.com/44901
+ NOTIMPLEMENTED();
+ return true;
+}
+
FirstRunController::FirstRunController()
: importer_host_(new ImporterHost) {
}
diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc
index f12a75b..a93a16c 100644
--- a/chrome/browser/first_run_win.cc
+++ b/chrome/browser/first_run_win.cc
@@ -228,20 +228,15 @@ bool FirstRun::CreateChromeQuickLaunchShortcut() {
true); // create if doesn't exist.
}
-
bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
- const FilePath& master_prefs_path,
MasterPrefs* out_prefs) {
DCHECK(!user_data_dir.empty());
- FilePath master_prefs = master_prefs_path;
- if (master_prefs.empty()) {
- // The default location of the master prefs is next to the chrome exe.
- // TODO(port): port installer_util and use this.
- if (!PathService::Get(base::DIR_EXE, &master_prefs))
- return true;
- master_prefs =
- master_prefs.AppendASCII(installer_util::kDefaultMasterPrefs);
- }
+
+ // The standard location of the master prefs is next to the chrome exe.
+ FilePath master_prefs;
+ if (!PathService::Get(base::DIR_EXE, &master_prefs))
+ return true;
+ master_prefs = master_prefs.AppendASCII(installer_util::kDefaultMasterPrefs);
scoped_ptr<DictionaryValue> prefs(
installer_util::ParseDistributionPreferences(master_prefs));