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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java

Issue 2815103004: Android: convert kEnumName to ENUM_NAME in java_cpp_enum.py. (Closed)
Patch Set: Address agrieve@ comments Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.content.Intent; 7 import android.content.Intent;
8 import android.content.pm.ApplicationInfo; 8 import android.content.pm.ApplicationInfo;
9 import android.content.pm.PackageManager; 9 import android.content.pm.PackageManager;
10 import android.content.res.Resources; 10 import android.content.res.Resources;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 return value.substring(0, value.length() - 1); 324 return value.substring(0, value.length() - 1);
325 } 325 }
326 326
327 /** 327 /**
328 * Returns the WebDisplayMode which matches {@link displayMode}. 328 * Returns the WebDisplayMode which matches {@link displayMode}.
329 * @param displayMode One of https://www.w3.org/TR/appmanifest/#dfn-display- modes-values 329 * @param displayMode One of https://www.w3.org/TR/appmanifest/#dfn-display- modes-values
330 * @return The matching WebDisplayMode. {@link WebDisplayMode#Undefined} if there is no match. 330 * @return The matching WebDisplayMode. {@link WebDisplayMode#Undefined} if there is no match.
331 */ 331 */
332 private static int displayModeFromString(String displayMode) { 332 private static int displayModeFromString(String displayMode) {
333 if (displayMode == null) { 333 if (displayMode == null) {
334 return WebDisplayMode.kUndefined; 334 return WebDisplayMode.UNDEFINED;
335 } 335 }
336 336
337 if (displayMode.equals("fullscreen")) { 337 if (displayMode.equals("fullscreen")) {
338 return WebDisplayMode.kFullscreen; 338 return WebDisplayMode.FULLSCREEN;
339 } else if (displayMode.equals("standalone")) { 339 } else if (displayMode.equals("standalone")) {
340 return WebDisplayMode.kStandalone; 340 return WebDisplayMode.STANDALONE;
341 } else if (displayMode.equals("minimal-ui")) { 341 } else if (displayMode.equals("minimal-ui")) {
342 return WebDisplayMode.kMinimalUi; 342 return WebDisplayMode.MINIMAL_UI;
343 } else if (displayMode.equals("browser")) { 343 } else if (displayMode.equals("browser")) {
344 return WebDisplayMode.kBrowser; 344 return WebDisplayMode.BROWSER;
345 } else { 345 } else {
346 return WebDisplayMode.kUndefined; 346 return WebDisplayMode.UNDEFINED;
347 } 347 }
348 } 348 }
349 349
350 /** 350 /**
351 * Returns the ScreenOrientationValue which matches {@link orientation}. 351 * Returns the ScreenOrientationValue which matches {@link orientation}.
352 * @param orientation One of https://w3c.github.io/screen-orientation/#orien tationlocktype-enum 352 * @param orientation One of https://w3c.github.io/screen-orientation/#orien tationlocktype-enum
353 * @return The matching ScreenOrientationValue. {@link ScreenOrientationValu es#DEFAULT} if there 353 * @return The matching ScreenOrientationValue. {@link ScreenOrientationValu es#DEFAULT} if there
354 * is no match. 354 * is no match.
355 */ 355 */
356 private static int orientationFromString(String orientation) { 356 private static int orientationFromString(String orientation) {
(...skipping 15 matching lines...) Expand all
372 return ScreenOrientationValues.PORTRAIT; 372 return ScreenOrientationValues.PORTRAIT;
373 } else if (orientation.equals("portrait-primary")) { 373 } else if (orientation.equals("portrait-primary")) {
374 return ScreenOrientationValues.PORTRAIT_PRIMARY; 374 return ScreenOrientationValues.PORTRAIT_PRIMARY;
375 } else if (orientation.equals("portrait-secondary")) { 375 } else if (orientation.equals("portrait-secondary")) {
376 return ScreenOrientationValues.PORTRAIT_SECONDARY; 376 return ScreenOrientationValues.PORTRAIT_SECONDARY;
377 } else { 377 } else {
378 return ScreenOrientationValues.DEFAULT; 378 return ScreenOrientationValues.DEFAULT;
379 } 379 }
380 } 380 }
381 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698