diff options
author | aurimas <aurimas@chromium.org> | 2014-11-20 10:46:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-20 18:46:15 +0000 |
commit | cee75f0a7905c9e232900252142853a8b11d9701 (patch) | |
tree | 93d58fa0f6324b05e350ca4d81ba7063117dc1d8 | |
parent | 522a6a68af27cc55510c9d27b3407ff49143b9e3 (diff) | |
download | chromium_src-cee75f0a7905c9e232900252142853a8b11d9701.zip chromium_src-cee75f0a7905c9e232900252142853a8b11d9701.tar.gz chromium_src-cee75f0a7905c9e232900252142853a8b11d9701.tar.bz2 |
Fix a bunch of Java Checkstyle issues.
BUG=318404
TBR=samuong@chromium.org
Review URL: https://codereview.chromium.org/744453002
Cr-Commit-Position: refs/heads/master@{#305047}
80 files changed, 591 insertions, 607 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java b/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java index 168533b..b34b7fe 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java +++ b/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java @@ -190,7 +190,7 @@ public final class AwCookieManager { mHandler = handler; } - public static<T> CookieCallback<T> convert(ValueCallback<T> callback) throws + public static <T> CookieCallback<T> convert(ValueCallback<T> callback) throws IllegalStateException { if (callback == null) return null; if (Looper.myLooper() == null) { diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java index 2930d39..40cf038 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java @@ -207,19 +207,18 @@ public class AndroidViewIntegrationTest extends AwTestBase { private String makeHtmlPageOfSize(int widthCss, int heightCss, boolean heightPercent) { String content = "<div class=\"normal\">a</div>"; if (heightPercent) content += "<div class=\"heightPercent\"></div>"; - return CommonResources.makeHtmlPageFrom( - "<style type=\"text/css\">" + - "body { margin:0px; padding:0px; } " + - ".normal { " + - "width:" + widthCss + "px; " + - "height:" + heightCss + "px; " + - "background-color: red; " + - "} " + - ".heightPercent { " + - "height: 150%; " + - "background-color: blue; " + - "} " + - "</style>", content); + return CommonResources.makeHtmlPageFrom("<style type=\"text/css\">" + + " body { margin:0px; padding:0px; } " + + " .normal { " + + " width:" + widthCss + "px; " + + " height:" + heightCss + "px; " + + " background-color: red; " + + " } " + + " .heightPercent { " + + " height: 150%; " + + " background-color: blue; " + + " } " + + "</style>", content); } private void waitForContentSizeToChangeTo(OnContentSizeChangedHelper helper, int callCount, @@ -227,8 +226,8 @@ public class AndroidViewIntegrationTest extends AwTestBase { final int maxSizeChangeNotificationsToWaitFor = 5; for (int i = 1; i <= maxSizeChangeNotificationsToWaitFor; i++) { helper.waitForCallback(callCount, i); - if ((heightCss == -1 || helper.getHeight() == heightCss) && - (widthCss == -1 || helper.getWidth() == widthCss)) { + if ((heightCss == -1 || helper.getHeight() == heightCss) + && (widthCss == -1 || helper.getWidth() == widthCss)) { break; } // This means that we hit the max number of iterations but the expected contents size @@ -282,16 +281,15 @@ public class AndroidViewIntegrationTest extends AwTestBase { final int widthCss = 142; final int heightCss = 180; - final String htmlData = CommonResources.makeHtmlPageFrom( - "<style type=\"text/css\">" + - " body { margin:0px; padding:0px; } " + - " div { " + - " position: absolute; " + - " width:" + widthCss + "px; " + - " height:" + heightCss + "px; " + - " background-color: red; " + - " } " + - "</style>", "<div>a</div>"); + final String htmlData = CommonResources.makeHtmlPageFrom("<style type=\"text/css\">" + + " body { margin:0px; padding:0px; } " + + " div { " + + " position: absolute; " + + " width:" + widthCss + "px; " + + " height:" + heightCss + "px; " + + " background-color: red; " + + " } " + + "</style>", "<div>a</div>"); final int contentSizeChangeCallCount = mOnContentSizeChangedHelper.getCallCount(); loadDataAsync(testContainerView.getAwContents(), htmlData, "text/html", false); diff --git a/base/android/java/src/org/chromium/base/CommandLine.java b/base/android/java/src/org/chromium/base/CommandLine.java index b353ec4..406f36b 100644 --- a/base/android/java/src/org/chromium/base/CommandLine.java +++ b/base/android/java/src/org/chromium/base/CommandLine.java @@ -86,7 +86,7 @@ public abstract class CommandLine { } private static final AtomicReference<CommandLine> sCommandLine = - new AtomicReference<CommandLine>(); + new AtomicReference<CommandLine>(); /** * @returns true if the command line has already been initialized. @@ -149,8 +149,8 @@ public abstract class CommandLine { char currentQuote = noQuote; for (char c : buffer) { // Detect start or end of quote block. - if ((currentQuote == noQuote && (c == singleQuote || c == doubleQuote)) || - c == currentQuote) { + if ((currentQuote == noQuote && (c == singleQuote || c == doubleQuote)) + || c == currentQuote) { if (arg != null && arg.length() > 0 && arg.charAt(arg.length() - 1) == '\\') { // Last char was a backslash; pop it, and treat c as a literal. arg.setCharAt(arg.length() - 1, c); diff --git a/base/android/java/src/org/chromium/base/LocaleUtils.java b/base/android/java/src/org/chromium/base/LocaleUtils.java index 4f97d3a..82b2c8f 100644 --- a/base/android/java/src/org/chromium/base/LocaleUtils.java +++ b/base/android/java/src/org/chromium/base/LocaleUtils.java @@ -47,9 +47,9 @@ public class LocaleUtils { @CalledByNative private static String getDefaultCountryCode() { CommandLine commandLine = CommandLine.getInstance(); - return commandLine.hasSwitch(BaseSwitches.DEFAULT_COUNTRY_CODE_AT_INSTALL) ? - commandLine.getSwitchValue(BaseSwitches.DEFAULT_COUNTRY_CODE_AT_INSTALL) : - Locale.getDefault().getCountry(); + return commandLine.hasSwitch(BaseSwitches.DEFAULT_COUNTRY_CODE_AT_INSTALL) + ? commandLine.getSwitchValue(BaseSwitches.DEFAULT_COUNTRY_CODE_AT_INSTALL) + : Locale.getDefault().getCountry(); } } diff --git a/base/android/java/src/org/chromium/base/MemoryPressureListener.java b/base/android/java/src/org/chromium/base/MemoryPressureListener.java index 28d9651..e7c2030 100644 --- a/base/android/java/src/org/chromium/base/MemoryPressureListener.java +++ b/base/android/java/src/org/chromium/base/MemoryPressureListener.java @@ -86,8 +86,8 @@ public class MemoryPressureListener { public static void maybeNotifyMemoryPresure(int level) { if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) { nativeOnMemoryPressure(MemoryPressureLevel.CRITICAL); - } else if (level >= ComponentCallbacks2.TRIM_MEMORY_BACKGROUND || - level == ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { + } else if (level >= ComponentCallbacks2.TRIM_MEMORY_BACKGROUND + || level == ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { // Don't notifiy on TRIM_MEMORY_UI_HIDDEN, since this class only // dispatches actionable memory pressure signals to native. nativeOnMemoryPressure(MemoryPressureLevel.MODERATE); diff --git a/base/android/java/src/org/chromium/base/ObserverList.java b/base/android/java/src/org/chromium/base/ObserverList.java index c2bb902..e812b0d 100644 --- a/base/android/java/src/org/chromium/base/ObserverList.java +++ b/base/android/java/src/org/chromium/base/ObserverList.java @@ -204,8 +204,8 @@ public class ObserverList<E> implements Iterable<E> { @Override public boolean hasNext() { int lookupIndex = mIndex; - while (lookupIndex < mListEndMarker && - ObserverList.this.getObserverAt(lookupIndex) == null) { + while (lookupIndex < mListEndMarker + && ObserverList.this.getObserverAt(lookupIndex) == null) { lookupIndex++; } if (lookupIndex < mListEndMarker) return true; diff --git a/base/android/java/src/org/chromium/base/PathUtils.java b/base/android/java/src/org/chromium/base/PathUtils.java index b2c860f..d70c0cc 100644 --- a/base/android/java/src/org/chromium/base/PathUtils.java +++ b/base/android/java/src/org/chromium/base/PathUtils.java @@ -75,8 +75,8 @@ public abstract class PathUtils { @CalledByNative private static String getNativeLibraryDirectory(Context appContext) { ApplicationInfo ai = appContext.getApplicationInfo(); - if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 || - (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { + if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0 + || (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { return ai.nativeLibraryDir; } diff --git a/base/android/java/src/org/chromium/base/PowerMonitor.java b/base/android/java/src/org/chromium/base/PowerMonitor.java index 316d6cc..3d0ed48 100644 --- a/base/android/java/src/org/chromium/base/PowerMonitor.java +++ b/base/android/java/src/org/chromium/base/PowerMonitor.java @@ -31,11 +31,11 @@ public class PowerMonitor implements ApplicationStatus.ApplicationStateListener // would be too aggressive. An Android activity can be in the "paused" state quite often. This // can happen when a dialog window shows up for instance. private static final Runnable sSuspendTask = new Runnable() { - @Override - public void run() { - nativeOnMainActivitySuspended(); - } - }; + @Override + public void run() { + nativeOnMainActivitySuspended(); + } + }; public static void createForTests(Context context) { // Applications will create this once the JNI side has been fully wired up both sides. For @@ -71,8 +71,8 @@ public class PowerMonitor implements ApplicationStatus.ApplicationStateListener } int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); // If we're not plugged, assume we're running on battery power. - sInstance.mIsBatteryPower = chargePlug != BatteryManager.BATTERY_PLUGGED_USB && - chargePlug != BatteryManager.BATTERY_PLUGGED_AC; + sInstance.mIsBatteryPower = chargePlug != BatteryManager.BATTERY_PLUGGED_USB + && chargePlug != BatteryManager.BATTERY_PLUGGED_AC; nativeOnBatteryChargingChanged(); } diff --git a/base/android/java/src/org/chromium/base/ThreadUtils.java b/base/android/java/src/org/chromium/base/ThreadUtils.java index 8813a6c..2a8deeb 100644 --- a/base/android/java/src/org/chromium/base/ThreadUtils.java +++ b/base/android/java/src/org/chromium/base/ThreadUtils.java @@ -32,9 +32,9 @@ public class ThreadUtils { public static void setUiThread(Looper looper) { synchronized (sLock) { if (sUiThreadHandler != null && sUiThreadHandler.getLooper() != looper) { - throw new RuntimeException("UI thread looper is already set to " + - sUiThreadHandler.getLooper() + " (Main thread looper is " + - Looper.getMainLooper() + "), cannot set to new looper " + looper); + throw new RuntimeException("UI thread looper is already set to " + + sUiThreadHandler.getLooper() + " (Main thread looper is " + + Looper.getMainLooper() + "), cannot set to new looper " + looper); } else { sUiThreadHandler = new Handler(looper); } diff --git a/base/android/java/src/org/chromium/base/TraceEvent.java b/base/android/java/src/org/chromium/base/TraceEvent.java index b67d32d..1c7e534 100644 --- a/base/android/java/src/org/chromium/base/TraceEvent.java +++ b/base/android/java/src/org/chromium/base/TraceEvent.java @@ -158,8 +158,8 @@ public class TraceEvent { // Holder for monitor avoids unnecessary construction on non-debug runs private static final class LooperMonitorHolder { private static final BasicLooperMonitor sInstance = - CommandLine.getInstance().hasSwitch(BaseSwitches.ENABLE_IDLE_TRACING) ? - new IdleTracingLooperMonitor() : new BasicLooperMonitor(); + CommandLine.getInstance().hasSwitch(BaseSwitches.ENABLE_IDLE_TRACING) + ? new IdleTracingLooperMonitor() : new BasicLooperMonitor(); } diff --git a/base/android/javatests/src/org/chromium/base/CommandLineTest.java b/base/android/javatests/src/org/chromium/base/CommandLineTest.java index 4300467..2b1a967 100644 --- a/base/android/javatests/src/org/chromium/base/CommandLineTest.java +++ b/base/android/javatests/src/org/chromium/base/CommandLineTest.java @@ -113,8 +113,8 @@ public class CommandLineTest extends InstrumentationTestCase { toParse = " \t\n"; checkTokenizer(expected, toParse); - toParse = " \"a'b\" 'c\"d' \"e\\\"f\" 'g\\'h' \"i\\'j\" 'k\\\"l'" + - " m\"n\\'o\"p q'r\\\"s't"; + toParse = " \"a'b\" 'c\"d' \"e\\\"f\" 'g\\'h' \"i\\'j\" 'k\\\"l'" + + " m\"n\\'o\"p q'r\\\"s't"; expected = new String[] { "a'b", "c\"d", "e\"f", diff --git a/build/android/rezip/RezipApk.java b/build/android/rezip/RezipApk.java index fcb0703ac..b4285cd 100644 --- a/build/android/rezip/RezipApk.java +++ b/build/android/rezip/RezipApk.java @@ -39,8 +39,8 @@ class RezipApk { // Files matching this pattern are not copied to the output when adding alignment. // When reordering and verifying the APK they are copied to the end of the file. private static Pattern sMetaFilePattern = - Pattern.compile("^(META-INF/((.*)[.](SF|RSA|DSA)|com/android/otacert))|(" + - Pattern.quote(JarFile.MANIFEST_NAME) + ")$"); + Pattern.compile("^(META-INF/((.*)[.](SF|RSA|DSA)|com/android/otacert))|(" + + Pattern.quote(JarFile.MANIFEST_NAME) + ")$"); // Pattern for matching a shared library in the APK private static Pattern sLibraryPattern = Pattern.compile("^lib/[^/]*/lib.*[.]so$"); @@ -48,12 +48,11 @@ class RezipApk { private static Pattern sCrazyLinkerPattern = Pattern.compile("^lib/[^/]*/libchromium_android_linker.so$"); // Pattern for matching a crazy loaded shared library in the APK - private static Pattern sCrazyLibraryPattern = - Pattern.compile("^lib/[^/]*/crazy.lib.*[.]so$"); + private static Pattern sCrazyLibraryPattern = Pattern.compile("^lib/[^/]*/crazy.lib.*[.]so$"); private static boolean isLibraryFilename(String filename) { - return sLibraryPattern.matcher(filename).matches() && - !sCrazyLinkerPattern.matcher(filename).matches(); + return sLibraryPattern.matcher(filename).matches() + && !sCrazyLinkerPattern.matcher(filename).matches(); } private static boolean isCrazyLibraryFilename(String filename) { @@ -150,8 +149,7 @@ class RezipApk { if (entry.isDirectory()) { continue; } - if (omitMetaFiles && - sMetaFilePattern.matcher(entry.getName()).matches()) { + if (omitMetaFiles && sMetaFilePattern.matcher(entry.getName()).matches()) { continue; } entries.add(entry); @@ -394,16 +392,12 @@ class RezipApk { } private static void usage() { - System.err.println( - "Usage: prealignapk (addalignment|reorder) input.apk output.apk"); - System.err.println( - "\"crazy\" libraries are always inflated in the output"); + System.err.println("Usage: prealignapk (addalignment|reorder) input.apk output.apk"); + System.err.println("\"crazy\" libraries are always inflated in the output"); System.err.println( " renamealign - rename libraries with \"crazy.\" prefix and add alignment file"); - System.err.println( - " align - add alignment file"); - System.err.println( - " reorder - re-creates canonical ordering and checks alignment"); + System.err.println(" align - add alignment file"); + System.err.println(" reorder - re-creates canonical ordering and checks alignment"); System.exit(2); } diff --git a/build/android/tests/multiple_proguards/src/dummy/DummyActivity.java b/build/android/tests/multiple_proguards/src/dummy/DummyActivity.java index 72f20f4..e138acc 100644 --- a/build/android/tests/multiple_proguards/src/dummy/DummyActivity.java +++ b/build/android/tests/multiple_proguards/src/dummy/DummyActivity.java @@ -22,5 +22,5 @@ public class DummyActivity extends Activity { private static void doBadThings2() { sun.reflect.Reflection.getCallerClass(2); - } + } } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBrowserProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBrowserProvider.java index b2ea6c4..ff65ee6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBrowserProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBrowserProvider.java @@ -85,13 +85,13 @@ public class ChromeBrowserProvider extends ContentProvider { private static final String BROWSER_CONTRACT_HISTORY_CONTENT_ITEM_TYPE = "vnd.android.cursor.item/browser-history"; private static final String BROWSER_CONTRACT_BOOKMARK_CONTENT_TYPE = - "vnd.android.cursor.dir/bookmark"; + "vnd.android.cursor.dir/bookmark"; private static final String BROWSER_CONTRACT_BOOKMARK_CONTENT_ITEM_TYPE = - "vnd.android.cursor.item/bookmark"; + "vnd.android.cursor.item/bookmark"; private static final String BROWSER_CONTRACT_SEARCH_CONTENT_TYPE = - "vnd.android.cursor.dir/searches"; + "vnd.android.cursor.dir/searches"; private static final String BROWSER_CONTRACT_SEARCH_CONTENT_ITEM_TYPE = - "vnd.android.cursor.item/searches"; + "vnd.android.cursor.item/searches"; // This Authority is for internal interface. It's concatenated with // Context.getPackageName() so that we can install different channels @@ -863,17 +863,17 @@ public class ChromeBrowserProvider extends ContentProvider { * The existence of parent and children nodes is checked, but their contents are not. */ public boolean equalContents(BookmarkNode node) { - return node != null && - mId == node.mId && - !(mName == null ^ node.mName == null) && - (mName == null || mName.equals(node.mName)) && - !(mUrl == null ^ node.mUrl == null) && - (mUrl == null || mUrl.equals(node.mUrl)) && - mType == node.mType && - byteArrayEqual(mFavicon, node.mFavicon) && - byteArrayEqual(mThumbnail, node.mThumbnail) && - !(mParent == null ^ node.mParent == null) && - children().size() == node.children().size(); + return node != null + && mId == node.mId + && !(mName == null ^ node.mName == null) + && (mName == null || mName.equals(node.mName)) + && !(mUrl == null ^ node.mUrl == null) + && (mUrl == null || mUrl.equals(node.mUrl)) + && mType == node.mType + && byteArrayEqual(mFavicon, node.mFavicon) + && byteArrayEqual(mThumbnail, node.mThumbnail) + && !(mParent == null ^ node.mParent == null) + && children().size() == node.children().size(); } private static boolean byteArrayEqual(byte[] byte1, byte[] byte2) { @@ -1292,8 +1292,8 @@ public class ChromeBrowserProvider extends ContentProvider { // devices whose API level is less than API 17. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { UserHandle callingUserHandle = Binder.getCallingUserHandle(); - if (callingUserHandle != null && - !callingUserHandle.equals(android.os.Process.myUserHandle())) { + if (callingUserHandle != null + && !callingUserHandle.equals(android.os.Process.myUserHandle())) { ThreadUtils.postOnUiThread(new Runnable() { @Override public void run() { diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java index 7a3367b..4b18024 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java @@ -51,69 +51,69 @@ public class AutofillPopupTest extends ChromeShellTestBase { private static final String LANGUAGE_CODE = ""; private static final String ORIGIN = "https://www.example.com"; - private static final String BASIC_PAGE_DATA = UrlUtils.encodeHtmlDataUri( - "<html><head><meta name=\"viewport\"" + - "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + - "<body><form method=\"POST\">" + - "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\" /><br>" + - "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\" /><br>" + - "<textarea id=\"sa\" autocomplete=\"street-address\"></textarea><br>" + - "<input type=\"text\" id=\"a1\" autocomplete=\"address-line1\" /><br>" + - "<input type=\"text\" id=\"a2\" autocomplete=\"address-line2\" /><br>" + - "<input type=\"text\" id=\"ct\" autocomplete=\"locality\" /><br>" + - "<input type=\"text\" id=\"zc\" autocomplete=\"postal-code\" /><br>" + - "<input type=\"text\" id=\"em\" autocomplete=\"email\" /><br>" + - "<input type=\"text\" id=\"ph\" autocomplete=\"tel\" /><br>" + - "<input type=\"text\" id=\"fx\" autocomplete=\"fax\" /><br>" + - "<select id=\"co\" autocomplete=\"country\"><br>" + - "<option value=\"BR\">Brazil</option>" + - "<option value=\"US\">United States</option>" + - "</select>" + - "<input type=\"submit\" />" + - "</form></body></html>"); - - private static final String INITIATING_ELEMENT_FILLED = UrlUtils.encodeHtmlDataUri( - "<html><head><meta name=\"viewport\"" + - "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + - "<body><form method=\"POST\">" + - "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\" value=\"J\"><br>" + - "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\"><br>" + - "<input type=\"text\" id=\"em\" autocomplete=\"email\"><br>" + - "<select id=\"co\" autocomplete=\"country\"><br>" + - "<option value=\"US\">United States</option>" + - "<option value=\"BR\">Brazil</option>" + - "</select>" + - "<input type=\"submit\" />" + - "</form></body></html>"); - - private static final String ANOTHER_ELEMENT_FILLED = UrlUtils.encodeHtmlDataUri( - "<html><head><meta name=\"viewport\"" + - "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + - "<body><form method=\"POST\">" + - "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\"><br>" + - "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\"><br>" + - "<input type=\"text\" id=\"em\" autocomplete=\"email\" value=\"foo@example.com\"><br>" + - "<select id=\"co\" autocomplete=\"country\"><br>" + - "<option></option>" + - "<option value=\"BR\">Brazil</option>" + - "<option value=\"US\">United States</option>" + - "</select>" + - "<input type=\"submit\" />" + - "</form></body></html>"); - - private static final String INVALID_OPTION = UrlUtils.encodeHtmlDataUri( - "<html><head><meta name=\"viewport\"" + - "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + - "<body><form method=\"POST\">" + - "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\" value=\"J\"><br>" + - "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\"><br>" + - "<input type=\"text\" id=\"em\" autocomplete=\"email\"><br>" + - "<select id=\"co\" autocomplete=\"country\"><br>" + - "<option value=\"GB\">Great Britain</option>" + - "<option value=\"BR\">Brazil</option>" + - "</select>" + - "<input type=\"submit\" />" + - "</form></body></html>"); + private static final String BASIC_PAGE_DATA = UrlUtils.encodeHtmlDataUri("<html><head>" + + "<meta name=\"viewport\"" + + "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + + "<body><form method=\"POST\">" + + "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\" /><br>" + + "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\" /><br>" + + "<textarea id=\"sa\" autocomplete=\"street-address\"></textarea><br>" + + "<input type=\"text\" id=\"a1\" autocomplete=\"address-line1\" /><br>" + + "<input type=\"text\" id=\"a2\" autocomplete=\"address-line2\" /><br>" + + "<input type=\"text\" id=\"ct\" autocomplete=\"locality\" /><br>" + + "<input type=\"text\" id=\"zc\" autocomplete=\"postal-code\" /><br>" + + "<input type=\"text\" id=\"em\" autocomplete=\"email\" /><br>" + + "<input type=\"text\" id=\"ph\" autocomplete=\"tel\" /><br>" + + "<input type=\"text\" id=\"fx\" autocomplete=\"fax\" /><br>" + + "<select id=\"co\" autocomplete=\"country\"><br>" + + "<option value=\"BR\">Brazil</option>" + + "<option value=\"US\">United States</option>" + + "</select>" + + "<input type=\"submit\" />" + + "</form></body></html>"); + + private static final String INITIATING_ELEMENT_FILLED = UrlUtils.encodeHtmlDataUri("<html>" + + "<head><meta name=\"viewport\"" + + "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + + "<body><form method=\"POST\">" + + "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\" value=\"J\"><br>" + + "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\"><br>" + + "<input type=\"text\" id=\"em\" autocomplete=\"email\"><br>" + + "<select id=\"co\" autocomplete=\"country\"><br>" + + "<option value=\"US\">United States</option>" + + "<option value=\"BR\">Brazil</option>" + + "</select>" + + "<input type=\"submit\" />" + + "</form></body></html>"); + + private static final String ANOTHER_ELEMENT_FILLED = UrlUtils.encodeHtmlDataUri("<html><head>" + + "<meta name=\"viewport\"" + + "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + + "<body><form method=\"POST\">" + + "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\"><br>" + + "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\"><br>" + + "<input type=\"text\" id=\"em\" autocomplete=\"email\" value=\"foo@example.com\"><br>" + + "<select id=\"co\" autocomplete=\"country\"><br>" + + "<option></option>" + + "<option value=\"BR\">Brazil</option>" + + "<option value=\"US\">United States</option>" + + "</select>" + + "<input type=\"submit\" />" + + "</form></body></html>"); + + private static final String INVALID_OPTION = UrlUtils.encodeHtmlDataUri("<html><head>" + + "<meta name=\"viewport\"" + + "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + + "<body><form method=\"POST\">" + + "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\" value=\"J\"><br>" + + "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\"><br>" + + "<input type=\"text\" id=\"em\" autocomplete=\"email\"><br>" + + "<select id=\"co\" autocomplete=\"country\"><br>" + + "<option value=\"GB\">Great Britain</option>" + + "<option value=\"BR\">Brazil</option>" + + "</select>" + + "<input type=\"submit\" />" + + "</form></body></html>"); private AutofillTestHelper mHelper; private List<AutofillLogger.LogEntry> mAutofillLoggedEntries; @@ -344,8 +344,8 @@ public class AutofillPopupTest extends ChromeShellTestBase { private void assertLogged(String autofilledValue, String profileFullName) { for (AutofillLogger.LogEntry entry : mAutofillLoggedEntries) { - if (entry.getAutofilledValue().equals(autofilledValue) && - entry.getProfileFullName().equals(profileFullName)) { + if (entry.getAutofilledValue().equals(autofilledValue) + && entry.getProfileFullName().equals(profileFullName)) { return; } } diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java index 0ab072e..31b7b6e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java @@ -34,7 +34,7 @@ public class AutofillTestHelper { } List<AutofillProfile> getProfiles() throws ExecutionException { - return ThreadUtils.runOnUiThreadBlocking(new Callable<List<AutofillProfile> >() { + return ThreadUtils.runOnUiThreadBlocking(new Callable<List<AutofillProfile>>() { @Override public List<AutofillProfile> call() { return PersonalDataManager.getInstance().getProfiles(); diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/SuggestionAnswerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/SuggestionAnswerTest.java index cdff625..1996541 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/SuggestionAnswerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/SuggestionAnswerTest.java @@ -25,61 +25,56 @@ public class SuggestionAnswerTest extends TestCase { @SmallTest public void testOneLineReturnsNull() { - String json = - "{ 'l': [" + - " { 'il': { 't': [{ 't': 'text', 'tt': 8 }] } }, " + - "] }"; + String json = "{ 'l': [" + + " { 'il': { 't': [{ 't': 'text', 'tt': 8 }] } }, " + + "] }"; SuggestionAnswer answer = SuggestionAnswer.parseAnswerContents(json); assertNull(answer); } @SmallTest public void testTwoLinesDoesntReturnNull() { - String json = - "{ 'l': [" + - " { 'il': { 't': [{ 't': 'text', 'tt': 8 }] } }, " + - " { 'il': { 't': [{ 't': 'other text', 'tt': 5 }] } }" + - "] }"; + String json = "{ 'l': [" + + " { 'il': { 't': [{ 't': 'text', 'tt': 8 }] } }, " + + " { 'il': { 't': [{ 't': 'other text', 'tt': 5 }] } }" + + "] }"; SuggestionAnswer answer = SuggestionAnswer.parseAnswerContents(json); assertNotNull(answer); } @SmallTest public void testThreeLinesReturnsNull() { - String json = - "{ 'l': [" + - " { 'il': { 't': [{ 't': 'text', 'tt': 8 }] } }, " + - " { 'il': { 't': [{ 't': 'other text', 'tt': 5 }] } }" + - " { 'il': { 't': [{ 't': 'yet more text', 'tt': 13 }] } }" + - "] }"; + String json = "{ 'l': [" + + " { 'il': { 't': [{ 't': 'text', 'tt': 8 }] } }, " + + " { 'il': { 't': [{ 't': 'other text', 'tt': 5 }] } }" + + " { 'il': { 't': [{ 't': 'yet more text', 'tt': 13 }] } }" + + "] }"; SuggestionAnswer answer = SuggestionAnswer.parseAnswerContents(json); assertNull(answer); } @SmallTest public void testFiveLinesReturnsNull() { - String json = - "{ 'l': [" + - " { 'il': { 't': [{ 't': 'line 1', 'tt': 0 }] } }, " + - " { 'il': { 't': [{ 't': 'line 2', 'tt': 5 }] } }" + - " { 'il': { 't': [{ 't': 'line 3', 'tt': 13 }] } }" + - " { 'il': { 't': [{ 't': 'line 4', 'tt': 14 }] } }" + - " { 'il': { 't': [{ 't': 'line 5', 'tt': 5 }] } }" + - "] }"; + String json = "{ 'l': [" + + " { 'il': { 't': [{ 't': 'line 1', 'tt': 0 }] } }, " + + " { 'il': { 't': [{ 't': 'line 2', 'tt': 5 }] } }" + + " { 'il': { 't': [{ 't': 'line 3', 'tt': 13 }] } }" + + " { 'il': { 't': [{ 't': 'line 4', 'tt': 14 }] } }" + + " { 'il': { 't': [{ 't': 'line 5', 'tt': 5 }] } }" + + "] }"; SuggestionAnswer answer = SuggestionAnswer.parseAnswerContents(json); assertNull(answer); } @SmallTest public void testPropertyPresence() { - String json = - "{ 'l': [" + - " { 'il': { 't': [{ 't': 'text', 'tt': 8 }, { 't': 'moar', 'tt': 0 }], " + - " 'i': { 'd': 'http://example.com/foo.jpg' } } }, " + - " { 'il': { 't': [{ 't': 'other text', 'tt': 5 }], " + - " 'at': { 't': 'slatfotf', 'tt': 42 }, " + - " 'st': { 't': 'oh hi, Mark', 'tt': 7666 } } } " + - "] }"; + String json = "{ 'l': [" + + " { 'il': { 't': [{ 't': 'text', 'tt': 8 }, { 't': 'moar', 'tt': 0 }], " + + " 'i': { 'd': 'http://example.com/foo.jpg' } } }, " + + " { 'il': { 't': [{ 't': 'other text', 'tt': 5 }], " + + " 'at': { 't': 'slatfotf', 'tt': 42 }, " + + " 'st': { 't': 'oh hi, Mark', 'tt': 7666 } } } " + + "] }"; SuggestionAnswer answer = SuggestionAnswer.parseAnswerContents(json); SuggestionAnswer.ImageLine firstLine = answer.getFirstLine(); @@ -97,14 +92,13 @@ public class SuggestionAnswerTest extends TestCase { @SmallTest public void testContents() { - String json = - "{ 'l': [" + - " { 'il': { 't': [{ 't': 'text', 'tt': 8 }, { 't': 'moar', 'tt': 0 }], " + - " 'at': { 't': 'hi there', 'tt': 7 } } }, " + - " { 'il': { 't': [{ 't': 'ftw', 'tt': 6006 }], " + - " 'st': { 't': 'shop S-Mart', 'tt': 666 }, " + - " 'i': { 'd': 'Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGlj' } } } " + - "] }"; + String json = "{ 'l': [" + + " { 'il': { 't': [{ 't': 'text', 'tt': 8 }, { 't': 'moar', 'tt': 0 }], " + + " 'at': { 't': 'hi there', 'tt': 7 } } }, " + + " { 'il': { 't': [{ 't': 'ftw', 'tt': 6006 }], " + + " 'st': { 't': 'shop S-Mart', 'tt': 666 }, " + + " 'i': { 'd': 'Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGlj' } } } " + + "] }"; SuggestionAnswer answer = SuggestionAnswer.parseAnswerContents(json); SuggestionAnswer.ImageLine firstLine = answer.getFirstLine(); diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java index 9f743ce..c24133c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java @@ -64,8 +64,8 @@ public class FeatureUtilitiesTest extends InstrumentationTestCase { } @Override - public List<ResolveInfo>queryIntentActivities(Intent intent, int flags) { - List<ResolveInfo>resolveInfoList = new ArrayList<ResolveInfo>(); + public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) { + List<ResolveInfo> resolveInfoList = new ArrayList<ResolveInfo>(); if (intent.getAction().equals(mAction)) { // Add an entry to the returned list as the action diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java index cdd041a..3c039f3 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java @@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit; public final class ApplicationData { private static final long MAX_CLEAR_APP_DATA_TIMEOUT_MS = - scaleTimeout(TimeUnit.SECONDS.toMillis(3)); + scaleTimeout(TimeUnit.SECONDS.toMillis(3)); private static final long CLEAR_APP_DATA_POLL_INTERVAL_MS = MAX_CLEAR_APP_DATA_TIMEOUT_MS / 10; private ApplicationData() {} diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/InfoBarTestAnimationListener.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/InfoBarTestAnimationListener.java index bbdb83c..fe7dcb2 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/InfoBarTestAnimationListener.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/InfoBarTestAnimationListener.java @@ -53,7 +53,7 @@ public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAni } } } - } + } private ConditionalWait mAddAnimationFinished; private ConditionalWait mSwapAnimationFinished; @@ -79,8 +79,8 @@ public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAni mRemoveAnimationFinished.set(true); break; default: - throw new UnsupportedOperationException( - "Animation finished for unknown type " + animationType); + throw new UnsupportedOperationException( + "Animation finished for unknown type " + animationType); } } diff --git a/chrome/test/chromedriver/test/webview_shell/java/src/org/chromium/chromedriver_webview_shell/Main.java b/chrome/test/chromedriver/test/webview_shell/java/src/org/chromium/chromedriver_webview_shell/Main.java index f1283da..19ff6eb 100644 --- a/chrome/test/chromedriver/test/webview_shell/java/src/org/chromium/chromedriver_webview_shell/Main.java +++ b/chrome/test/chromedriver/test/webview_shell/java/src/org/chromium/chromedriver_webview_shell/Main.java @@ -35,14 +35,14 @@ public class Main extends Activity { public void onProgressChanged(WebView view, int progress) { activity.setProgress(progress * 100); } - }); + }); mWebView.setWebViewClient(new WebViewClient() { @Override public void onReceivedError(WebView view, int errorCode, String description, - String failingUrl) { + String failingUrl) { Toast.makeText(activity, "Error: " + description, Toast.LENGTH_SHORT).show(); - } - }); + } + }); loadUrl(getIntent()); } diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastApplication.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastApplication.java index 2fb50a3..6419d36 100644 --- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastApplication.java +++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastApplication.java @@ -49,6 +49,6 @@ public class CastApplication extends ContentApplication { } private static boolean allowCommandLineImport() { - return !Build.TYPE.equals("user"); + return !Build.TYPE.equals("user"); } } diff --git a/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java b/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java index f5fcae81..70c8723 100644 --- a/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java +++ b/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java @@ -167,8 +167,8 @@ public class ChildProcessService extends Service { isLoaded = true; } catch (ProcessInitException e) { if (requestedSharedRelro) { - Log.w(TAG, "Failed to load native library with shared RELRO, " + - "retrying without"); + Log.w(TAG, "Failed to load native library with shared RELRO, " + + "retrying without"); loadAtFixedAddressFailed = true; } else { Log.e(TAG, "Failed to load native library", e); diff --git a/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java b/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java index 411044d..d31c79d 100644 --- a/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java +++ b/content/public/android/java/src/org/chromium/content/app/ChromiumLinkerParams.java @@ -67,8 +67,8 @@ public class ChromiumLinkerParams { @Override public String toString() { return String.format( - "LinkerParams(baseLoadAddress:0x%x, waitForSharedRelro:%s, " + - "testRunnerClassName:%s", + "LinkerParams(baseLoadAddress:0x%x, waitForSharedRelro:%s, " + + "testRunnerClassName:%s", mBaseLoadAddress, mWaitForSharedRelro ? "true" : "false", mTestRunnerClassName); diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java b/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java index bd985d2..eb79f3e 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java @@ -51,8 +51,8 @@ public class ContentSettings { */ public boolean getJavaScriptEnabled() { ThreadUtils.assertOnUiThread(); - return mNativeContentSettings != 0 ? - nativeGetJavaScriptEnabled(mNativeContentSettings) : false; + return mNativeContentSettings != 0 + ? nativeGetJavaScriptEnabled(mNativeContentSettings) : false; } // Initialize the ContentSettings native side. diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java index d18b1df..790fea0 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java @@ -57,10 +57,9 @@ public class ContentViewClient { if (!shouldPropagateKey(keyCode)) return true; // We also have to intercept some shortcuts before we send them to the ContentView. - if (event.isCtrlPressed() && ( - keyCode == KeyEvent.KEYCODE_TAB || - keyCode == KeyEvent.KEYCODE_W || - keyCode == KeyEvent.KEYCODE_F4)) { + if (event.isCtrlPressed() && (keyCode == KeyEvent.KEYCODE_TAB + || keyCode == KeyEvent.KEYCODE_W + || keyCode == KeyEvent.KEYCODE_F4)) { return true; } @@ -193,18 +192,18 @@ public class ContentViewClient { * for instance, AKEYCODE_MEDIA_* will be dispatched to webkit*. */ public static boolean shouldPropagateKey(int keyCode) { - if (keyCode == KeyEvent.KEYCODE_MENU || - keyCode == KeyEvent.KEYCODE_HOME || - keyCode == KeyEvent.KEYCODE_BACK || - keyCode == KeyEvent.KEYCODE_CALL || - keyCode == KeyEvent.KEYCODE_ENDCALL || - keyCode == KeyEvent.KEYCODE_POWER || - keyCode == KeyEvent.KEYCODE_HEADSETHOOK || - keyCode == KeyEvent.KEYCODE_CAMERA || - keyCode == KeyEvent.KEYCODE_FOCUS || - keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || - keyCode == KeyEvent.KEYCODE_VOLUME_MUTE || - keyCode == KeyEvent.KEYCODE_VOLUME_UP) { + if (keyCode == KeyEvent.KEYCODE_MENU + || keyCode == KeyEvent.KEYCODE_HOME + || keyCode == KeyEvent.KEYCODE_BACK + || keyCode == KeyEvent.KEYCODE_CALL + || keyCode == KeyEvent.KEYCODE_ENDCALL + || keyCode == KeyEvent.KEYCODE_POWER + || keyCode == KeyEvent.KEYCODE_HEADSETHOOK + || keyCode == KeyEvent.KEYCODE_CAMERA + || keyCode == KeyEvent.KEYCODE_FOCUS + || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN + || keyCode == KeyEvent.KEYCODE_VOLUME_MUTE + || keyCode == KeyEvent.KEYCODE_VOLUME_UP) { return false; } return true; diff --git a/content/public/android/java/src/org/chromium/content/browser/LocationProviderFactory.java b/content/public/android/java/src/org/chromium/content/browser/LocationProviderFactory.java index c2c67e8..0d6d2dd 100644 --- a/content/public/android/java/src/org/chromium/content/browser/LocationProviderFactory.java +++ b/content/public/android/java/src/org/chromium/content/browser/LocationProviderFactory.java @@ -153,8 +153,8 @@ public class LocationProviderFactory { mLocationManager.requestLocationUpdates(0, 0, criteria, this, ThreadUtils.getUiThreadLooper()); } catch (SecurityException e) { - Log.e(TAG, "Caught security exception registering for location updates from " + - "system. This should only happen in DumpRenderTree."); + Log.e(TAG, "Caught security exception registering for location updates from " + + "system. This should only happen in DumpRenderTree."); } catch (IllegalArgumentException e) { Log.e(TAG, "Caught IllegalArgumentException registering for location updates."); } diff --git a/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java b/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java index de414e2..43427bd 100644 --- a/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java +++ b/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java @@ -272,9 +272,8 @@ class MediaResourceGetter { */ @VisibleForTesting boolean isNetworkReliable(Context context) { - if (context.checkCallingOrSelfPermission( - android.Manifest.permission.ACCESS_NETWORK_STATE) != - PackageManager.PERMISSION_GRANTED) { + if (context.checkCallingOrSelfPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) + != PackageManager.PERMISSION_GRANTED) { Log.w(TAG, "permission denied to access network state"); return false; } @@ -342,8 +341,8 @@ class MediaResourceGetter { */ @VisibleForTesting static boolean androidDeviceOk(final String model, final int sdkVersion) { - return !("GT-I9100".contentEquals(model) && - sdkVersion < android.os.Build.VERSION_CODES.JELLY_BEAN); + return !("GT-I9100".contentEquals(model) + && sdkVersion < android.os.Build.VERSION_CODES.JELLY_BEAN); } // The methods below can be used by unit tests to fake functionality. diff --git a/content/public/android/java/src/org/chromium/content/browser/PepperPluginManager.java b/content/public/android/java/src/org/chromium/content/browser/PepperPluginManager.java index 4db35fe..4062121 100644 --- a/content/public/android/java/src/org/chromium/content/browser/PepperPluginManager.java +++ b/content/public/android/java/src/org/chromium/content/browser/PepperPluginManager.java @@ -96,8 +96,8 @@ public class PepperPluginManager { for (ResolveInfo info : plugins) { // Retrieve the plugin's service information. ServiceInfo serviceInfo = info.serviceInfo; - if (serviceInfo == null || serviceInfo.metaData == null || - serviceInfo.packageName == null) { + if (serviceInfo == null || serviceInfo.metaData == null + || serviceInfo.packageName == null) { Log.e(LOGTAG, "Can't get service information from " + info); continue; } @@ -110,8 +110,8 @@ public class PepperPluginManager { Log.e(LOGTAG, "Can't find plugin: " + serviceInfo.packageName); continue; } - if (pkgInfo == null || - (pkgInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { + if (pkgInfo == null + || (pkgInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { continue; } Log.i(LOGTAG, "The given plugin package is preloaded: " + serviceInfo.packageName); diff --git a/content/public/android/java/src/org/chromium/content/browser/PopupZoomer.java b/content/public/android/java/src/org/chromium/content/browser/PopupZoomer.java index df6416c..fcfa3dc 100644 --- a/content/public/android/java/src/org/chromium/content/browser/PopupZoomer.java +++ b/content/public/android/java/src/org/chromium/content/browser/PopupZoomer.java @@ -430,8 +430,8 @@ class PopupZoomer extends View { canvas.save(); // Calculate the elapsed fraction of animation. - float time = (SystemClock.uptimeMillis() - mAnimationStartTime + mTimeLeft) / - ((float) ANIMATION_DURATION); + float time = (SystemClock.uptimeMillis() - mAnimationStartTime + mTimeLeft) + / ((float) ANIMATION_DURATION); time = constrain(time, 0, 1); if (time >= 1) { mAnimating = false; diff --git a/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationListener.java b/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationListener.java index 5fd123a..1398c84 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationListener.java +++ b/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationListener.java @@ -231,9 +231,9 @@ public class ScreenOrientationListener { } private ScreenOrientationListener() { - mBackend = Build.VERSION.SDK_INT >= 17 ? - new ScreenOrientationDisplayListener() : - new ScreenOrientationConfigurationListener(); + mBackend = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 + ? new ScreenOrientationDisplayListener() + : new ScreenOrientationConfigurationListener(); } /** diff --git a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java index 0c318b5..2f06f71 100644 --- a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java +++ b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java @@ -289,9 +289,8 @@ public class TracingControllerAndroid { categories = categories.replaceFirst( DEFAULT_CHROME_CATEGORIES_PLACE_HOLDER, nativeGetDefaultCategories()); } - String traceOptions = - intent.getStringExtra(RECORD_CONTINUOUSLY_EXTRA) == null ? - "record-until-full" : "record-continuously"; + String traceOptions = intent.getStringExtra(RECORD_CONTINUOUSLY_EXTRA) == null + ? "record-until-full" : "record-continuously"; String filename = intent.getStringExtra(FILE_EXTRA); if (filename != null) { startTracing(filename, true, categories, traceOptions); diff --git a/content/public/android/java/src/org/chromium/content/browser/VibrationProvider.java b/content/public/android/java/src/org/chromium/content/browser/VibrationProvider.java index 015d8d8..0b9da75 100644 --- a/content/public/android/java/src/org/chromium/content/browser/VibrationProvider.java +++ b/content/public/android/java/src/org/chromium/content/browser/VibrationProvider.java @@ -31,8 +31,8 @@ class VibrationProvider { @CalledByNative private void vibrate(long milliseconds) { - if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_SILENT && - mHasVibratePermission) { + if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_SILENT + && mHasVibratePermission) { mVibrator.vibrate(milliseconds); } } diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/JellyBeanAccessibilityInjector.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/JellyBeanAccessibilityInjector.java index c4b92d0..ba37b7b 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/JellyBeanAccessibilityInjector.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/JellyBeanAccessibilityInjector.java @@ -42,11 +42,11 @@ class JellyBeanAccessibilityInjector extends AccessibilityInjector { @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { - info.setMovementGranularities(AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER | - AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD | - AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE | - AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH | - AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE); + info.setMovementGranularities(AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER + | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD + | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE + | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH + | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE); info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); info.addAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT); @@ -57,11 +57,11 @@ class JellyBeanAccessibilityInjector extends AccessibilityInjector { @Override public boolean supportsAccessibilityAction(int action) { - if (action == AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY || - action == AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY || - action == AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT || - action == AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT || - action == AccessibilityNodeInfo.ACTION_CLICK) { + if (action == AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY + || action == AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY + || action == AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT + || action == AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT + || action == AccessibilityNodeInfo.ACTION_CLICK) { return true; } @@ -70,8 +70,8 @@ class JellyBeanAccessibilityInjector extends AccessibilityInjector { @Override public boolean performAccessibilityAction(int action, Bundle arguments) { - if (!accessibilityIsAvailable() || !mContentViewCore.isAlive() || - !mInjectedScriptEnabled || !mScriptInjected) { + if (!accessibilityIsAvailable() || !mContentViewCore.isAlive() + || !mInjectedScriptEnabled || !mScriptInjected) { return false; } @@ -126,13 +126,13 @@ class JellyBeanAccessibilityInjector extends AccessibilityInjector { try { mAccessibilityJSONObject.accumulate("action", action); if (arguments != null) { - if (action == AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY || - action == AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY) { + if (action == AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY || action + == AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY) { final int granularity = arguments.getInt( AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT); mAccessibilityJSONObject.accumulate("granularity", granularity); - } else if (action == AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT || - action == AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT) { + } else if (action == AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT + || action == AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT) { final String element = arguments.getString( AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING); mAccessibilityJSONObject.accumulate("element", element); @@ -149,16 +149,15 @@ class JellyBeanAccessibilityInjector extends AccessibilityInjector { } private static class CallbackHandler { - private static final String JAVASCRIPT_ACTION_TEMPLATE = - "(function() {" + - " retVal = false;" + - " try {" + - " retVal = %s;" + - " } catch (e) {" + - " retVal = false;" + - " }" + - " %s.onResult(%d, retVal);" + - "})()"; + private static final String JAVASCRIPT_ACTION_TEMPLATE = "(function() {" + + " retVal = false;" + + " try {" + + " retVal = %s;" + + " } catch (e) {" + + " retVal = false;" + + " }" + + " %s.onResult(%d, retVal);" + + "})()"; // Time in milliseconds to wait for a result before failing. private static final long RESULT_TIMEOUT = 5000; diff --git a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java index 1eafc6afd..19bcb89 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java @@ -75,8 +75,8 @@ public class AdapterInputConnection extends BaseInputConnection { if ((inputFlags & imeAdapter.sTextInputFlagAutocorrectOff) == 0) { outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; } - } else if (inputType == ImeAdapter.sTextInputTypeTextArea || - inputType == ImeAdapter.sTextInputTypeContentEditable) { + } else if (inputType == ImeAdapter.sTextInputTypeTextArea + || inputType == ImeAdapter.sTextInputTypeContentEditable) { // TextArea or contenteditable. outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE | EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES; @@ -197,10 +197,10 @@ public class AdapterInputConnection extends BaseInputConnection { int compositionStart = getComposingSpanStart(mEditable); int compositionEnd = getComposingSpanEnd(mEditable); // Avoid sending update if we sent an exact update already previously. - if (mLastUpdateSelectionStart == selectionStart && - mLastUpdateSelectionEnd == selectionEnd && - mLastUpdateCompositionStart == compositionStart && - mLastUpdateCompositionEnd == compositionEnd) { + if (mLastUpdateSelectionStart == selectionStart + && mLastUpdateSelectionEnd == selectionEnd + && mLastUpdateCompositionStart == compositionStart + && mLastUpdateCompositionEnd == compositionEnd) { return; } if (DEBUG) { diff --git a/content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java b/content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java index b97d1c3..70ec7f6 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java @@ -248,8 +248,8 @@ public class GamepadList { private static boolean isGamepadDevice(InputDevice inputDevice) { if (inputDevice == null) return false; - return ((inputDevice.getSources() & InputDevice.SOURCE_JOYSTICK) == - InputDevice.SOURCE_JOYSTICK); + return ((inputDevice.getSources() + & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK); } private GamepadDevice getGamepadForEvent(InputEvent event) { diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java index e075d8e..5b8e505 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java @@ -366,8 +366,8 @@ public class ImeAdapter { } for (int i = 0; i < events.length; ++i) { - if (events[i].getAction() == KeyEvent.ACTION_DOWN && - !KeyEvent.isModifierKey(events[i].getKeyCode())) { + if (events[i].getAction() == KeyEvent.ACTION_DOWN + && !KeyEvent.isModifierKey(events[i].getKeyCode())) { return events[i]; } } @@ -446,9 +446,9 @@ public class ImeAdapter { // composition below. if (keyCode > 0 && isCommit && mLastComposeText == null) { mLastSyntheticKeyCode = keyCode; - return translateAndSendNativeEvents(keyEvent) && - translateAndSendNativeEvents(KeyEvent.changeAction( - keyEvent, KeyEvent.ACTION_UP)); + return translateAndSendNativeEvents(keyEvent) + && translateAndSendNativeEvents( + KeyEvent.changeAction(keyEvent, KeyEvent.ACTION_UP)); } // When typing, there is no issue sending KeyDown and KeyUp events around the diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ClipboardTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ClipboardTest.java index 3a5cc90..6198b11 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ClipboardTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ClipboardTest.java @@ -27,8 +27,8 @@ import java.util.concurrent.Callable; */ public class ClipboardTest extends ContentShellTestBase { private static final String TEST_PAGE_DATA_URL = UrlUtils.encodeHtmlDataUri( - "<html><body>Hello, <a href=\"http://www.example.com/\">world</a>, how <b> " + - "Chromium</b> doing today?</body></html>"); + "<html><body>Hello, <a href=\"http://www.example.com/\">world</a>, how <b> " + + "Chromium</b> doing today?</body></html>"); private static final String EXPECTED_TEXT_RESULT = "Hello, world, how Chromium doing today?"; diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java index 176feee..6d72ad1 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java @@ -59,12 +59,12 @@ public class ContentViewPopupZoomerTest extends ContentShellTestBase { testUrl.append("<html><body>"); for (int i = 0; i < totalUrls; i++) { boolean isTargeted = i == targetIdAt; - testUrl.append("<a href=\"data:text/html;utf-8,<html><head><script>" + - "function doesItWork() { return 'yes'; }</script></head></html>\"" + - (isTargeted ? (" id=\"" + targetId + "\"") : "") + ">" + - "<small><sup>" + - (isTargeted ? "<b>" : "") + i + (isTargeted ? "</b>" : "") + - "</sup></small></a>"); + testUrl.append("<a href=\"data:text/html;utf-8,<html><head><script>" + + "function doesItWork() { return 'yes'; }</script></head></html>\"" + + (isTargeted ? (" id=\"" + targetId + "\"") : "") + ">" + + "<small><sup>" + + (isTargeted ? "<b>" : "") + i + (isTargeted ? "</b>" : "") + + "</sup></small></a>"); } testUrl.append("</small></div></body></html>"); return UrlUtils.encodeHtmlDataUri(testUrl.toString()); diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewReadbackTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewReadbackTest.java index 023eaa0..efed06e 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewReadbackTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewReadbackTest.java @@ -37,8 +37,8 @@ public class ContentViewReadbackTest extends ContentShellTestBase { protected void setUp() throws Exception { super.setUp(); launchContentShellWithUrl(UrlUtils.encodeHtmlDataUri( - "<html style=\"background: #00f;\"><head><style>body { height: 5000px; }</style>" + - "</head></html>")); + "<html style=\"background: #00f;\"><head><style>body { height: 5000px; }</style>" + + "</head></html>")); assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading()); } diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java index bece9a2..b76e81e 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java @@ -24,13 +24,12 @@ import org.chromium.content_shell_apk.ContentShellTestBase; */ public class ContentViewScrollingTest extends ContentShellTestBase { - private static final String LARGE_PAGE = UrlUtils.encodeHtmlDataUri( - "<html><head>" + - "<meta name=\"viewport\" content=\"width=device-width, " + - "initial-scale=2.0, maximum-scale=2.0\" />" + - "<style>body { width: 5000px; height: 5000px; }</style></head>" + - "<body>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</body>" + - "</html>"); + private static final String LARGE_PAGE = UrlUtils.encodeHtmlDataUri("<html><head>" + + "<meta name=\"viewport\" content=\"width=device-width, " + + "initial-scale=2.0, maximum-scale=2.0\" />" + + "<style>body { width: 5000px; height: 5000px; }</style></head>" + + "<body>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</body>" + + "</html>"); /** * InternalAccessDelegate to ensure AccessibilityEvent notifications (Eg:TYPE_VIEW_SCROLLED) @@ -108,12 +107,12 @@ public class ContentViewScrollingTest extends ContentShellTestBase { final int minThreshold = 5; final int maxThreshold = 100; - boolean xCorrect = hugLeft ? - getContentViewCore().getNativeScrollXForTest() < minThreshold : - getContentViewCore().getNativeScrollXForTest() > maxThreshold; - boolean yCorrect = hugTop ? - getContentViewCore().getNativeScrollYForTest() < minThreshold : - getContentViewCore().getNativeScrollYForTest() > maxThreshold; + boolean xCorrect = hugLeft + ? getContentViewCore().getNativeScrollXForTest() < minThreshold + : getContentViewCore().getNativeScrollXForTest() > maxThreshold; + boolean yCorrect = hugTop + ? getContentViewCore().getNativeScrollYForTest() < minThreshold + : getContentViewCore().getNativeScrollYForTest() > maxThreshold; return xCorrect && yCorrect; } })); diff --git a/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java b/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java index b78eabf..853c8a3 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java @@ -26,14 +26,13 @@ import java.util.concurrent.TimeUnit; */ public class GestureDetectorResetTest extends ContentShellTestBase { private static final long WAIT_TIMEOUT_SECONDS = scaleTimeout(2); - private static final String CLICK_TEST_URL = UrlUtils.encodeHtmlDataUri( - "<html><body>" + - "<button id=\"button\" " + - " onclick=\"document.getElementById('test').textContent = 'clicked';\">" + - "Button" + - "</button><br/>" + - "<div id=\"test\">not clicked</div><br/>" + - "</body></html>"); + private static final String CLICK_TEST_URL = UrlUtils.encodeHtmlDataUri("<html><body>" + + "<button id=\"button\" " + + " onclick=\"document.getElementById('test').textContent = 'clicked';\">" + + "Button" + + "</button><br/>" + + "<div id=\"test\">not clicked</div><br/>" + + "</body></html>"); private static class NodeContentsIsEqualToCriteria implements Criteria { private final ContentViewCore mViewCore; diff --git a/content/public/android/javatests/src/org/chromium/content/browser/InterstitialPageTest.java b/content/public/android/javatests/src/org/chromium/content/browser/InterstitialPageTest.java index 1c3b079..e339897 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/InterstitialPageTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/InterstitialPageTest.java @@ -88,21 +88,20 @@ public class InterstitialPageTest extends ContentShellTestBase { @Feature({"Navigation"}) public void testCloseInterstitial() throws InterruptedException, ExecutionException { final String proceedCommand = "PROCEED"; - final String htmlContent = - "<html>" + - "<head>" + - "<script>" + - "function sendCommand(command) {" + - "window.domAutomationController.setAutomationId(1);" + - "window.domAutomationController.send(command);" + - "}" + - "</script>" + - "</head>" + - "<body style='background-color:#FF0000' " + - "onclick='sendCommand(\"" + proceedCommand + "\");'>" + - "<h1>This is a scary interstitial page</h1>" + - "</body>" + - "</html>"; + final String htmlContent = "<html>" + + "<head>" + + " <script>" + + " function sendCommand(command) {" + + " window.domAutomationController.setAutomationId(1);" + + " window.domAutomationController.send(command);" + + " }" + + " </script>" + + "</head>" + + "<body style='background-color:#FF0000' " + + " onclick='sendCommand(\"" + proceedCommand + "\");'>" + + " <h1>This is a scary interstitial page</h1>" + + "</body>" + + "</html>"; final InterstitialPageDelegateAndroid delegate = new InterstitialPageDelegateAndroid(htmlContent) { @Override diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java index 3241d2f..d5cd46d 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java @@ -64,12 +64,11 @@ public class JavaBridgeChildFrameTest extends JavaBridgeTestBase { "<html><body><iframe></iframe></body></html>", "text/html", false); // In case there is anything wrong with the JS wrapper, an attempt // to look up its properties will result in an exception being thrown. - String script = - "(function(){ try {" + - " return typeof testController.setStringValue;" + - "} catch (e) {" + - " return e.toString();" + - "} })()"; + String script = "(function(){ try {" + + " return typeof testController.setStringValue;" + + "} catch (e) {" + + " return e.toString();" + + "} })()"; assertEquals("\"function\"", executeJavaScriptAndGetResult(getWebContents(), script)); // Make sure calling a method also works. @@ -86,15 +85,15 @@ public class JavaBridgeChildFrameTest extends JavaBridgeTestBase { // Test by setting a custom property on the parent page's injected // object and then checking that child frame doesn't see the property. loadDataSync(getWebContents().getNavigationController(), - "<html><head>" + - "<script>" + - " window.wProperty = 42;" + - " testController.tcProperty = 42;" + - " function queryProperties(w) {" + - " return w.wProperty + ' / ' + w.testController.tcProperty;" + - " }" + - "</script>" + - "</head><body><iframe></iframe></body></html>", "text/html", false); + "<html><head>" + + "<script>" + + " window.wProperty = 42;" + + " testController.tcProperty = 42;" + + " function queryProperties(w) {" + + " return w.wProperty + ' / ' + w.testController.tcProperty;" + + " }" + + "</script>" + + "</head><body><iframe></iframe></body></html>", "text/html", false); assertEquals("\"42 / 42\"", executeJavaScriptAndGetResult(getWebContents(), "queryProperties(window)")); assertEquals("\"undefined / undefined\"", diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java index 5c4a982..bc16a07 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java @@ -170,12 +170,12 @@ public class JavaBridgeCoercionTest extends JavaBridgeTestBase { // Note that this requires that we can pass a JavaScript boolean to Java. private void assertRaisesException(String script) throws Throwable { - executeJavaScript("try {" + - script + ";" + - " testController.setBooleanValue(false);" + - "} catch (exception) {" + - " testController.setBooleanValue(true);" + - "}"); + executeJavaScript("try {" + + script + ";" + + " testController.setBooleanValue(false);" + + "} catch (exception) {" + + " testController.setBooleanValue(true);" + + "}"); assertTrue(mTestController.waitForBooleanValue()); } diff --git a/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java b/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java index b2198654..71a22a4 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/MediaResourceGetterTest.java @@ -28,8 +28,8 @@ import java.util.Map; public class MediaResourceGetterTest extends InstrumentationTestCase { private static final String TEST_HTTP_URL = "http://example.com"; private static final String TEST_USER_AGENT = // Anything, really - "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 " + - "(KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36"; + "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 " + + "(KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36"; private static final String TEST_FILE_PATH = "/mnt/sdcard/test"; private static final String TEST_FILE_URL = "file://" + TEST_FILE_PATH; private static final String TEST_COOKIES = "yum yum yum!"; diff --git a/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java b/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java index 32886c2..32d8d24 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java @@ -105,9 +105,9 @@ public class NavigationTest extends ContentShellTestBase { @MediumTest @Feature({"Navigation"}) public void testPageReload() throws Throwable { - final String htmlLoadTime = "<html><head>" + - "<script type=\"text/javascript\">var loadTimestamp = new Date().getTime();" + - "function getLoadtime() { return loadTimestamp; }</script></head></html>"; + final String htmlLoadTime = "<html><head>" + + "<script type=\"text/javascript\">var loadTimestamp = new Date().getTime();" + + "function getLoadtime() { return loadTimestamp; }</script></head></html>"; final String urlLoadTime = UrlUtils.encodeHtmlDataUri(htmlLoadTime); ContentShellActivity activity = launchContentShellWithUrl(urlLoadTime); diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationProviderTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationProviderTest.java index 69355ce..75d3624 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationProviderTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationProviderTest.java @@ -41,8 +41,8 @@ public class ScreenOrientationProviderTest extends ContentShellTestBase { case ScreenOrientationValues.PORTRAIT_PRIMARY: return mObserver.mOrientation == 0; case ScreenOrientationValues.PORTRAIT_SECONDARY: - return mObserver.mOrientation == 180 || - (ALLOW_0_FOR_180 && mObserver.mOrientation == 0); + return mObserver.mOrientation == 180 + || (ALLOW_0_FOR_180 && mObserver.mOrientation == 0); case ScreenOrientationValues.LANDSCAPE_PRIMARY: return mObserver.mOrientation == 90; case ScreenOrientationValues.LANDSCAPE_SECONDARY: @@ -66,8 +66,8 @@ public class ScreenOrientationProviderTest extends ContentShellTestBase { case ScreenOrientationValues.LANDSCAPE_PRIMARY: return mObserver.mOrientation == 0; case ScreenOrientationValues.LANDSCAPE_SECONDARY: - return mObserver.mOrientation == 180 || - (ALLOW_0_FOR_180 && mObserver.mOrientation == 0); + return mObserver.mOrientation == 180 + || (ALLOW_0_FOR_180 && mObserver.mOrientation == 0); case ScreenOrientationValues.PORTRAIT: return mObserver.mOrientation == 90 || mObserver.mOrientation == -90; case ScreenOrientationValues.LANDSCAPE: @@ -184,18 +184,18 @@ public class ScreenOrientationProviderTest extends ContentShellTestBase { lockOrientationAndWait(ScreenOrientationValues.PORTRAIT_PRIMARY); assertTrue(checkOrientationForLock(ScreenOrientationValues.PORTRAIT_PRIMARY)); - lockOrientationAndWait(ScreenOrientationValues.PORTRAIT_PRIMARY | - ScreenOrientationValues.PORTRAIT_SECONDARY); - assertTrue(checkOrientationForLock(ScreenOrientationValues.PORTRAIT_PRIMARY | - ScreenOrientationValues.PORTRAIT_SECONDARY)); + lockOrientationAndWait(ScreenOrientationValues.PORTRAIT_PRIMARY + | ScreenOrientationValues.PORTRAIT_SECONDARY); + assertTrue(checkOrientationForLock(ScreenOrientationValues.PORTRAIT_PRIMARY + | ScreenOrientationValues.PORTRAIT_SECONDARY)); lockOrientationAndWait(ScreenOrientationValues.PORTRAIT_SECONDARY); assertTrue(checkOrientationForLock(ScreenOrientationValues.PORTRAIT_SECONDARY)); - lockOrientationAndWait(ScreenOrientationValues.PORTRAIT_PRIMARY | - ScreenOrientationValues.PORTRAIT_SECONDARY); - assertTrue(checkOrientationForLock(ScreenOrientationValues.PORTRAIT_PRIMARY | - ScreenOrientationValues.PORTRAIT_SECONDARY)); + lockOrientationAndWait(ScreenOrientationValues.PORTRAIT_PRIMARY + | ScreenOrientationValues.PORTRAIT_SECONDARY); + assertTrue(checkOrientationForLock(ScreenOrientationValues.PORTRAIT_PRIMARY + | ScreenOrientationValues.PORTRAIT_SECONDARY)); } @MediumTest @@ -204,18 +204,18 @@ public class ScreenOrientationProviderTest extends ContentShellTestBase { lockOrientationAndWait(ScreenOrientationValues.LANDSCAPE_PRIMARY); assertTrue(checkOrientationForLock(ScreenOrientationValues.LANDSCAPE_PRIMARY)); - lockOrientationAndWait(ScreenOrientationValues.LANDSCAPE_PRIMARY | - ScreenOrientationValues.LANDSCAPE_SECONDARY); - assertTrue(checkOrientationForLock(ScreenOrientationValues.LANDSCAPE_PRIMARY | - ScreenOrientationValues.LANDSCAPE_SECONDARY)); + lockOrientationAndWait(ScreenOrientationValues.LANDSCAPE_PRIMARY + | ScreenOrientationValues.LANDSCAPE_SECONDARY); + assertTrue(checkOrientationForLock(ScreenOrientationValues.LANDSCAPE_PRIMARY + | ScreenOrientationValues.LANDSCAPE_SECONDARY)); lockOrientationAndWait(ScreenOrientationValues.LANDSCAPE_SECONDARY); assertTrue(checkOrientationForLock(ScreenOrientationValues.LANDSCAPE_SECONDARY)); - lockOrientationAndWait(ScreenOrientationValues.LANDSCAPE_PRIMARY | - ScreenOrientationValues.LANDSCAPE_SECONDARY); - assertTrue(checkOrientationForLock(ScreenOrientationValues.LANDSCAPE_PRIMARY | - ScreenOrientationValues.LANDSCAPE_SECONDARY)); + lockOrientationAndWait(ScreenOrientationValues.LANDSCAPE_PRIMARY + | ScreenOrientationValues.LANDSCAPE_SECONDARY); + assertTrue(checkOrientationForLock(ScreenOrientationValues.LANDSCAPE_PRIMARY + | ScreenOrientationValues.LANDSCAPE_SECONDARY)); } // There is no point in testing the case where we try to lock to diff --git a/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java b/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java index 99c14c6..2601348 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java @@ -16,11 +16,10 @@ import org.chromium.content_shell_apk.ContentShellTestBase; * Integration tests for JavaScript execution. */ public class TestsJavaScriptEvalTest extends ContentShellTestBase { - private static final String JSTEST_URL = UrlUtils.encodeHtmlDataUri( - "<html><head><script>" + - " function foobar() { return 'foobar'; }" + - "</script></head>" + - "<body><button id=\"test\">Test button</button></body></html>"); + private static final String JSTEST_URL = UrlUtils.encodeHtmlDataUri("<html><head><script>" + + " function foobar() { return 'foobar'; }" + + "</script></head>" + + "<body><button id=\"test\">Test button</button></body></html>"); public TestsJavaScriptEvalTest() { } diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java index 30b879b..1d84ac6 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java @@ -39,14 +39,14 @@ import java.util.concurrent.Callable; public class ImeTest extends ContentShellTestBase { private static final String DATA_URL = UrlUtils.encodeHtmlDataUri( - "<html><head><meta name=\"viewport\"" + - "content=\"width=device-width, initial-scale=2.0, maximum-scale=2.0\" /></head>" + - "<body><form action=\"about:blank\">" + - "<input id=\"input_text\" type=\"text\" /><br/>" + - "<input id=\"input_radio\" type=\"radio\" style=\"width:50px;height:50px\" />" + - "<br/><textarea id=\"textarea\" rows=\"4\" cols=\"20\"></textarea>" + - "<br/><p><span id=\"plain_text\">This is Plain Text One</span></p>" + - "</form></body></html>"); + "<html><head><meta name=\"viewport\"" + + "content=\"width=device-width, initial-scale=2.0, maximum-scale=2.0\" /></head>" + + "<body><form action=\"about:blank\">" + + "<input id=\"input_text\" type=\"text\" /><br/>" + + "<input id=\"input_radio\" type=\"radio\" style=\"width:50px;height:50px\" />" + + "<br/><textarea id=\"textarea\" rows=\"4\" cols=\"20\"></textarea>" + + "<br/><p><span id=\"plain_text\">This is Plain Text One</span></p>" + + "</form></body></html>"); private TestAdapterInputConnection mConnection; private ImeAdapter mImeAdapter; @@ -731,8 +731,8 @@ public class ImeTest extends ContentShellTestBase { assertTrue(CriteriaHelper.pollForCriteria(new Criteria() { @Override public boolean isSatisfied() { - return show == getImeAdapter().mIsShowWithoutHideOutstanding && - (!show || getAdapterInputConnection() != null); + return show == getImeAdapter().mIsShowWithoutHideOutstanding + && (!show || getAdapterInputConnection() != null); } })); } diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/SelectPopupTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/SelectPopupTest.java index 469ae27..4142437 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/input/SelectPopupTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/SelectPopupTest.java @@ -26,19 +26,19 @@ import java.util.concurrent.TimeUnit; public class SelectPopupTest extends ContentShellTestBase { private static final long WAIT_TIMEOUT_SECONDS = scaleTimeout(2); private static final String SELECT_URL = UrlUtils.encodeHtmlDataUri( - "<html><head><meta name=\"viewport\"" + - "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + - "<body>Which animal is the strongest:<br/>" + - "<select id=\"select\">" + - "<option>Black bear</option>" + - "<option>Polar bear</option>" + - "<option>Grizzly</option>" + - "<option>Tiger</option>" + - "<option>Lion</option>" + - "<option>Gorilla</option>" + - "<option>Chipmunk</option>" + - "</select>" + - "</body></html>"); + "<html><head><meta name=\"viewport\"" + + "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" + + "<body>Which animal is the strongest:<br/>" + + "<select id=\"select\">" + + "<option>Black bear</option>" + + "<option>Polar bear</option>" + + "<option>Grizzly</option>" + + "<option>Tiger</option>" + + "<option>Lion</option>" + + "<option>Gorilla</option>" + + "<option>Chipmunk</option>" + + "</select>" + + "</body></html>"); private class PopupShowingCriteria implements Criteria { @Override diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/CallbackHelper.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/CallbackHelper.java index eb04563..e4aebf7 100644 --- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/CallbackHelper.java +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/CallbackHelper.java @@ -208,8 +208,8 @@ public class CallbackHelper { synchronized (mLock) { final long startTime = SystemClock.uptimeMillis(); boolean isSatisfied = criteria.isSatisfied(); - while (!isSatisfied && - SystemClock.uptimeMillis() - startTime < unit.toMillis(timeout)) { + while (!isSatisfied + && SystemClock.uptimeMillis() - startTime < unit.toMillis(timeout)) { mLock.wait(unit.toMillis(timeout)); isSatisfied = criteria.isSatisfied(); } diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java index 5f04de1..6c5e21a 100644 --- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java +++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java @@ -148,9 +148,9 @@ public class Shell extends LinearLayout { mUrlTextView.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null || - event.getKeyCode() != KeyEvent.KEYCODE_ENTER || - event.getAction() != KeyEvent.ACTION_DOWN)) { + if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null + || event.getKeyCode() != KeyEvent.KEYCODE_ENTER + || event.getAction() != KeyEvent.ACTION_DOWN)) { return false; } loadUrl(mUrlTextView.getText().toString()); diff --git a/content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java b/content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java index edf5efc..0ca4e49 100644 --- a/content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java +++ b/content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java @@ -38,8 +38,8 @@ public class LinkerTests implements Linker.TestRunner { checkSharedRelro = true; break; default: - Log.e(TAG, "Invalid shared RELRO linker configuration: " + - Linker.BROWSER_SHARED_RELRO_CONFIG); + Log.e(TAG, "Invalid shared RELRO linker configuration: " + + Linker.BROWSER_SHARED_RELRO_CONFIG); return false; } } else { diff --git a/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java b/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java index da43662..4a6f4ad 100644 --- a/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java +++ b/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java @@ -310,8 +310,8 @@ class AudioManagerAndroid { // The MODIFY_AUDIO_SETTINGS permission is required to allow an // application to modify global audio settings. if (!mHasModifyAudioSettingsPermission) { - Log.w(TAG, "MODIFY_AUDIO_SETTINGS is missing => client will run " + - "with reduced functionality"); + Log.w(TAG, "MODIFY_AUDIO_SETTINGS is missing => client will run " + + "with reduced functionality"); return; } @@ -460,8 +460,8 @@ class AudioManagerAndroid { if (runningOnJellyBeanMR1OrHigher()) { String sampleRateString = mAudioManager.getProperty( AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE); - return (sampleRateString == null ? - DEFAULT_SAMPLING_RATE : Integer.parseInt(sampleRateString)); + return sampleRateString == null + ? DEFAULT_SAMPLING_RATE : Integer.parseInt(sampleRateString); } else { return DEFAULT_SAMPLING_RATE; } @@ -517,8 +517,8 @@ class AudioManagerAndroid { private int getAudioLowLatencyOutputFrameSize() { String framesPerBuffer = mAudioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER); - return (framesPerBuffer == null ? - DEFAULT_FRAME_PER_BUFFER : Integer.parseInt(framesPerBuffer)); + return framesPerBuffer == null + ? DEFAULT_FRAME_PER_BUFFER : Integer.parseInt(framesPerBuffer); } @CalledByNative @@ -680,8 +680,8 @@ class AudioManagerAndroid { // headset and handsfree profile is connected. // TODO(henrika): it is possible that btAdapter.isEnabled() is // redundant. It might be sufficient to only check the profile state. - return btAdapter.isEnabled() && profileConnectionState == - android.bluetooth.BluetoothProfile.STATE_CONNECTED; + return btAdapter.isEnabled() + && profileConnectionState == android.bluetooth.BluetoothProfile.STATE_CONNECTED; } /** @@ -705,11 +705,11 @@ class AudioManagerAndroid { if (DEBUG) { int microphone = intent.getIntExtra("microphone", HAS_NO_MIC); String name = intent.getStringExtra("name"); - logd("BroadcastReceiver.onReceive: a=" + intent.getAction() + - ", s=" + state + - ", m=" + microphone + - ", n=" + name + - ", sb=" + isInitialStickyBroadcast()); + logd("BroadcastReceiver.onReceive: a=" + intent.getAction() + + ", s=" + state + + ", m=" + microphone + + ", n=" + name + + ", sb=" + isInitialStickyBroadcast()); } switch (state) { case STATE_UNPLUGGED: @@ -776,9 +776,9 @@ class AudioManagerAndroid { android.bluetooth.BluetoothHeadset.EXTRA_STATE, android.bluetooth.BluetoothHeadset.STATE_DISCONNECTED); if (DEBUG) { - logd("BroadcastReceiver.onReceive: a=" + intent.getAction() + - ", s=" + profileState + - ", sb=" + isInitialStickyBroadcast()); + logd("BroadcastReceiver.onReceive: a=" + intent.getAction() + + ", s=" + profileState + + ", sb=" + isInitialStickyBroadcast()); } switch (profileState) { @@ -842,9 +842,9 @@ class AudioManagerAndroid { AudioManager.EXTRA_SCO_AUDIO_STATE, AudioManager.SCO_AUDIO_STATE_DISCONNECTED); if (DEBUG) { - logd("BroadcastReceiver.onReceive: a=" + intent.getAction() + - ", s=" + state + - ", sb=" + isInitialStickyBroadcast()); + logd("BroadcastReceiver.onReceive: a=" + intent.getAction() + + ", s=" + state + + ", sb=" + isInitialStickyBroadcast()); } switch (state) { @@ -879,8 +879,8 @@ class AudioManagerAndroid { if (!mHasBluetoothPermission) { return; } - if (mBluetoothScoState == STATE_BLUETOOTH_SCO_ON || - mBluetoothScoState == STATE_BLUETOOTH_SCO_TURNING_ON) { + if (mBluetoothScoState == STATE_BLUETOOTH_SCO_ON + || mBluetoothScoState == STATE_BLUETOOTH_SCO_TURNING_ON) { // Unable to turn on BT in this state. return; } @@ -902,8 +902,8 @@ class AudioManagerAndroid { if (!mHasBluetoothPermission) { return; } - if (mBluetoothScoState != STATE_BLUETOOTH_SCO_ON && - mBluetoothScoState != STATE_BLUETOOTH_SCO_TURNING_ON) { + if (mBluetoothScoState != STATE_BLUETOOTH_SCO_ON + && mBluetoothScoState != STATE_BLUETOOTH_SCO_TURNING_ON) { // No need to turn off BT in this state. return; } @@ -1010,8 +1010,7 @@ class AudioManagerAndroid { private static int getNumOfAudioDevices(boolean[] devices) { int count = 0; for (int i = 0; i < DEVICE_COUNT; ++i) { - if (devices[i]) - ++count; + if (devices[i]) ++count; } return count; } @@ -1030,24 +1029,24 @@ class AudioManagerAndroid { devices.add(DEVICE_NAMES[i]); } if (DEBUG) { - logd("reportUpdate: requested=" + mRequestedAudioDevice + - ", btSco=" + mBluetoothScoState + - ", devices=" + devices); + logd("reportUpdate: requested=" + mRequestedAudioDevice + + ", btSco=" + mBluetoothScoState + + ", devices=" + devices); } } } /** Information about the current build, taken from system properties. */ private void logDeviceInfo() { - logd("Android SDK: " + Build.VERSION.SDK_INT + ", " + - "Release: " + Build.VERSION.RELEASE + ", " + - "Brand: " + Build.BRAND + ", " + - "Device: " + Build.DEVICE + ", " + - "Id: " + Build.ID + ", " + - "Hardware: " + Build.HARDWARE + ", " + - "Manufacturer: " + Build.MANUFACTURER + ", " + - "Model: " + Build.MODEL + ", " + - "Product: " + Build.PRODUCT); + logd("Android SDK: " + Build.VERSION.SDK_INT + ", " + + "Release: " + Build.VERSION.RELEASE + ", " + + "Brand: " + Build.BRAND + ", " + + "Device: " + Build.DEVICE + ", " + + "Id: " + Build.ID + ", " + + "Hardware: " + Build.HARDWARE + ", " + + "Manufacturer: " + Build.MANUFACTURER + ", " + + "Model: " + Build.MODEL + ", " + + "Product: " + Build.PRODUCT); } /** Trivial helper method for debug logging */ diff --git a/media/base/android/java/src/org/chromium/media/AudioRecordInput.java b/media/base/android/java/src/org/chromium/media/AudioRecordInput.java index 0a26b2e..65f0689 100644 --- a/media/base/android/java/src/org/chromium/media/AudioRecordInput.java +++ b/media/base/android/java/src/org/chromium/media/AudioRecordInput.java @@ -190,10 +190,10 @@ class AudioRecordInput { if (DEBUG) { Descriptor descriptor = mAEC.getDescriptor(); - Log.d(TAG, "AcousticEchoCanceler " + - "name: " + descriptor.name + ", " + - "implementor: " + descriptor.implementor + ", " + - "uuid: " + descriptor.uuid); + Log.d(TAG, "AcousticEchoCanceler " + + "name: " + descriptor.name + ", " + + "implementor: " + descriptor.implementor + ", " + + "uuid: " + descriptor.uuid); } } return true; diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java index 399f355..11cff4b 100644 --- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java @@ -227,8 +227,8 @@ class MediaCodecBridge { codecName = mediaCodec.getName(); mediaCodec.release(); } catch (Exception e) { - Log.w(TAG, "getDefaultCodecName: Failed to create MediaCodec: " + - mime + ", direction: " + direction, e); + Log.w(TAG, "getDefaultCodecName: Failed to create MediaCodec: " + + mime + ", direction: " + direction, e); } } return codecName; @@ -688,8 +688,8 @@ class MediaCodecBridge { } int size = mAudioTrack.write(buf, 0, buf.length); if (buf.length != size) { - Log.i(TAG, "Failed to send all data to audio output, expected size: " + - buf.length + ", actual size: " + size); + Log.i(TAG, "Failed to send all data to audio output, expected size: " + + buf.length + ", actual size: " + size); } // TODO(qinmin): Returning the head position allows us to estimate // the current presentation time in native code. However, it is diff --git a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java index 73cc124..3492867 100644 --- a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java @@ -304,8 +304,8 @@ public class MediaDrmBridge { if (Build.VERSION.RELEASE.equals("4.4")) { singleSessionMode = true; } - Log.d(TAG, "MediaDrmBridge uses " + - (singleSessionMode ? "single" : "multiple") + "-session mode."); + Log.d(TAG, "MediaDrmBridge uses " + + (singleSessionMode ? "single" : "multiple") + "-session mode."); MediaDrmBridge mediaDrmBridge = null; try { @@ -451,8 +451,8 @@ public class MediaDrmBridge { // Check mMediaDrm != null because error may happen in createSession(). // Check !mProvisioningPending because NotProvisionedException may be // thrown in createSession(). - while (mMediaDrm != null && !mProvisioningPending && - !mPendingCreateSessionDataQueue.isEmpty()) { + while (mMediaDrm != null && !mProvisioningPending + && !mPendingCreateSessionDataQueue.isEmpty()) { PendingCreateSessionData pendingData = mPendingCreateSessionDataQueue.poll(); int sessionId = pendingData.sessionId(); byte[] initData = pendingData.initData(); @@ -509,8 +509,8 @@ public class MediaDrmBridge { if (mSingleSessionMode) { session = mMediaCryptoSession; - if (mSessionMimeTypes.get(session) != null && - !mSessionMimeTypes.get(session).equals(mime)) { + if (mSessionMimeTypes.get(session) != null + && !mSessionMimeTypes.get(session).equals(mime)) { Log.e(TAG, "Only one mime type is supported in single session mode."); onSessionError(sessionId); return; @@ -539,8 +539,8 @@ public class MediaDrmBridge { onSessionCreated(sessionId, getWebSessionId(session)); onSessionMessage(sessionId, request); if (newSessionOpened) { - Log.d(TAG, "createSession(): Session " + getWebSessionId(session) + - " (" + sessionId + ") created."); + Log.d(TAG, "createSession(): Session " + getWebSessionId(session) + + " (" + sessionId + ") created."); } mSessionIds.put(session, sessionId); diff --git a/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java b/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java index 6b4e80a..f0bc654 100644 --- a/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java @@ -195,7 +195,7 @@ public class MediaPlayerBridge { return true; } - private class LoadDataUriTask extends AsyncTask <Void, Void, Boolean> { + private class LoadDataUriTask extends AsyncTask<Void, Void, Boolean> { private final String mData; private final Context mContext; private File mTempFile; diff --git a/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java b/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java index 1dbffa8..47bd01a 100644 --- a/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java +++ b/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java @@ -103,8 +103,8 @@ class MediaPlayerListener implements MediaPlayer.OnPreparedListener, @Override public void onAudioFocusChange(int focusChange) { - if (focusChange == AudioManager.AUDIOFOCUS_LOSS || - focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT) { + if (focusChange == AudioManager.AUDIOFOCUS_LOSS + || focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT) { nativeOnMediaInterrupted(mNativeMediaPlayerListener); } } diff --git a/media/base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java b/media/base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java index b6cefcc..60b73c5 100644 --- a/media/base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java +++ b/media/base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java @@ -94,8 +94,8 @@ class UsbMidiDeviceFactoryAndroid { boolean found = false; for (int i = 0; i < device.getInterfaceCount() && !found; ++i) { UsbInterface iface = device.getInterface(i); - if (iface.getInterfaceClass() == UsbConstants.USB_CLASS_AUDIO && - iface.getInterfaceSubclass() == UsbMidiDeviceAndroid.MIDI_SUBCLASS) { + if (iface.getInterfaceClass() == UsbConstants.USB_CLASS_AUDIO + && iface.getInterfaceSubclass() == UsbMidiDeviceAndroid.MIDI_SUBCLASS) { found = true; } } diff --git a/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java b/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java index 15433de..8297c819 100644 --- a/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java +++ b/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java @@ -40,8 +40,8 @@ class VideoCaptureFactory { private static boolean isSpecialDevice() { for (String[] device : SPECIAL_DEVICE_LIST) { - if (device[0].contentEquals(android.os.Build.MODEL) && - device[1].contentEquals(android.os.Build.DEVICE)) { + if (device[0].contentEquals(android.os.Build.MODEL) + && device[1].contentEquals(android.os.Build.DEVICE)) { return true; } } @@ -64,8 +64,8 @@ class VideoCaptureFactory { // to use a camera, but "load page" requires it. So, output a warning log // and carry on pretending the system has no camera(s). if (sNumberOfSystemCameras == -1) { - if (PackageManager.PERMISSION_GRANTED == - appContext.getPackageManager().checkPermission( + if (PackageManager.PERMISSION_GRANTED + == appContext.getPackageManager().checkPermission( "android.permission.CAMERA", appContext.getPackageName())) { sNumberOfSystemCameras = VideoCaptureAndroid.getNumberOfCameras(); } else { @@ -102,17 +102,17 @@ class VideoCaptureFactory { @CalledByNative static String getDeviceName(int id) { - return (ChromiumCameraInfo.isSpecialCamera(id)) ? - VideoCaptureTango.getName(ChromiumCameraInfo.toSpecialCameraId(id)) : - VideoCaptureAndroid.getName(id); + return (ChromiumCameraInfo.isSpecialCamera(id)) + ? VideoCaptureTango.getName(ChromiumCameraInfo.toSpecialCameraId(id)) + : VideoCaptureAndroid.getName(id); } @CalledByNative static VideoCapture.CaptureFormat[] getDeviceSupportedFormats(int id) { - return ChromiumCameraInfo.isSpecialCamera(id) ? - VideoCaptureTango.getDeviceSupportedFormats( - ChromiumCameraInfo.toSpecialCameraId(id)) : - VideoCaptureAndroid.getDeviceSupportedFormats(id); + return ChromiumCameraInfo.isSpecialCamera(id) + ? VideoCaptureTango.getDeviceSupportedFormats( + ChromiumCameraInfo.toSpecialCameraId(id)) + : VideoCaptureAndroid.getDeviceSupportedFormats(id); } @CalledByNative diff --git a/media/base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java index 0bf9d67..128cee0 100644 --- a/media/base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java +++ b/media/base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java @@ -155,10 +155,10 @@ class WebAudioMediaCodecBridge { // catch any changes in format. But be sure to // initialize it BEFORE we send any decoded audio, // and only initialize once. - Log.d(LOG_TAG, "Final: Rate: " + sampleRate + - " Channels: " + inputChannelCount + - " Mime: " + mime + - " Duration: " + durationMicroseconds + " microsec"); + Log.d(LOG_TAG, "Final: Rate: " + sampleRate + + " Channels: " + inputChannelCount + + " Mime: " + mime + + " Duration: " + durationMicroseconds + " microsec"); nativeInitializeDestination(nativeMediaCodecBridge, inputChannelCount, diff --git a/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java b/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java index 60f910c..2a6c2f2 100644 --- a/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java +++ b/net/android/java/src/org/chromium/net/DefaultAndroidKeyStore.java @@ -123,8 +123,8 @@ public class DefaultAndroidKeyStore implements AndroidKeyStore { signature.update(message); return signature.sign(); } catch (Exception e) { - Log.e(TAG, "Exception while signing message with " + javaKey.getAlgorithm() + - " private key: " + e); + Log.e(TAG, "Exception while signing message with " + javaKey.getAlgorithm() + + " private key: " + e); return null; } } @@ -170,8 +170,8 @@ public class DefaultAndroidKeyStore implements AndroidKeyStore { // This may happen if the PrivateKey was not created by the "AndroidOpenSSL" // provider, which should be the default. That could happen if an OEM decided // to implement a different default provider. Also highly unlikely. - Log.e(TAG, "Private key is not an OpenSSLRSAPrivateKey instance, its class name is:" + - javaKey.getClass().getCanonicalName()); + Log.e(TAG, "Private key is not an OpenSSLRSAPrivateKey instance, its class name is:" + + javaKey.getClass().getCanonicalName()); return null; } @@ -284,8 +284,8 @@ public class DefaultAndroidKeyStore implements AndroidKeyStore { } // Sanity-check the returned engine. if (!engineClass.isInstance(engine)) { - Log.e(TAG, "Engine is not an OpenSSLEngine instance, its class name is:" + - engine.getClass().getCanonicalName()); + Log.e(TAG, "Engine is not an OpenSSLEngine instance, its class name is:" + + engine.getClass().getCanonicalName()); return null; } return engine; diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java index 1e72da9..9db46e2 100644 --- a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java +++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java @@ -161,8 +161,8 @@ public class NetworkChangeNotifierAutoDetect extends BroadcastReceiver public int getCurrentConnectionType() { // Track exactly what type of connection we have. - if (!mConnectivityManagerDelegate.activeNetworkExists() || - !mConnectivityManagerDelegate.isConnected()) { + if (!mConnectivityManagerDelegate.activeNetworkExists() + || !mConnectivityManagerDelegate.isConnected()) { return NetworkChangeNotifier.CONNECTION_NONE; } diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/java/src/org/chromium/net/X509Util.java index 3f6c70d..08ead31 100644 --- a/net/android/java/src/org/chromium/net/X509Util.java +++ b/net/android/java/src/org/chromium/net/X509Util.java @@ -372,8 +372,8 @@ public class X509Util { // If the subject and public key match, this is a system root. X509Certificate anchorX509 = (X509Certificate) anchor; - if (root.getSubjectX500Principal().equals(anchorX509.getSubjectX500Principal()) && - root.getPublicKey().equals(anchorX509.getPublicKey())) { + if (root.getSubjectX500Principal().equals(anchorX509.getSubjectX500Principal()) + && root.getPublicKey().equals(anchorX509.getPublicKey())) { sSystemTrustAnchorCache.add(key); return true; } @@ -405,10 +405,10 @@ public class X509Util { if (ekuOids == null) return true; for (String ekuOid : ekuOids) { - if (ekuOid.equals(OID_TLS_SERVER_AUTH) || - ekuOid.equals(OID_ANY_EKU) || - ekuOid.equals(OID_SERVER_GATED_NETSCAPE) || - ekuOid.equals(OID_SERVER_GATED_MICROSOFT)) { + if (ekuOid.equals(OID_TLS_SERVER_AUTH) + || ekuOid.equals(OID_ANY_EKU) + || ekuOid.equals(OID_SERVER_GATED_NETSCAPE) + || ekuOid.equals(OID_SERVER_GATED_MICROSOFT)) { return true; } } @@ -421,8 +421,8 @@ public class X509Util { String host) throws KeyStoreException, NoSuchAlgorithmException { if (certChain == null || certChain.length == 0 || certChain[0] == null) { - throw new IllegalArgumentException("Expected non-null and non-empty certificate " + - "chain passed as |certChain|. |certChain|=" + Arrays.deepToString(certChain)); + throw new IllegalArgumentException("Expected non-null and non-empty certificate " + + "chain passed as |certChain|. |certChain|=" + Arrays.deepToString(certChain)); } @@ -475,8 +475,8 @@ public class X509Util { } catch (CertificateException eTestManager) { // Neither of the trust managers confirms the validity of the certificate chain, // log the error message returned by the system trust manager. - Log.i(TAG, "Failed to validate the certificate chain, error: " + - eDefaultManager.getMessage()); + Log.i(TAG, "Failed to validate the certificate chain, error: " + + eDefaultManager.getMessage()); return new AndroidCertVerifyResult( CertVerifyStatusAndroid.NO_TRUSTED_ROOT); } diff --git a/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java b/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java index 66a9bd9..6121a2a 100644 --- a/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java +++ b/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java @@ -86,8 +86,8 @@ public class TestWebServer { mIsRedirect = isRedirect; mIsNotFound = isNotFound; mResponseData = responseData; - mResponseHeaders = responseHeaders == null ? - new ArrayList<Pair<String, String>>() : responseHeaders; + mResponseHeaders = responseHeaders == null + ? new ArrayList<Pair<String, String>>() : responseHeaders; mResponseAction = responseAction; } } @@ -534,30 +534,30 @@ public class TestWebServer { * single self-generated key. The subject name is "Test Server". */ private static final String SERVER_KEYS_BKS = - "AAAAAQAAABQDkebzoP1XwqyWKRCJEpn/t8dqIQAABDkEAAVteWtleQAAARpYl20nAAAAAQAFWC41" + - "MDkAAAJNMIICSTCCAbKgAwIBAgIESEfU1jANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJVUzET" + - "MBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8wDQYDVQQKEwZHb29nbGUxEDAOBgNV" + - "BAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgU2VydmVyMB4XDTA4MDYwNTExNTgxNFoXDTA4MDkw" + - "MzExNTgxNFowaTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01U" + - "VjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdBbmRyb2lkMRQwEgYDVQQDEwtUZXN0IFNlcnZl" + - "cjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LIdKaIr9/vsTq8BZlA3R+NFWRaH4lGsTAQy" + - "DPMF9ZqEDOaL6DJuu0colSBBBQ85hQTPa9m9nyJoN3pEi1hgamqOvQIWcXBk+SOpUGRZZFXwniJV" + - "zDKU5nE9MYgn2B9AoiH3CSuMz6HRqgVaqtppIe1jhukMc/kHVJvlKRNy9XMCAwEAATANBgkqhkiG" + - "9w0BAQUFAAOBgQC7yBmJ9O/eWDGtSH9BH0R3dh2NdST3W9hNZ8hIa8U8klhNHbUCSSktZmZkvbPU" + - "hse5LI3dh6RyNDuqDrbYwcqzKbFJaq/jX9kCoeb3vgbQElMRX8D2ID1vRjxwlALFISrtaN4VpWzV" + - "yeoHPW4xldeZmoVtjn8zXNzQhLuBqX2MmAAAAqwAAAAUvkUScfw9yCSmALruURNmtBai7kQAAAZx" + - "4Jmijxs/l8EBaleaUru6EOPioWkUAEVWCxjM/TxbGHOi2VMsQWqRr/DZ3wsDmtQgw3QTrUK666sR" + - "MBnbqdnyCyvM1J2V1xxLXPUeRBmR2CXorYGF9Dye7NkgVdfA+9g9L/0Au6Ugn+2Cj5leoIgkgApN" + - "vuEcZegFlNOUPVEs3SlBgUF1BY6OBM0UBHTPwGGxFBBcetcuMRbUnu65vyDG0pslT59qpaR0TMVs" + - "P+tcheEzhyjbfM32/vwhnL9dBEgM8qMt0sqF6itNOQU/F4WGkK2Cm2v4CYEyKYw325fEhzTXosck" + - "MhbqmcyLab8EPceWF3dweoUT76+jEZx8lV2dapR+CmczQI43tV9btsd1xiBbBHAKvymm9Ep9bPzM" + - "J0MQi+OtURL9Lxke/70/MRueqbPeUlOaGvANTmXQD2OnW7PISwJ9lpeLfTG0LcqkoqkbtLKQLYHI" + - "rQfV5j0j+wmvmpMxzjN3uvNajLa4zQ8l0Eok9SFaRr2RL0gN8Q2JegfOL4pUiHPsh64WWya2NB7f" + - "V+1s65eA5ospXYsShRjo046QhGTmymwXXzdzuxu8IlnTEont6P4+J+GsWk6cldGbl20hctuUKzyx" + - "OptjEPOKejV60iDCYGmHbCWAzQ8h5MILV82IclzNViZmzAapeeCnexhpXhWTs+xDEYSKEiG/camt" + - "bhmZc3BcyVJrW23PktSfpBQ6D8ZxoMfF0L7V2GQMaUg+3r7ucrx82kpqotjv0xHghNIm95aBr1Qw" + - "1gaEjsC/0wGmmBDg1dTDH+F1p9TInzr3EFuYD0YiQ7YlAHq3cPuyGoLXJ5dXYuSBfhDXJSeddUkl" + - "k1ufZyOOcskeInQge7jzaRfmKg3U94r+spMEvb0AzDQVOKvjjo1ivxMSgFRZaDb/4qw="; + "AAAAAQAAABQDkebzoP1XwqyWKRCJEpn/t8dqIQAABDkEAAVteWtleQAAARpYl20nAAAAAQAFWC41" + + "MDkAAAJNMIICSTCCAbKgAwIBAgIESEfU1jANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJVUzET" + + "MBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8wDQYDVQQKEwZHb29nbGUxEDAOBgNV" + + "BAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgU2VydmVyMB4XDTA4MDYwNTExNTgxNFoXDTA4MDkw" + + "MzExNTgxNFowaTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01U" + + "VjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdBbmRyb2lkMRQwEgYDVQQDEwtUZXN0IFNlcnZl" + + "cjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LIdKaIr9/vsTq8BZlA3R+NFWRaH4lGsTAQy" + + "DPMF9ZqEDOaL6DJuu0colSBBBQ85hQTPa9m9nyJoN3pEi1hgamqOvQIWcXBk+SOpUGRZZFXwniJV" + + "zDKU5nE9MYgn2B9AoiH3CSuMz6HRqgVaqtppIe1jhukMc/kHVJvlKRNy9XMCAwEAATANBgkqhkiG" + + "9w0BAQUFAAOBgQC7yBmJ9O/eWDGtSH9BH0R3dh2NdST3W9hNZ8hIa8U8klhNHbUCSSktZmZkvbPU" + + "hse5LI3dh6RyNDuqDrbYwcqzKbFJaq/jX9kCoeb3vgbQElMRX8D2ID1vRjxwlALFISrtaN4VpWzV" + + "yeoHPW4xldeZmoVtjn8zXNzQhLuBqX2MmAAAAqwAAAAUvkUScfw9yCSmALruURNmtBai7kQAAAZx" + + "4Jmijxs/l8EBaleaUru6EOPioWkUAEVWCxjM/TxbGHOi2VMsQWqRr/DZ3wsDmtQgw3QTrUK666sR" + + "MBnbqdnyCyvM1J2V1xxLXPUeRBmR2CXorYGF9Dye7NkgVdfA+9g9L/0Au6Ugn+2Cj5leoIgkgApN" + + "vuEcZegFlNOUPVEs3SlBgUF1BY6OBM0UBHTPwGGxFBBcetcuMRbUnu65vyDG0pslT59qpaR0TMVs" + + "P+tcheEzhyjbfM32/vwhnL9dBEgM8qMt0sqF6itNOQU/F4WGkK2Cm2v4CYEyKYw325fEhzTXosck" + + "MhbqmcyLab8EPceWF3dweoUT76+jEZx8lV2dapR+CmczQI43tV9btsd1xiBbBHAKvymm9Ep9bPzM" + + "J0MQi+OtURL9Lxke/70/MRueqbPeUlOaGvANTmXQD2OnW7PISwJ9lpeLfTG0LcqkoqkbtLKQLYHI" + + "rQfV5j0j+wmvmpMxzjN3uvNajLa4zQ8l0Eok9SFaRr2RL0gN8Q2JegfOL4pUiHPsh64WWya2NB7f" + + "V+1s65eA5ospXYsShRjo046QhGTmymwXXzdzuxu8IlnTEont6P4+J+GsWk6cldGbl20hctuUKzyx" + + "OptjEPOKejV60iDCYGmHbCWAzQ8h5MILV82IclzNViZmzAapeeCnexhpXhWTs+xDEYSKEiG/camt" + + "bhmZc3BcyVJrW23PktSfpBQ6D8ZxoMfF0L7V2GQMaUg+3r7ucrx82kpqotjv0xHghNIm95aBr1Qw" + + "1gaEjsC/0wGmmBDg1dTDH+F1p9TInzr3EFuYD0YiQ7YlAHq3cPuyGoLXJ5dXYuSBfhDXJSeddUkl" + + "k1ufZyOOcskeInQge7jzaRfmKg3U94r+spMEvb0AzDQVOKvjjo1ivxMSgFRZaDb/4qw="; private static final String PASSWORD = "android"; diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java index 501f6dd..85c0a93 100644 --- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java +++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java @@ -246,11 +246,11 @@ public class Desktop extends ActionBarActivity implements View.OnSystemUiVisibil // want to send it as KeyEvent. int unicode = keyCode != KeyEvent.KEYCODE_ENTER ? event.getUnicodeChar() : 0; - boolean no_modifiers = !event.isAltPressed() && - !event.isCtrlPressed() && !event.isMetaPressed(); + boolean no_modifiers = !event.isAltPressed() + && !event.isCtrlPressed() && !event.isMetaPressed(); - if (event.getDeviceId() == KeyCharacterMap.VIRTUAL_KEYBOARD && - pressed && unicode != 0 && no_modifiers) { + if (event.getDeviceId() == KeyCharacterMap.VIRTUAL_KEYBOARD + && pressed && unicode != 0 && no_modifiers) { mPressedTextKeys.add(keyCode); int[] codePoints = { unicode }; JniInterface.sendTextEvent(new String(codePoints, 0, 1)); diff --git a/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java b/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java index a1f8a5b..4d52ef6 100644 --- a/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java +++ b/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java @@ -65,8 +65,8 @@ public class SessionConnector implements JniInterface.ConnectionListener, @Override public void onConnectionState(JniInterface.ConnectionListener.State state, JniInterface.ConnectionListener.Error error) { - if (state == JniInterface.ConnectionListener.State.FAILED && - error == JniInterface.ConnectionListener.Error.PEER_IS_OFFLINE) { + if (state == JniInterface.ConnectionListener.State.FAILED + && error == JniInterface.ConnectionListener.Error.PEER_IS_OFFLINE) { // The host is offline, which may mean the JID is out of date, so refresh the host list // and try to connect again. reloadHostListAndConnect(); diff --git a/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java b/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java index 1349207..c8bd88a 100644 --- a/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java +++ b/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java @@ -91,9 +91,9 @@ public class ThirdPartyTokenFetcher { // redirect URI as it is possible for the other applications to intercept the redirect URI. // Instead, we use the intent scheme URI, which can restrict a specific package to handle // the intent. See https://developer.chrome.com/multidevice/android/intents. - this.mRedirectUri = "intent://" + REDIRECT_URI_PATH + "#Intent;" + - "package=" + mRedirectUriScheme + ";" + - "scheme=" + mRedirectUriScheme + ";end;"; + this.mRedirectUri = "intent://" + REDIRECT_URI_PATH + "#Intent;" + + "package=" + mRedirectUriScheme + ";" + + "scheme=" + mRedirectUriScheme + ";end;"; } /** @@ -103,10 +103,9 @@ public class ThirdPartyTokenFetcher { */ public void fetchToken(String tokenUrl, String clientId, String scope) { if (!isValidTokenUrl(tokenUrl)) { - failFetchToken( - "Token URL does not match the domain\'s allowed URL patterns." + - " URL: " + tokenUrl + - ", patterns: " + TextUtils.join(",", this.mTokenUrlPatterns)); + failFetchToken("Token URL does not match the domain\'s allowed URL patterns." + + " URL: " + tokenUrl + + ", patterns: " + TextUtils.join(",", this.mTokenUrlPatterns)); return; } @@ -150,9 +149,9 @@ public class ThirdPartyTokenFetcher { Uri data = intent.getData(); if (data != null) { - return Intent.ACTION_VIEW.equals(action) && - this.mRedirectUriScheme.equals(data.getScheme()) && - REDIRECT_URI_PATH.equals(data.getPath()); + return Intent.ACTION_VIEW.equals(action) + && this.mRedirectUriScheme.equals(data.getScheme()) + && REDIRECT_URI_PATH.equals(data.getPath()); } return false; } diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationIntentProtocol.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationIntentProtocol.java index 3d96e03..64fdb48 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationIntentProtocol.java +++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationIntentProtocol.java @@ -115,8 +115,8 @@ public class InvalidationIntentProtocol { /** Returns whether {@code intent} is a registered types change intent. */ public static boolean isRegisteredTypesChange(Intent intent) { - return intent.hasExtra(EXTRA_REGISTERED_TYPES) || - intent.hasExtra(EXTRA_REGISTERED_OBJECT_SOURCES); + return intent.hasExtra(EXTRA_REGISTERED_TYPES) + || intent.hasExtra(EXTRA_REGISTERED_OBJECT_SOURCES); } /** Returns the object ids for which to register contained in the intent. */ @@ -125,8 +125,8 @@ public class InvalidationIntentProtocol { intent.getIntegerArrayListExtra(EXTRA_REGISTERED_OBJECT_SOURCES); ArrayList<String> objectNames = intent.getStringArrayListExtra(EXTRA_REGISTERED_OBJECT_NAMES); - if (objectSources == null || objectNames == null || - objectSources.size() != objectNames.size()) { + if (objectSources == null || objectNames == null + || objectSources.size() != objectNames.size()) { return null; } Set<ObjectId> objectIds = new HashSet<ObjectId>(objectSources.size()); diff --git a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java index d26be87..6f49d1f 100644 --- a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java +++ b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java @@ -289,9 +289,9 @@ public class AccountManagerHelper { private void onGotAuthTokenResult(Account account, String authTokenType, String authToken, GetAuthTokenCallback callback, AtomicInteger numTries, AtomicBoolean errorEncountered, ConnectionRetry retry) { - if (authToken != null || !errorEncountered.get() || - numTries.incrementAndGet() == MAX_TRIES || - !NetworkChangeNotifier.isInitialized()) { + if (authToken != null || !errorEncountered.get() + || numTries.incrementAndGet() == MAX_TRIES + || !NetworkChangeNotifier.isInitialized()) { callback.tokenAvailable(authToken); return; } diff --git a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java index ab8fc08..9c8fc37 100644 --- a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java +++ b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java @@ -94,9 +94,9 @@ public class MockSyncContentResolverDelegate implements SyncContentResolverDeleg String key = createKey(account, authority); synchronized (mSyncableMapLock) { if (!mIsSyncableMap.containsKey(key) || !mIsSyncableMap.get(key)) { - throw new IllegalArgumentException("Account " + account + - " is not syncable for authority " + authority + - ". Can not set sync state to " + sync); + throw new IllegalArgumentException("Account " + account + + " is not syncable for authority " + authority + + ". Can not set sync state to " + sync); } if (sync) { mSyncAutomaticallySet.add(key); @@ -129,8 +129,8 @@ public class MockSyncContentResolverDelegate implements SyncContentResolverDeleg } break; default: - throw new IllegalArgumentException("Unable to understand syncable argument: " + - syncable); + throw new IllegalArgumentException("Unable to understand syncable argument: " + + syncable); } } notifyObservers(); diff --git a/testing/android/junit/javatests/src/org/chromium/testing/local/GtestLoggerTest.java b/testing/android/junit/javatests/src/org/chromium/testing/local/GtestLoggerTest.java index 2a442fc..2bb3040 100644 --- a/testing/android/junit/javatests/src/org/chromium/testing/local/GtestLoggerTest.java +++ b/testing/android/junit/javatests/src/org/chromium/testing/local/GtestLoggerTest.java @@ -43,8 +43,8 @@ public class GtestLoggerTest { Description.createTestDescription(GtestLoggerTest.class, "testTestFinishedPassed"), true, 123); Assert.assertEquals( - "[ OK ] org.chromium.testing.local.GtestLoggerTest.testTestFinishedPassed" + - " (123 ms)\n", + "[ OK ] org.chromium.testing.local.GtestLoggerTest.testTestFinishedPassed" + + " (123 ms)\n", actual.toString()); } @@ -56,8 +56,8 @@ public class GtestLoggerTest { Description.createTestDescription(GtestLoggerTest.class, "testTestFinishedPassed"), false, 123); Assert.assertEquals( - "[ FAILED ] org.chromium.testing.local.GtestLoggerTest.testTestFinishedPassed" + - " (123 ms)\n", + "[ FAILED ] org.chromium.testing.local.GtestLoggerTest.testTestFinishedPassed" + + " (123 ms)\n", actual.toString()); } @@ -79,8 +79,8 @@ public class GtestLoggerTest { loggerUnderTest.testCaseFinished( Description.createSuiteDescription(GtestLoggerTest.class), 456, 123); Assert.assertEquals( - "[----------] Run 456 test cases from org.chromium.testing.local.GtestLoggerTest" + - " (123 ms)\n\n", + "[----------] Run 456 test cases from org.chromium.testing.local.GtestLoggerTest" + + " (123 ms)\n\n", actual.toString()); } @@ -90,8 +90,8 @@ public class GtestLoggerTest { GtestLogger loggerUnderTest = new GtestLogger(new PrintStream(actual)); loggerUnderTest.testRunStarted(1234); Assert.assertEquals( - "[==========] Running 1234 tests.\n" + - "[----------] Global test environment set-up.\n\n", + "[==========] Running 1234 tests.\n" + + "[----------] Global test environment set-up.\n\n", actual.toString()); } @@ -101,9 +101,9 @@ public class GtestLoggerTest { GtestLogger loggerUnderTest = new GtestLogger(new PrintStream(actual)); loggerUnderTest.testRunFinished(1234, new HashSet<Description>(), 4321); Assert.assertEquals( - "[----------] Global test environment tear-down.\n" + - "[==========] 1234 tests ran. (4321 ms total)\n" + - "[ PASSED ] 1234 tests.\n", + "[----------] Global test environment tear-down.\n" + + "[==========] 1234 tests ran. (4321 ms total)\n" + + "[ PASSED ] 1234 tests.\n", actual.toString()); } @@ -120,13 +120,13 @@ public class GtestLoggerTest { loggerUnderTest.testRunFinished(1232, failures, 4312); Assert.assertEquals( - "[----------] Global test environment tear-down.\n" + - "[==========] 1234 tests ran. (4312 ms total)\n" + - "[ PASSED ] 1232 tests.\n" + - "[ FAILED ] 2 tests.\n" + - "[ FAILED ] GtestLoggerTest.testTestRunFinishedNoFailures\n" + - "[ FAILED ] GtestLoggerTest.testTestRunFinishedWithFailures\n" + - "\n", + "[----------] Global test environment tear-down.\n" + + "[==========] 1234 tests ran. (4312 ms total)\n" + + "[ PASSED ] 1232 tests.\n" + + "[ FAILED ] 2 tests.\n" + + "[ FAILED ] GtestLoggerTest.testTestRunFinishedNoFailures\n" + + "[ FAILED ] GtestLoggerTest.testTestRunFinishedWithFailures\n" + + "\n", actual.toString()); } diff --git a/tools/android/checkstyle/chromium-style-5.0.xml b/tools/android/checkstyle/chromium-style-5.0.xml index fa34417..c43f779 100644 --- a/tools/android/checkstyle/chromium-style-5.0.xml +++ b/tools/android/checkstyle/chromium-style-5.0.xml @@ -138,6 +138,17 @@ <property name="allowLineBreaks" value="true"/> <property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC"/> </module> + <module name="GenericWhitespace"> + <property name="severity" value="error"/> + <message key="ws.followed" + value="GenericWhitespace ''{0}'' is followed by whitespace."/> + <message key="ws.preceded" + value="GenericWhitespace ''{0}'' is preceded with whitespace."/> + <message key="ws.illegalFollow" + value="GenericWhitespace ''{0}'' should followed by whitespace."/> + <message key="ws.notPreceded" + value="GenericWhitespace ''{0}'' is not preceded with whitespace."/> + </module> <module name="EmptyStatement"> <property name="severity" value="error"/> </module> @@ -166,22 +177,22 @@ </module> <!-- TODO(aurimas): make OperatorWrap into an error once all the warnings are fixed. --> <module name="OperatorWrap"> - <property name="severity" value="warning"/> + <property name="severity" value="error"/> <property name="option" value="NL" /> <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR " /> </module> <module name="OperatorWrap"> - <property name="severity" value="warning"/> + <property name="severity" value="error"/> <property name="option" value="eol"/> <property name="tokens" value="ASSIGN"/> </module> <module name="SeparatorWrap"> - <property name="severity" value="warning"/> + <property name="severity" value="error"/> <property name="tokens" value="DOT"/> <property name="option" value="nl"/> </module> <module name="SeparatorWrap"> - <property name="severity" value="warning"/> + <property name="severity" value="error"/> <property name="tokens" value="COMMA"/> <property name="option" value="EOL"/> </module> diff --git a/ui/android/java/src/org/chromium/ui/VSyncMonitor.java b/ui/android/java/src/org/chromium/ui/VSyncMonitor.java index e717851..8974b99 100644 --- a/ui/android/java/src/org/chromium/ui/VSyncMonitor.java +++ b/ui/android/java/src/org/chromium/ui/VSyncMonitor.java @@ -101,8 +101,8 @@ public class VSyncMonitor { // after that it asymptotically approaches the real value. long lastRefreshDurationNano = frameTimeNanos - mGoodStartingPointNano; float lastRefreshDurationWeight = 0.1f; - mRefreshPeriodNano += (long) (lastRefreshDurationWeight * - (lastRefreshDurationNano - mRefreshPeriodNano)); + mRefreshPeriodNano += (long) (lastRefreshDurationWeight + * (lastRefreshDurationNano - mRefreshPeriodNano)); } mGoodStartingPointNano = frameTimeNanos; onVSyncCallback(frameTimeNanos, getCurrentNanoTime()); @@ -219,8 +219,9 @@ public class VSyncMonitor { } private long estimateLastVSyncTime(long currentTime) { - final long lastRefreshTime = mGoodStartingPointNano + - ((currentTime - mGoodStartingPointNano) / mRefreshPeriodNano) * mRefreshPeriodNano; + final long lastRefreshTime = mGoodStartingPointNano + + ((currentTime - mGoodStartingPointNano) / mRefreshPeriodNano) + * mRefreshPeriodNano; return lastRefreshTime; } diff --git a/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java b/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java index 8deeb47..eec186cb 100644 --- a/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java +++ b/ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java @@ -53,9 +53,8 @@ public class LocalizationUtils { if (sIsLayoutRtl == null) { Configuration configuration = ApplicationStatus.getApplicationContext().getResources().getConfiguration(); - sIsLayoutRtl = Boolean.valueOf( - ApiCompatibilityUtils.getLayoutDirection(configuration) == - View.LAYOUT_DIRECTION_RTL); + sIsLayoutRtl = Boolean.valueOf(ApiCompatibilityUtils.getLayoutDirection(configuration) + == View.LAYOUT_DIRECTION_RTL); } return sIsLayoutRtl.booleanValue(); diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java index bc6efb7..4ba85b0 100644 --- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java +++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java @@ -73,8 +73,8 @@ class SelectFileDialog implements WindowAndroid.IntentCallback { Intent chooser = new Intent(Intent.ACTION_CHOOSER); Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Context context = window.getApplicationContext(); - camera.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | - Intent.FLAG_GRANT_WRITE_URI_PERMISSION); + camera.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION + | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); try { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { mCameraOutputUri = ContentUriUtils.getContentUriFromFile( @@ -171,8 +171,8 @@ class SelectFileDialog implements WindowAndroid.IntentCallback { } else { File externalDataDir = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DCIM); - path = new File(externalDataDir.getAbsolutePath() + - File.separator + CAPTURE_IMAGE_DIRECTORY); + path = new File(externalDataDir.getAbsolutePath() + + File.separator + CAPTURE_IMAGE_DIRECTORY); if (!path.exists() && !path.mkdirs()) { path = externalDataDir; } @@ -205,8 +205,8 @@ class SelectFileDialog implements WindowAndroid.IntentCallback { // If the uri is a file, we need to convert it to the absolute path or otherwise // android cannot handle it correctly on some earlier versions. // http://crbug.com/423338. - String path = ContentResolver.SCHEME_FILE.equals(mCameraOutputUri.getScheme()) ? - mCameraOutputUri.getPath() : mCameraOutputUri.toString(); + String path = ContentResolver.SCHEME_FILE.equals(mCameraOutputUri.getScheme()) + ? mCameraOutputUri.getPath() : mCameraOutputUri.toString(); nativeOnFileSelected(mNativeSelectFileDialog, path, mCameraOutputUri.getLastPathSegment()); // Broadcast to the media scanner that there's a new photo on the device so it will @@ -220,9 +220,8 @@ class SelectFileDialog implements WindowAndroid.IntentCallback { // Path for when EXTRA_ALLOW_MULTIPLE Intent extra has been defined. Each of the selected // files will be shared as an entry on the Intent's ClipData. This functionality is only // available in Android JellyBean MR2 and higher. - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && - results.getData() == null && - results.getClipData() != null) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 + && results.getData() == null && results.getClipData() != null) { ClipData clipData = results.getClipData(); int itemCount = clipData.getItemCount(); diff --git a/ui/android/java/src/org/chromium/ui/picker/DateTimeSuggestion.java b/ui/android/java/src/org/chromium/ui/picker/DateTimeSuggestion.java index 4c81468..f15a0fd 100644 --- a/ui/android/java/src/org/chromium/ui/picker/DateTimeSuggestion.java +++ b/ui/android/java/src/org/chromium/ui/picker/DateTimeSuggestion.java @@ -43,9 +43,8 @@ public class DateTimeSuggestion { return false; } final DateTimeSuggestion other = (DateTimeSuggestion) object; - return mValue == other.mValue && - mLocalizedValue == other.mLocalizedValue && - mLabel == other.mLabel; + return mValue == other.mValue && mLocalizedValue == other.mLocalizedValue + && mLabel == other.mLabel; } @Override diff --git a/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java b/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java index 48304d5..9646e5d 100644 --- a/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java +++ b/ui/android/java/src/org/chromium/ui/picker/InputDialogContainer.java @@ -112,8 +112,8 @@ public class InputDialogContainer { cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), 0, 0, 0, min, max, step); - } else if (dialogType == sTextInputTypeDateTime || - dialogType == sTextInputTypeDateTimeLocal) { + } else if (dialogType == sTextInputTypeDateTime + || dialogType == sTextInputTypeDateTimeLocal) { showPickerDialog(dialogType, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), @@ -159,8 +159,8 @@ public class InputDialogContainer { int dialogTitleId = R.string.date_picker_dialog_title; if (dialogType == sTextInputTypeTime) { dialogTitleId = R.string.time_picker_dialog_title; - } else if (dialogType == sTextInputTypeDateTime || - dialogType == sTextInputTypeDateTimeLocal) { + } else if (dialogType == sTextInputTypeDateTime + || dialogType == sTextInputTypeDateTimeLocal) { dialogTitleId = R.string.date_time_picker_dialog_title; } else if (dialogType == sTextInputTypeMonth) { dialogTitleId = R.string.month_picker_dialog_title; @@ -232,8 +232,8 @@ public class InputDialogContainer { (int) min, (int) max, stepTime, DateFormat.is24HourFormat(mContext), new FullTimeListener(dialogType)); - } else if (dialogType == sTextInputTypeDateTime || - dialogType == sTextInputTypeDateTimeLocal) { + } else if (dialogType == sTextInputTypeDateTime + || dialogType == sTextInputTypeDateTimeLocal) { mDialog = new DateTimePickerDialog(mContext, new DateTimeListener(dialogType), year, month, monthDay, @@ -363,10 +363,10 @@ public class InputDialogContainer { mInputActionDelegate.replaceDateTime( WeekPicker.createDateFromWeek(year, week).getTimeInMillis()); } else if (dialogType == sTextInputTypeTime) { - mInputActionDelegate.replaceDateTime(TimeUnit.HOURS.toMillis(hourOfDay) + - TimeUnit.MINUTES.toMillis(minute) + - TimeUnit.SECONDS.toMillis(second) + - millis); + mInputActionDelegate.replaceDateTime(TimeUnit.HOURS.toMillis(hourOfDay) + + TimeUnit.MINUTES.toMillis(minute) + + TimeUnit.SECONDS.toMillis(second) + + millis); } else { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); cal.clear(); |