| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/eula_util.h" | 5 #include "chrome/installer/util/eula_util.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/installer/util/browser_distribution.h" | 9 #include "chrome/installer/util/browser_distribution.h" |
| 10 #include "chrome/installer/util/install_util.h" | 10 #include "chrome/installer/util/install_util.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 if (install_prefs && install_prefs->read_from_file()) | 34 if (install_prefs && install_prefs->read_from_file()) |
| 35 return install_prefs.Pass(); | 35 return install_prefs.Pass(); |
| 36 | 36 |
| 37 return scoped_ptr<MasterPreferences>(); | 37 return scoped_ptr<MasterPreferences>(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Attempts to initialize |state| with any Chrome-related product. | 40 // Attempts to initialize |state| with any Chrome-related product. |
| 41 // Returns true if any of these product are installed, otherwise false. | 41 // Returns true if any of these product are installed, otherwise false. |
| 42 bool GetAnyChromeProductState(bool system_level, ProductState* state) { | 42 bool GetAnyChromeProductState(bool system_level, ProductState* state) { |
| 43 return state->Initialize(system_level, BrowserDistribution::CHROME_BROWSER) | 43 return state->Initialize(system_level, BrowserDistribution::CHROME_BROWSER) |
| 44 || state->Initialize(system_level, BrowserDistribution::CHROME_FRAME) | 44 || state->Initialize(system_level, BrowserDistribution::CHROME_FRAME); |
| 45 || state->Initialize(system_level, BrowserDistribution::CHROME_APP_HOST); | |
| 46 } | 45 } |
| 47 | 46 |
| 48 } // namespace | 47 } // namespace |
| 49 | 48 |
| 50 EULAAcceptanceResponse IsEULAAccepted(bool system_level) { | 49 EULAAcceptanceResponse IsEULAAccepted(bool system_level) { |
| 51 ProductState prod_state; | 50 ProductState prod_state; |
| 52 | 51 |
| 53 if (!system_level) { // User-level case has seprate flow. | 52 if (!system_level) { // User-level case has seprate flow. |
| 54 // Do not simply check Chrome binaries. Instead, check whether or not | 53 // Do not simply check Chrome binaries. Instead, check whether or not |
| 55 // any Chrome-related products is installed, because the presence of any of | 54 // any Chrome-related products is installed, because the presence of any of |
| (...skipping 30 matching lines...) Expand all Loading... |
| 86 | 85 |
| 87 bool eula_required = false; | 86 bool eula_required = false; |
| 88 // If kRequireEula value is absent, assume EULA is not required. | 87 // If kRequireEula value is absent, assume EULA is not required. |
| 89 if (!install_prefs->GetBool(master_preferences::kRequireEula, &eula_required)) | 88 if (!install_prefs->GetBool(master_preferences::kRequireEula, &eula_required)) |
| 90 return QUERY_EULA_ACCEPTED; | 89 return QUERY_EULA_ACCEPTED; |
| 91 | 90 |
| 92 return eula_required ? QUERY_EULA_NOT_ACCEPTED : QUERY_EULA_ACCEPTED; | 91 return eula_required ? QUERY_EULA_NOT_ACCEPTED : QUERY_EULA_ACCEPTED; |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace installer | 94 } // namespace installer |
| OLD | NEW |