| 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 // This file declares util functions for setup project. | 5 // This file declares util functions for setup project. |
| 6 | 6 |
| 7 #include "chrome/installer/setup/setup_util.h" | 7 #include "chrome/installer/setup/setup_util.h" |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 prefs = installer_util::ParseDistributionPreferences(prefs_path); | 43 prefs = installer_util::ParseDistributionPreferences(prefs_path); |
| 44 } | 44 } |
| 45 | 45 |
| 46 if (!prefs) | 46 if (!prefs) |
| 47 prefs = new DictionaryValue(); | 47 prefs = new DictionaryValue(); |
| 48 | 48 |
| 49 if (cmd_line.HasSwitch(installer_util::switches::kCreateAllShortcuts)) | 49 if (cmd_line.HasSwitch(installer_util::switches::kCreateAllShortcuts)) |
| 50 installer_util::SetDistroBooleanPreference( | 50 installer_util::SetDistroBooleanPreference( |
| 51 prefs, installer_util::master_preferences::kCreateAllShortcuts, true); | 51 prefs, installer_util::master_preferences::kCreateAllShortcuts, true); |
| 52 | 52 |
| 53 if (cmd_line.HasSwitch(installer_util::switches::kDoNotCreateShortcuts)) |
| 54 installer_util::SetDistroBooleanPreference( |
| 55 prefs, installer_util::master_preferences::kDoNotCreateShortcuts, true); |
| 56 |
| 53 if (cmd_line.HasSwitch(installer_util::switches::kDoNotLaunchChrome)) | 57 if (cmd_line.HasSwitch(installer_util::switches::kDoNotLaunchChrome)) |
| 54 installer_util::SetDistroBooleanPreference( | 58 installer_util::SetDistroBooleanPreference( |
| 55 prefs, installer_util::master_preferences::kDoNotLaunchChrome, true); | 59 prefs, installer_util::master_preferences::kDoNotLaunchChrome, true); |
| 56 | 60 |
| 57 if (cmd_line.HasSwitch(installer_util::switches::kMakeChromeDefault)) | 61 if (cmd_line.HasSwitch(installer_util::switches::kMakeChromeDefault)) |
| 58 installer_util::SetDistroBooleanPreference( | 62 installer_util::SetDistroBooleanPreference( |
| 59 prefs, installer_util::master_preferences::kMakeChromeDefault, true); | 63 prefs, installer_util::master_preferences::kMakeChromeDefault, true); |
| 60 | 64 |
| 61 if (cmd_line.HasSwitch(installer_util::switches::kSystemLevel)) | 65 if (cmd_line.HasSwitch(installer_util::switches::kSystemLevel)) |
| 62 installer_util::SetDistroBooleanPreference( | 66 installer_util::SetDistroBooleanPreference( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 91 LOG(INFO) << "directory found: " << find_data.cFileName; | 95 LOG(INFO) << "directory found: " << find_data.cFileName; |
| 92 version = installer::Version::GetVersionFromString(find_data.cFileName); | 96 version = installer::Version::GetVersionFromString(find_data.cFileName); |
| 93 if (version) break; | 97 if (version) break; |
| 94 } | 98 } |
| 95 ret = FindNextFile(file_handle, &find_data); | 99 ret = FindNextFile(file_handle, &find_data); |
| 96 } | 100 } |
| 97 FindClose(file_handle); | 101 FindClose(file_handle); |
| 98 | 102 |
| 99 return version; | 103 return version; |
| 100 } | 104 } |
| OLD | NEW |