summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorgwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 21:43:02 +0000
committergwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 21:43:02 +0000
commit70e2e4a95a549e6b86443bd50454e76c195ebd6a (patch)
treed3b8a708af1eca2a348361985c4e6cc2a96ad2bb /chrome/installer
parent81583de915e51284854af2f03d3ede4ce1f8d149 (diff)
downloadchromium_src-70e2e4a95a549e6b86443bd50454e76c195ebd6a.zip
chromium_src-70e2e4a95a549e6b86443bd50454e76c195ebd6a.tar.gz
chromium_src-70e2e4a95a549e6b86443bd50454e76c195ebd6a.tar.bz2
Adds the ability to import the home page of the default browser. The import always existed, but was never hooked up to an installerdata preference.
R=cpu BUG=13752 TEST=Run the installer with a line in the distribution block of the installerdata that reads: "import_home_page" : true. The home page of the previous default browser should be imported. Review URL: http://codereview.chromium.org/118512 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18210 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/util/google_chrome_distribution_unittest.cc2
-rw-r--r--chrome/installer/util/master_preferences.cc5
-rw-r--r--chrome/installer/util/master_preferences.h5
3 files changed, 10 insertions, 2 deletions
diff --git a/chrome/installer/util/google_chrome_distribution_unittest.cc b/chrome/installer/util/google_chrome_distribution_unittest.cc
index 5e3a71e..e4bad05 100644
--- a/chrome/installer/util/google_chrome_distribution_unittest.cc
+++ b/chrome/installer/util/google_chrome_distribution_unittest.cc
@@ -266,6 +266,7 @@ TEST(MasterPreferences, ParseDistroParams) {
" \"import_search_engine\": true,\n"
" \"import_history\": true,\n"
" \"import_bookmarks\": true,\n"
+ " \"import_home_page\": true,\n"
" \"create_all_shortcuts\": true,\n"
" \"do_not_launch_chrome\": true,\n"
" \"make_chrome_default\": true,\n"
@@ -289,6 +290,7 @@ TEST(MasterPreferences, ParseDistroParams) {
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_IMPORT_HOME_PAGE);
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);
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 9e440af..c59bc1d 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -71,7 +71,8 @@ const wchar_t kRequireEula[] = L"require_eula";
const wchar_t kAltShortcutText[] = L"alternate_shortcut_text";
// Use alternate smaller first run info bubble.
const wchar_t kAltFirstRunBubble[] = L"oem_bubble";
-
+// Boolean pref that triggers silent import of the default browser homepage.
+const wchar_t kDistroImportHomePagePref[] = L"import_home_page";
int ParseDistributionPreferences(const std::wstring& master_prefs_path) {
if (!file_util::PathExists(master_prefs_path))
@@ -95,6 +96,8 @@ int ParseDistributionPreferences(const std::wstring& master_prefs_path) {
parse_result |= MASTER_PROFILE_IMPORT_HISTORY;
if (GetBooleanPref(distro, kDistroImportBookmarksPref))
parse_result |= MASTER_PROFILE_IMPORT_BOOKMARKS;
+ if (GetBooleanPref(distro, kDistroImportHomePagePref))
+ parse_result |= MASTER_PROFILE_IMPORT_HOME_PAGE;
if (GetBooleanPref(distro, kMakeChromeDefaultForUser))
parse_result |= MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER;
if (GetBooleanPref(distro, kCreateAllShortcuts))
diff --git a/chrome/installer/util/master_preferences.h b/chrome/installer/util/master_preferences.h
index 46513e9..c83464e 100644
--- a/chrome/installer/util/master_preferences.h
+++ b/chrome/installer/util/master_preferences.h
@@ -55,7 +55,9 @@ enum MasterPrefResult {
// Use an alternate description text for some shortcuts.
MASTER_PROFILE_ALT_SHORTCUT_TXT = 0x1 << 14,
// Use a smaller OEM info bubble on first run.
- MASTER_PROFILE_OEM_FIRST_RUN_BUBBLE = 0x1 << 15
+ MASTER_PROFILE_OEM_FIRST_RUN_BUBBLE = 0x1 << 15,
+ // Import home page from the default browser.
+ MASTER_PROFILE_IMPORT_HOME_PAGE = 0x1 << 16
};
// The master preferences is a JSON file with the same entries as the
@@ -71,6 +73,7 @@ enum MasterPrefResult {
// "import_search_engine": true,
// "import_history": false,
// "import_bookmarks": false,
+// "import_home_page": false,
// "create_all_shortcuts": true,
// "do_not_launch_chrome": false,
// "make_chrome_default": false,