OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/common/json_value_serializer.h" | 8 #include "chrome/common/json_value_serializer.h" |
9 #include "chrome/installer/util/master_preferences.h" | 9 #include "chrome/installer/util/master_preferences.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 namespace installer_util { | 32 namespace installer_util { |
33 // All the preferences below are expected to be inside the JSON "distribution" | 33 // All the preferences below are expected to be inside the JSON "distribution" |
34 // block. See master_preferences.h for an example. | 34 // block. See master_preferences.h for an example. |
35 | 35 |
36 // Boolean pref that triggers skipping the first run dialogs. | 36 // Boolean pref that triggers skipping the first run dialogs. |
37 const wchar_t kDistroSkipFirstRunPref[] = L"skip_first_run_ui"; | 37 const wchar_t kDistroSkipFirstRunPref[] = L"skip_first_run_ui"; |
38 // Boolean pref that triggers loading the welcome page. | 38 // Boolean pref that triggers loading the welcome page. |
39 const wchar_t kDistroShowWelcomePage[] = L"show_welcome_page"; | 39 const wchar_t kDistroShowWelcomePage[] = L"show_welcome_page"; |
40 // Boolean pref that triggers silent import of the default search engine. | 40 // Boolean pref that triggers silent import of the default search engine. |
41 const wchar_t kDistroImportSearchPref[] = L"import_search_engine"; | 41 const wchar_t kDistroImportSearchPref[] = L"import_search_engine"; |
42 // Boolean pref that triggers silent import of the browse history. | 42 // Boolean pref that triggers silent import of the default browser history. |
43 const wchar_t kDistroImportHistoryPref[] = L"import_history"; | 43 const wchar_t kDistroImportHistoryPref[] = L"import_history"; |
| 44 // Boolean pref that triggers silent import of the default browser bookmarks. |
| 45 const wchar_t kDistroImportBookmarksPref[] = L"import_bookmarks"; |
| 46 // Register Chrome as default browser for the current user. |
| 47 const wchar_t kMakeChromeDefaultForUser[] = L"make_chrome_default_for_user"; |
44 // The following boolean prefs have the same semantics as the corresponding | 48 // The following boolean prefs have the same semantics as the corresponding |
45 // setup command line switches. See chrome/installer/util/util_constants.cc | 49 // setup command line switches. See chrome/installer/util/util_constants.cc |
46 // for more info. | 50 // for more info. |
47 // Create Desktop and QuickLaunch shortcuts. | 51 // Create Desktop and QuickLaunch shortcuts. |
48 const wchar_t kCreateAllShortcuts[] = L"create_all_shortcuts"; | 52 const wchar_t kCreateAllShortcuts[] = L"create_all_shortcuts"; |
49 // Prevent installer from launching Chrome after a successful first install. | 53 // Prevent installer from launching Chrome after a successful first install. |
50 const wchar_t kDoNotLaunchChrome[] = L"do_not_launch_chrome"; | 54 const wchar_t kDoNotLaunchChrome[] = L"do_not_launch_chrome"; |
51 // Register Chrome as default browser on the system. | 55 // Register Chrome as default browser on the system. |
52 const wchar_t kMakeChromeDefault[] = L"make_chrome_default"; | 56 const wchar_t kMakeChromeDefault[] = L"make_chrome_default"; |
53 // Install Chrome to system wise location. | 57 // Install Chrome to system wise location. |
(...skipping 24 matching lines...) Expand all Loading... |
78 DictionaryValue* distro = NULL; | 82 DictionaryValue* distro = NULL; |
79 if (json_root->GetDictionary(L"distribution", &distro)) { | 83 if (json_root->GetDictionary(L"distribution", &distro)) { |
80 if (GetBooleanPref(distro, kDistroSkipFirstRunPref)) | 84 if (GetBooleanPref(distro, kDistroSkipFirstRunPref)) |
81 parse_result |= MASTER_PROFILE_NO_FIRST_RUN_UI; | 85 parse_result |= MASTER_PROFILE_NO_FIRST_RUN_UI; |
82 if (GetBooleanPref(distro, kDistroShowWelcomePage)) | 86 if (GetBooleanPref(distro, kDistroShowWelcomePage)) |
83 parse_result |= MASTER_PROFILE_SHOW_WELCOME; | 87 parse_result |= MASTER_PROFILE_SHOW_WELCOME; |
84 if (GetBooleanPref(distro, kDistroImportSearchPref)) | 88 if (GetBooleanPref(distro, kDistroImportSearchPref)) |
85 parse_result |= MASTER_PROFILE_IMPORT_SEARCH_ENGINE; | 89 parse_result |= MASTER_PROFILE_IMPORT_SEARCH_ENGINE; |
86 if (GetBooleanPref(distro, kDistroImportHistoryPref)) | 90 if (GetBooleanPref(distro, kDistroImportHistoryPref)) |
87 parse_result |= MASTER_PROFILE_IMPORT_HISTORY; | 91 parse_result |= MASTER_PROFILE_IMPORT_HISTORY; |
| 92 if (GetBooleanPref(distro, kDistroImportBookmarksPref)) |
| 93 parse_result |= MASTER_PROFILE_IMPORT_BOOKMARKS; |
| 94 if (GetBooleanPref(distro, kMakeChromeDefaultForUser)) |
| 95 parse_result |= MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER; |
88 if (GetBooleanPref(distro, kCreateAllShortcuts)) | 96 if (GetBooleanPref(distro, kCreateAllShortcuts)) |
89 parse_result |= MASTER_PROFILE_CREATE_ALL_SHORTCUTS; | 97 parse_result |= MASTER_PROFILE_CREATE_ALL_SHORTCUTS; |
90 if (GetBooleanPref(distro, kDoNotLaunchChrome)) | 98 if (GetBooleanPref(distro, kDoNotLaunchChrome)) |
91 parse_result |= MASTER_PROFILE_DO_NOT_LAUNCH_CHROME; | 99 parse_result |= MASTER_PROFILE_DO_NOT_LAUNCH_CHROME; |
92 if (GetBooleanPref(distro, kMakeChromeDefault)) | 100 if (GetBooleanPref(distro, kMakeChromeDefault)) |
93 parse_result |= MASTER_PROFILE_MAKE_CHROME_DEFAULT; | 101 parse_result |= MASTER_PROFILE_MAKE_CHROME_DEFAULT; |
94 if (GetBooleanPref(distro, kSystemLevel)) | 102 if (GetBooleanPref(distro, kSystemLevel)) |
95 parse_result |= MASTER_PROFILE_SYSTEM_LEVEL; | 103 parse_result |= MASTER_PROFILE_SYSTEM_LEVEL; |
96 if (GetBooleanPref(distro, kVerboseLogging)) | 104 if (GetBooleanPref(distro, kVerboseLogging)) |
97 parse_result |= MASTER_PROFILE_VERBOSE_LOGGING; | 105 parse_result |= MASTER_PROFILE_VERBOSE_LOGGING; |
98 if (GetBooleanPref(distro, kRequireEula)) | 106 if (GetBooleanPref(distro, kRequireEula)) |
99 parse_result |= MASTER_PROFILE_REQUIRE_EULA; | 107 parse_result |= MASTER_PROFILE_REQUIRE_EULA; |
100 if (GetBooleanPref(distro, kAltShortcutText)) | 108 if (GetBooleanPref(distro, kAltShortcutText)) |
101 parse_result |= MASTER_PROFILE_ALT_SHORTCUT_TXT; | 109 parse_result |= MASTER_PROFILE_ALT_SHORTCUT_TXT; |
102 } | 110 } |
103 return parse_result; | 111 return parse_result; |
104 } | 112 } |
105 | 113 |
106 } // installer_util | 114 } // installer_util |
OLD | NEW |