| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package org.chromium.chrome.browser.omaha; | 5 package org.chromium.chrome.browser.omaha; |
| 6 | 6 |
| 7 import android.content.ActivityNotFoundException; | 7 import android.content.ActivityNotFoundException; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 | 152 |
| 153 return updateAvailable(activity); | 153 return updateAvailable(activity); |
| 154 } | 154 } |
| 155 | 155 |
| 156 /** | 156 /** |
| 157 * @param context The current {@link Context}. | 157 * @param context The current {@link Context}. |
| 158 * @return The string to use for summary text or the empty string if no summ
ary should be shown. | 158 * @return The string to use for summary text or the empty string if no summ
ary should be shown. |
| 159 */ | 159 */ |
| 160 public String getMenuItemSummaryText(Context context) { | 160 public String getMenuItemSummaryText(Context context) { |
| 161 if (!getBooleanParam(SHOW_SUMMARY)) { | 161 if (!getBooleanParam(SHOW_SUMMARY) && !getBooleanParam(CUSTOM_SUMMARY))
{ |
| 162 return ""; | 162 return ""; |
| 163 } | 163 } |
| 164 | 164 |
| 165 String customSummary = getStringParamValue(CUSTOM_SUMMARY); | 165 String customSummary = getStringParamValue(CUSTOM_SUMMARY); |
| 166 if (!TextUtils.isEmpty(customSummary)) { | 166 if (!TextUtils.isEmpty(customSummary)) { |
| 167 return customSummary; | 167 return customSummary; |
| 168 } | 168 } |
| 169 | 169 |
| 170 return context.getResources().getString(R.string.menu_update_summary_def
ault); | 170 return context.getResources().getString(R.string.menu_update_summary_def
ault); |
| 171 } | 171 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 * @return The command-line flag value if present, or the param is value if
present. | 310 * @return The command-line flag value if present, or the param is value if
present. |
| 311 */ | 311 */ |
| 312 private static String getStringParamValue(String paramName) { | 312 private static String getStringParamValue(String paramName) { |
| 313 String value = CommandLine.getInstance().getSwitchValue(paramName); | 313 String value = CommandLine.getInstance().getSwitchValue(paramName); |
| 314 if (TextUtils.isEmpty(value)) { | 314 if (TextUtils.isEmpty(value)) { |
| 315 value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_
NAME, paramName); | 315 value = VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_
NAME, paramName); |
| 316 } | 316 } |
| 317 return value; | 317 return value; |
| 318 } | 318 } |
| 319 } | 319 } |
| OLD | NEW |