| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/banners/app_banner_settings_helper.h" | 5 #include "chrome/browser/banners/app_banner_settings_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 AppBannerSettingsHelper::LanguageOption | 395 AppBannerSettingsHelper::LanguageOption |
| 396 AppBannerSettingsHelper::GetHomescreenLanguageOption() { | 396 AppBannerSettingsHelper::GetHomescreenLanguageOption() { |
| 397 std::string param = variations::GetVariationParamValue( | 397 std::string param = variations::GetVariationParamValue( |
| 398 kBannerParamsKey, kBannerParamsLanguageKey); | 398 kBannerParamsKey, kBannerParamsLanguageKey); |
| 399 unsigned int language_option = 0; | 399 unsigned int language_option = 0; |
| 400 | 400 |
| 401 if (param.empty() || !base::StringToUint(param, &language_option) || | 401 if (param.empty() || !base::StringToUint(param, &language_option) || |
| 402 language_option < LANGUAGE_OPTION_MIN || | 402 language_option < LANGUAGE_OPTION_MIN || |
| 403 language_option > LANGUAGE_OPTION_MAX) { | 403 language_option > LANGUAGE_OPTION_MAX) { |
| 404 return LANGUAGE_OPTION_DEFAULT; | 404 return LANGUAGE_OPTION_ADD; |
| 405 } | 405 } |
| 406 | 406 |
| 407 return static_cast<LanguageOption>(language_option); | 407 return static_cast<LanguageOption>(language_option); |
| 408 } | 408 } |
| OLD | NEW |