summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/first_run.cc7
-rw-r--r--chrome/installer/util/google_chrome_distribution_unittest.cc5
-rw-r--r--chrome/installer/util/master_preferences.cc10
-rw-r--r--chrome/installer/util/master_preferences.h34
4 files changed, 42 insertions, 14 deletions
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc
index e11b842..c402812 100644
--- a/chrome/browser/first_run.cc
+++ b/chrome/browser/first_run.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/importer/importer.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/shell_integration.h"
#include "chrome/browser/views/first_run_view.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
@@ -287,6 +288,8 @@ bool FirstRun::ProcessMasterPreferences(
import_items += SEARCH_ENGINES;
if (parse_result & installer_util::MASTER_PROFILE_IMPORT_HISTORY)
import_items += HISTORY;
+ if (parse_result & installer_util::MASTER_PROFILE_IMPORT_BOOKMARKS)
+ import_items += FAVORITES;
if (import_items) {
// There is something to import from the default browser. This launches
@@ -299,6 +302,10 @@ bool FirstRun::ProcessMasterPreferences(
}
}
+ if (parse_result &
+ installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER)
+ ShellIntegration::SetAsDefaultBrowser();
+
return false;
}
diff --git a/chrome/installer/util/google_chrome_distribution_unittest.cc b/chrome/installer/util/google_chrome_distribution_unittest.cc
index cca9e52..9339f0c 100644
--- a/chrome/installer/util/google_chrome_distribution_unittest.cc
+++ b/chrome/installer/util/google_chrome_distribution_unittest.cc
@@ -265,9 +265,11 @@ TEST(MasterPreferences, ParseDistroParams) {
" \"show_welcome_page\": true,\n"
" \"import_search_engine\": true,\n"
" \"import_history\": true,\n"
+ " \"import_bookmarks\": true,\n"
" \"create_all_shortcuts\": true,\n"
" \"do_not_launch_chrome\": true,\n"
" \"make_chrome_default\": true,\n"
+ " \"make_chrome_default_for_user\": true,\n"
" \"system_level\": true,\n"
" \"verbose_logging\": true,\n"
" \"require_eula\": true,\n"
@@ -286,9 +288,12 @@ TEST(MasterPreferences, ParseDistroParams) {
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SHOW_WELCOME);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_SEARCH_ENGINE);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_HISTORY);
+ EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_BOOKMARKS);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_CREATE_ALL_SHORTCUTS);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_DO_NOT_LAUNCH_CHROME);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT);
+ EXPECT_TRUE(result &
+ installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SYSTEM_LEVEL);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_VERBOSE_LOGGING);
EXPECT_TRUE(result & installer_util::MASTER_PROFILE_REQUIRE_EULA);
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 2e70120..22dbf08 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -39,8 +39,12 @@ const wchar_t kDistroSkipFirstRunPref[] = L"skip_first_run_ui";
const wchar_t kDistroShowWelcomePage[] = L"show_welcome_page";
// Boolean pref that triggers silent import of the default search engine.
const wchar_t kDistroImportSearchPref[] = L"import_search_engine";
-// Boolean pref that triggers silent import of the browse history.
+// Boolean pref that triggers silent import of the default browser history.
const wchar_t kDistroImportHistoryPref[] = L"import_history";
+// Boolean pref that triggers silent import of the default browser bookmarks.
+const wchar_t kDistroImportBookmarksPref[] = L"import_bookmarks";
+// Register Chrome as default browser for the current user.
+const wchar_t kMakeChromeDefaultForUser[] = L"make_chrome_default_for_user";
// The following boolean prefs have the same semantics as the corresponding
// setup command line switches. See chrome/installer/util/util_constants.cc
// for more info.
@@ -85,6 +89,10 @@ int ParseDistributionPreferences(const std::wstring& master_prefs_path) {
parse_result |= MASTER_PROFILE_IMPORT_SEARCH_ENGINE;
if (GetBooleanPref(distro, kDistroImportHistoryPref))
parse_result |= MASTER_PROFILE_IMPORT_HISTORY;
+ if (GetBooleanPref(distro, kDistroImportBookmarksPref))
+ parse_result |= MASTER_PROFILE_IMPORT_BOOKMARKS;
+ if (GetBooleanPref(distro, kMakeChromeDefaultForUser))
+ parse_result |= MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER;
if (GetBooleanPref(distro, kCreateAllShortcuts))
parse_result |= MASTER_PROFILE_CREATE_ALL_SHORTCUTS;
if (GetBooleanPref(distro, kDoNotLaunchChrome))
diff --git a/chrome/installer/util/master_preferences.h b/chrome/installer/util/master_preferences.h
index c07e3c7..13bee22 100644
--- a/chrome/installer/util/master_preferences.h
+++ b/chrome/installer/util/master_preferences.h
@@ -19,34 +19,40 @@ const wchar_t kDefaultMasterPrefs[] = L"master_preferences";
// These are the possible results of calling ParseDistributionPreferences.
// Some of the results can be combined, so they are bit flags.
enum MasterPrefResult {
- MASTER_PROFILE_NOT_FOUND = 0x1,
+ MASTER_PROFILE_NOT_FOUND = 0x1,
// A critical error processing the master profile.
- MASTER_PROFILE_ERROR = 0x1 << 1,
+ MASTER_PROFILE_ERROR = 0x1 << 1,
// Skip first run dialogs.
- MASTER_PROFILE_NO_FIRST_RUN_UI = 0x1 << 2,
+ MASTER_PROFILE_NO_FIRST_RUN_UI = 0x1 << 2,
// Show welcome page.
- MASTER_PROFILE_SHOW_WELCOME = 0x1 << 3,
+ MASTER_PROFILE_SHOW_WELCOME = 0x1 << 3,
// Import search engine setting from the default browser.
- MASTER_PROFILE_IMPORT_SEARCH_ENGINE = 0x1 << 4,
+ MASTER_PROFILE_IMPORT_SEARCH_ENGINE = 0x1 << 4,
// Import history from the default browser.
- MASTER_PROFILE_IMPORT_HISTORY = 0x1 << 5,
+ MASTER_PROFILE_IMPORT_HISTORY = 0x1 << 5,
+ // Import bookmarks from the default browser.
+ MASTER_PROFILE_IMPORT_BOOKMARKS = 0x1 << 6,
+ // Register Chrome as default browser for the current user. This option is
+ // different than MAKE_CHROME_DEFAULT as installer ignores this option and
+ // Chrome on first run makes itself default.
+ MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER = 0x1 << 7,
// The following boolean prefs have the same semantics as the corresponding
// setup command line switches. See chrome/installer/util/util_constants.cc
// for more info.
// Create Desktop and QuickLaunch shortcuts.
- MASTER_PROFILE_CREATE_ALL_SHORTCUTS = 0x1 << 6,
+ MASTER_PROFILE_CREATE_ALL_SHORTCUTS = 0x1 << 8,
// Prevent installer from launching Chrome after a successful first install.
- MASTER_PROFILE_DO_NOT_LAUNCH_CHROME = 0x1 << 7,
+ MASTER_PROFILE_DO_NOT_LAUNCH_CHROME = 0x1 << 9,
// Register Chrome as default browser on the system.
- MASTER_PROFILE_MAKE_CHROME_DEFAULT = 0x1 << 8,
+ MASTER_PROFILE_MAKE_CHROME_DEFAULT = 0x1 << 10,
// Install Chrome to system wise location.
- MASTER_PROFILE_SYSTEM_LEVEL = 0x1 << 9,
+ MASTER_PROFILE_SYSTEM_LEVEL = 0x1 << 11,
// Run installer in verbose mode.
- MASTER_PROFILE_VERBOSE_LOGGING = 0x1 << 10,
+ MASTER_PROFILE_VERBOSE_LOGGING = 0x1 << 12,
// Show the EULA and do not install if not accepted.
- MASTER_PROFILE_REQUIRE_EULA = 0x1 << 11,
+ MASTER_PROFILE_REQUIRE_EULA = 0x1 << 13,
// Use an alternate description text for some shortcuts.
- MASTER_PROFILE_ALT_SHORTCUT_TXT = 0x1 << 12
+ MASTER_PROFILE_ALT_SHORTCUT_TXT = 0x1 << 14
};
// The master preferences is a JSON file with the same entries as the
@@ -61,9 +67,11 @@ enum MasterPrefResult {
// "show_welcome_page": true,
// "import_search_engine": true,
// "import_history": false,
+// "import_bookmarks": false,
// "create_all_shortcuts": true,
// "do_not_launch_chrome": false,
// "make_chrome_default": false,
+// "make_chrome_default_for_user": true,
// "system_level": false,
// "verbose_logging": true,
// "require_eula": true,