OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/localized_error.h" | 5 #include "chrome/common/localized_error.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 suggestion->GetInteger("type", &type); | 891 suggestion->GetInteger("type", &type); |
892 | 892 |
893 if (type == kGoogleCachedCopySuggestionType) { | 893 if (type == kGoogleCachedCopySuggestionType) { |
894 base::string16 cache_url; | 894 base::string16 cache_url; |
895 suggestion->GetString("urlCorrection", &cache_url); | 895 suggestion->GetString("urlCorrection", &cache_url); |
896 int cache_tracking_id = -1; | 896 int cache_tracking_id = -1; |
897 suggestion->GetInteger("trackingId", &cache_tracking_id); | 897 suggestion->GetInteger("trackingId", &cache_tracking_id); |
898 | 898 |
899 scoped_ptr<base::DictionaryValue> cache_button(new base::DictionaryValue); | 899 scoped_ptr<base::DictionaryValue> cache_button(new base::DictionaryValue); |
900 | 900 |
| 901 // Google cache copy button label experiment. |
901 if (field_trial_exp_type_ == kCachedCopyButtonExpTypeCopy) { | 902 if (field_trial_exp_type_ == kCachedCopyButtonExpTypeCopy) { |
902 cache_button->SetString( | 903 cache_button->SetString( |
903 "msg", | 904 "msg", |
904 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_CACHED_COPY)); | 905 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_CACHED_COPY)); |
| 906 cache_button->SetBoolean("defaultLabel", false); |
905 } else { | 907 } else { |
906 // Default to "Show cached page" button label. | 908 // Default to "Show cached page" button label. |
907 cache_button->SetString( | 909 cache_button->SetString( |
908 "msg", | 910 "msg", |
909 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_CACHED_PAGE)); | 911 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_CACHED_PAGE)); |
| 912 cache_button->SetBoolean("defaultLabel", true); |
910 } | 913 } |
911 cache_button->SetString("cacheUrl", cache_url); | 914 cache_button->SetString("cacheUrl", cache_url); |
912 cache_button->SetInteger("trackingId", cache_tracking_id); | 915 cache_button->SetInteger("trackingId", cache_tracking_id); |
913 error_strings->Set("cacheButton", cache_button.release()); | 916 error_strings->Set("cacheButton", cache_button.release()); |
914 | 917 |
915 // Remove the item from suggestions dictionary so that it does not get | 918 // Remove the item from suggestions dictionary so that it does not get |
916 // displayed by the template in the details section. | 919 // displayed by the template in the details section. |
917 suggestions->Remove(0, nullptr); | 920 suggestions->Remove(0, nullptr); |
918 } | 921 } |
919 } | 922 } |
920 } | 923 } |
OLD | NEW |