| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/installer/util/master_preferences.h" | 5 #include "chrome/installer/util/master_preferences.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/common/json_value_serializer.h" | 10 #include "chrome/common/json_value_serializer.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 const wchar_t* kDistroDict = L"distribution"; | 13 const wchar_t* kDistroDict = L"distribution"; |
| 14 | 14 } |
| 15 | |
| 16 } // namespace | |
| 17 | 15 |
| 18 namespace installer_util { | 16 namespace installer_util { |
| 19 namespace master_preferences { | 17 namespace master_preferences { |
| 20 const wchar_t kAltFirstRunBubble[] = L"oem_bubble"; | 18 const wchar_t kAltFirstRunBubble[] = L"oem_bubble"; |
| 21 const wchar_t kAltShortcutText[] = L"alternate_shortcut_text"; | 19 const wchar_t kAltShortcutText[] = L"alternate_shortcut_text"; |
| 22 const wchar_t kChromeShortcutIconIndex[] = L"chrome_shortcut_icon_index"; | 20 const wchar_t kChromeShortcutIconIndex[] = L"chrome_shortcut_icon_index"; |
| 23 const wchar_t kCreateAllShortcuts[] = L"create_all_shortcuts"; | 21 const wchar_t kCreateAllShortcuts[] = L"create_all_shortcuts"; |
| 24 const wchar_t kDistroImportBookmarksPref[] = L"import_bookmarks"; | 22 const wchar_t kDistroImportBookmarksPref[] = L"import_bookmarks"; |
| 25 const wchar_t kDistroImportHistoryPref[] = L"import_history"; | 23 const wchar_t kDistroImportHistoryPref[] = L"import_history"; |
| 26 const wchar_t kDistroImportHomePagePref[] = L"import_home_page"; | 24 const wchar_t kDistroImportHomePagePref[] = L"import_home_page"; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 107 } |
| 110 launch_tabs.push_back(tab_entry); | 108 launch_tabs.push_back(tab_entry); |
| 111 } | 109 } |
| 112 return launch_tabs; | 110 return launch_tabs; |
| 113 } | 111 } |
| 114 | 112 |
| 115 bool SetDistroBooleanPreference(DictionaryValue* prefs, | 113 bool SetDistroBooleanPreference(DictionaryValue* prefs, |
| 116 const std::wstring& name, | 114 const std::wstring& name, |
| 117 bool value) { | 115 bool value) { |
| 118 | 116 |
| 119 bool ret = false; | 117 if (!prefs || name.empty()) |
| 120 if (prefs && !name.empty()) { | 118 return false; |
| 121 std::wstring key(kDistroDict); | 119 prefs->SetBoolean(std::wstring(kDistroDict) + L"." + name, value); |
| 122 key.append(L"." + name); | 120 return true; |
| 123 if (prefs->SetBoolean(key, value)) | |
| 124 ret = true; | |
| 125 } | |
| 126 return ret; | |
| 127 } | 121 } |
| 128 | 122 |
| 129 } // installer_util | 123 } // installer_util |
| OLD | NEW |