Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java

Issue 1551743002: Add chrome://flags for update menu item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review, fix histograms test Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelperTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelperTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698