Commit 71235c3f authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

[WebLayer] Fix bad code formatting

Somehow this code got committed without git cl format being run.

Change-Id: I85ded7a8e9a5ec6e9d31ad8af38669bc12b3a49a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894535
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Auto-Submit: Clark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711545}
parent fc9b7c38
......@@ -17,17 +17,16 @@ import org.chromium.weblayer_private.aidl.IRemoteFragment;
import org.chromium.weblayer_private.aidl.IRemoteFragmentClient;
public class BrowserFragmentImpl extends RemoteFragmentImpl {
private final ProfileImpl mProfile;
private BrowserFragmentControllerImpl mController;
private Context mContext;
public BrowserFragmentImpl(ProfileManager profileManager, IRemoteFragmentClient client,
Bundle fragmentArgs) {
public BrowserFragmentImpl(
ProfileManager profileManager, IRemoteFragmentClient client, Bundle fragmentArgs) {
super(client);
mProfile = profileManager.getProfile(fragmentArgs.getString(
BrowserFragmentArgs.PROFILE_PATH));
mProfile =
profileManager.getProfile(fragmentArgs.getString(BrowserFragmentArgs.PROFILE_PATH));
}
@Override
......
......@@ -46,8 +46,8 @@ public final class ProfileImpl extends IProfile.Stub {
public void clearBrowsingData(@NonNull @BrowsingDataType int[] dataTypes,
@NonNull IObjectWrapper completionCallback) {
Runnable callback = ObjectWrapper.unwrap(completionCallback, Runnable.class);
ProfileImplJni.get().clearBrowsingData(mNativeProfile, mapBrowsingDataTypes(dataTypes),
callback);
ProfileImplJni.get().clearBrowsingData(
mNativeProfile, mapBrowsingDataTypes(dataTypes), callback);
}
private static @ImplBrowsingDataType int[] mapBrowsingDataTypes(
......@@ -78,7 +78,7 @@ public final class ProfileImpl extends IProfile.Stub {
interface Natives {
long createProfile(String path);
void deleteProfile(long profile);
void clearBrowsingData(long nativeProfileImpl, @ImplBrowsingDataType int[] dataTypes,
Runnable callback);
void clearBrowsingData(
long nativeProfileImpl, @ImplBrowsingDataType int[] dataTypes, Runnable callback);
}
}
......@@ -132,11 +132,11 @@ public final class WebLayerImpl extends IWebLayer.Stub {
}
@Override
public IBrowserFragment createBrowserFragmentImpl(IRemoteFragmentClient fragmentClient,
IObjectWrapper fragmentArgs) {
public IBrowserFragment createBrowserFragmentImpl(
IRemoteFragmentClient fragmentClient, IObjectWrapper fragmentArgs) {
Bundle unwrappedArgs = ObjectWrapper.unwrap(fragmentArgs, Bundle.class);
BrowserFragmentImpl fragment = new BrowserFragmentImpl(mProfileManager, fragmentClient,
unwrappedArgs);
BrowserFragmentImpl fragment =
new BrowserFragmentImpl(mProfileManager, fragmentClient, unwrappedArgs);
return fragment.asIBrowserFragment();
}
......
......@@ -5,6 +5,4 @@
package org.chromium.weblayer_private.aidl;
/** Keys for the Bundle of arguments with which BrowserFragments are created. */
public interface BrowserFragmentArgs {
String PROFILE_PATH = "profile_path";
}
public interface BrowserFragmentArgs { String PROFILE_PATH = "profile_path"; }
......@@ -43,7 +43,8 @@ class NavigationControllerImpl : public NavigationController,
bool CanGoBack(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj) {
return CanGoBack();
}
bool CanGoForward(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj) {
bool CanGoForward(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj) {
return CanGoForward();
}
void Reload(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj) {
......
......@@ -17,8 +17,8 @@
#if defined(OS_ANDROID)
#include "base/android/callback_android.h"
#include "base/android/jni_string.h"
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "weblayer/browser/java/jni/ProfileImpl_jni.h"
#endif
......@@ -248,7 +248,8 @@ static void JNI_ProfileImpl_DeleteProfile(JNIEnv* env, jlong profile) {
delete reinterpret_cast<ProfileImpl*>(profile);
}
void ProfileImpl::ClearBrowsingData(JNIEnv* env,
void ProfileImpl::ClearBrowsingData(
JNIEnv* env,
const base::android::JavaParamRef<jintArray>& j_data_types,
const base::android::JavaRef<jobject>& j_callback) {
std::vector<int> data_type_ints;
......@@ -258,7 +259,8 @@ void ProfileImpl::ClearBrowsingData(JNIEnv* env,
for (int type : data_type_ints) {
data_types.push_back(static_cast<BrowsingDataType>(type));
}
ClearBrowsingData(data_types,
ClearBrowsingData(
data_types,
base::BindOnce(base::android::RunRunnableAndroid,
base::android::ScopedJavaGlobalRef<jobject>(j_callback)));
}
......
......@@ -33,10 +33,10 @@ class ProfileImpl : public Profile {
base::OnceCallback<void()> callback) override;
#if defined(OS_ANDROID)
ProfileImpl(JNIEnv* env,
const base::android::JavaParamRef<jstring>& path);
ProfileImpl(JNIEnv* env, const base::android::JavaParamRef<jstring>& path);
void ClearBrowsingData(JNIEnv* env,
void ClearBrowsingData(
JNIEnv* env,
const base::android::JavaParamRef<jintArray>& j_data_types,
const base::android::JavaRef<jobject>& j_callback);
#endif
......
......@@ -86,8 +86,7 @@ public final class BrowserFragmentController {
ThreadCheck.ensureOnUiThread();
try {
final ListenableResult<Boolean> listenableResult = new ListenableResult<Boolean>();
mImpl.setSupportsEmbedding(
enable, ObjectWrapper.wrap(new ValueCallback<Boolean>() {
mImpl.setSupportsEmbedding(enable, ObjectWrapper.wrap(new ValueCallback<Boolean>() {
@Override
public void onReceiveValue(Boolean result) {
listenableResult.supplyResult(result);
......
......@@ -74,8 +74,8 @@ public final class Profile {
ThreadCheck.ensureOnUiThread();
try {
ListenableResult<Void> result = new ListenableResult<>();
mImpl.clearBrowsingData(dataTypes,
ObjectWrapper.wrap((Runnable) () -> result.supplyResult(null)));
mImpl.clearBrowsingData(
dataTypes, ObjectWrapper.wrap((Runnable) () -> result.supplyResult(null)));
return result;
} catch (RemoteException e) {
throw new APICallException(e);
......
......@@ -214,8 +214,8 @@ public final class WebLayer {
/* package */ IBrowserFragment connectFragment(
IRemoteFragmentClient remoteFragmentClient, Bundle fragmentArgs) {
try {
return mImpl.createBrowserFragmentImpl(remoteFragmentClient,
ObjectWrapper.wrap(fragmentArgs));
return mImpl.createBrowserFragmentImpl(
remoteFragmentClient, ObjectWrapper.wrap(fragmentArgs));
} catch (RemoteException e) {
throw new APICallException(e);
}
......
......@@ -79,10 +79,10 @@ public class DataClearingTest {
CountDownLatch latch = new CountDownLatch(2);
runOnUiThreadBlocking(() -> {
Profile profile = activity.getBrowserFragmentController().getProfile();
profile.clearBrowsingData(new int[] {COOKIES_AND_SITE_DATA}).addCallback(
(ignored) -> latch.countDown());
profile.clearBrowsingData(new int[] {CACHE}).addCallback(
(ignored) -> latch.countDown());
profile.clearBrowsingData(new int[] {COOKIES_AND_SITE_DATA})
.addCallback((ignored) -> latch.countDown());
profile.clearBrowsingData(new int[] {CACHE})
.addCallback((ignored) -> latch.countDown());
});
assertTrue(latch.await(3, TimeUnit.SECONDS));
}
......@@ -96,8 +96,7 @@ public class DataClearingTest {
runOnUiThreadBlocking(() -> {
Profile profile = activity.getBrowserFragmentController().getProfile();
profile.clearBrowsingData(new int[] {COOKIES_AND_SITE_DATA}).addCallback((v1) -> {
profile.clearBrowsingData(new int[] {CACHE}).addCallback(
(v2) -> latch.countDown());
profile.clearBrowsingData(new int[] {CACHE}).addCallback((v2) -> latch.countDown());
});
});
assertTrue(latch.await(3, TimeUnit.SECONDS));
......@@ -127,8 +126,12 @@ public class DataClearingTest {
throws InterruptedException {
InstrumentationActivity activity = mActivityTestRule.launchWithProfile(profileName);
CountDownLatch latch = new CountDownLatch(1);
runOnUiThreadBlocking(() -> activity.getBrowserFragmentController().getProfile()
.clearBrowsingData(dataTypes).addCallback((ignored) -> latch.countDown()));
runOnUiThreadBlocking(() -> {
activity.getBrowserFragmentController()
.getProfile()
.clearBrowsingData(dataTypes)
.addCallback((ignored) -> latch.countDown());
});
assertTrue(latch.await(3, TimeUnit.SECONDS));
}
}
......@@ -230,9 +230,7 @@ public class NavigationTest {
navigationController.goForward();
});
runOnUiThreadBlocking(() -> {
assertFalse(navigationController.canGoForward());
});
runOnUiThreadBlocking(() -> { assertFalse(navigationController.canGoForward()); });
}
@Test
......
......@@ -35,7 +35,8 @@ public class RenderingTest {
activity.getBrowserFragmentController().setSupportsEmbedding(true).addCallback(
(Boolean result) -> {
Assert.assertTrue(result);
activity.getBrowserFragmentController().setSupportsEmbedding(false)
activity.getBrowserFragmentController()
.setSupportsEmbedding(false)
.addCallback((Boolean result2) -> {
Assert.assertTrue(result2);
latch.countDown();
......
......@@ -113,8 +113,8 @@ public class WebLayerShellActivity extends FragmentActivity {
// If activity is re-created during process restart, FragmentManager attaches
// BrowserFragment immediately, resulting in synchronous init. By the time this line
// executes, the synchronous init has already happened.
WebLayer.create(getApplication()).addCallback(webLayer -> onWebLayerReady(
savedInstanceState));
WebLayer.create(getApplication())
.addCallback(webLayer -> onWebLayerReady(savedInstanceState));
} catch (UnsupportedVersionException e) {
throw new RuntimeException("Failed to initialize WebLayer", e);
}
......@@ -264,8 +264,8 @@ public class WebLayerShellActivity extends FragmentActivity {
@Override
public void onBackPressed() {
if (mBrowserFragmentController != null) {
NavigationController controller = mBrowserFragmentController.getBrowserController()
.getNavigationController();
NavigationController controller =
mBrowserFragmentController.getBrowserController().getNavigationController();
if (controller.canGoBack()) {
controller.goBack();
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment