Commit ee7552dc authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

[WebLayer] Fix presubmit warnings and format

WebLayer had a lot of presubmit warnings related to javadocs, which I
think was causing people to forget to run "git cl format". This fixes
all warnings, so we should no longer ignore presubmit findings.

Change-Id: I68baa6f22c38fe54d65a3affc65117dbfd5ec1c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913203
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714730}
parent 2f5c8ac1
...@@ -24,6 +24,9 @@ import org.chromium.weblayer.shell.InstrumentationActivity; ...@@ -24,6 +24,9 @@ import org.chromium.weblayer.shell.InstrumentationActivity;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
/**
* Tests that fragment lifecycle works as expected.
*/
@RunWith(BaseJUnit4ClassRunner.class) @RunWith(BaseJUnit4ClassRunner.class)
public class BrowserFragmentLifecycleTest { public class BrowserFragmentLifecycleTest {
@Rule @Rule
......
...@@ -15,6 +15,9 @@ import org.chromium.content_public.browser.test.util.TestThreadUtils; ...@@ -15,6 +15,9 @@ import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.weblayer.Tab; import org.chromium.weblayer.Tab;
import org.chromium.weblayer.shell.InstrumentationActivity; import org.chromium.weblayer.shell.InstrumentationActivity;
/**
* Tests that fragment restore works as expected.
*/
@RunWith(BaseJUnit4ClassRunner.class) @RunWith(BaseJUnit4ClassRunner.class)
public class FragmentRestoreTest { public class FragmentRestoreTest {
@Rule @Rule
......
...@@ -20,6 +20,9 @@ import org.chromium.weblayer.shell.InstrumentationActivity; ...@@ -20,6 +20,9 @@ import org.chromium.weblayer.shell.InstrumentationActivity;
import java.io.File; import java.io.File;
import java.util.Collection; import java.util.Collection;
/**
* Tests that Profile works as expected.
*/
@RunWith(BaseJUnit4ClassRunner.class) @RunWith(BaseJUnit4ClassRunner.class)
public class ProfileTest { public class ProfileTest {
@Rule @Rule
......
...@@ -17,6 +17,9 @@ import org.chromium.weblayer.shell.InstrumentationActivity; ...@@ -17,6 +17,9 @@ import org.chromium.weblayer.shell.InstrumentationActivity;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
/**
* Tests that embedding support works as expected.
*/
@RunWith(BaseJUnit4ClassRunner.class) @RunWith(BaseJUnit4ClassRunner.class)
public class RenderingTest { public class RenderingTest {
@Rule @Rule
......
...@@ -22,6 +22,9 @@ import java.lang.ref.Reference; ...@@ -22,6 +22,9 @@ import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue; import java.lang.ref.ReferenceQueue;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
/**
* Basic tests to make sure WebLayer works as expected.
*/
@RunWith(BaseJUnit4ClassRunner.class) @RunWith(BaseJUnit4ClassRunner.class)
public class SmokeTest { public class SmokeTest {
@Rule @Rule
......
...@@ -16,6 +16,9 @@ import org.chromium.weblayer_private.interfaces.IBrowserFragment; ...@@ -16,6 +16,9 @@ import org.chromium.weblayer_private.interfaces.IBrowserFragment;
import org.chromium.weblayer_private.interfaces.IRemoteFragment; import org.chromium.weblayer_private.interfaces.IRemoteFragment;
import org.chromium.weblayer_private.interfaces.IRemoteFragmentClient; import org.chromium.weblayer_private.interfaces.IRemoteFragmentClient;
/**
* Implementation of RemoteFragmentImpl which forwards logic to BrowserImpl.
*/
public class BrowserFragmentImpl extends RemoteFragmentImpl { public class BrowserFragmentImpl extends RemoteFragmentImpl {
private final ProfileImpl mProfile; private final ProfileImpl mProfile;
......
...@@ -17,6 +17,9 @@ import org.chromium.weblayer_private.interfaces.IChildProcessService; ...@@ -17,6 +17,9 @@ import org.chromium.weblayer_private.interfaces.IChildProcessService;
import org.chromium.weblayer_private.interfaces.IObjectWrapper; import org.chromium.weblayer_private.interfaces.IObjectWrapper;
import org.chromium.weblayer_private.interfaces.ObjectWrapper; import org.chromium.weblayer_private.interfaces.ObjectWrapper;
/**
* Implementation of IChildProcessService.
*/
@UsedByReflection("WebLayer") @UsedByReflection("WebLayer")
public final class ChildProcessServiceImpl extends IChildProcessService.Stub { public final class ChildProcessServiceImpl extends IChildProcessService.Stub {
private ChildProcessService mService; private ChildProcessService mService;
......
...@@ -52,4 +52,4 @@ public abstract class GmsBridge { ...@@ -52,4 +52,4 @@ public abstract class GmsBridge {
public void setSafeBrowsingHandler() { public void setSafeBrowsingHandler() {
// We don't have this specialized service here. // We don't have this specialized service here.
} }
} }
\ No newline at end of file
...@@ -19,6 +19,9 @@ import org.chromium.weblayer_private.interfaces.NavigationState; ...@@ -19,6 +19,9 @@ import org.chromium.weblayer_private.interfaces.NavigationState;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
/**
* Implementation of INavigation.
*/
@JNINamespace("weblayer") @JNINamespace("weblayer")
public final class NavigationImpl extends INavigation.Stub { public final class NavigationImpl extends INavigation.Stub {
private final IClientNavigation mClientNavigation; private final IClientNavigation mClientNavigation;
......
...@@ -17,6 +17,9 @@ import org.chromium.weblayer_private.interfaces.ObjectWrapper; ...@@ -17,6 +17,9 @@ import org.chromium.weblayer_private.interfaces.ObjectWrapper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* Implementation of IProfile.
*/
@JNINamespace("weblayer") @JNINamespace("weblayer")
public final class ProfileImpl extends IProfile.Stub { public final class ProfileImpl extends IProfile.Stub {
private final String mPath; private final String mPath;
......
...@@ -173,9 +173,7 @@ class ProfileImpl::DataClearer : public content::BrowsingDataRemover::Observer { ...@@ -173,9 +173,7 @@ class ProfileImpl::DataClearer : public content::BrowsingDataRemover::Observer {
~DataClearer() override { remover_->RemoveObserver(this); } ~DataClearer() override { remover_->RemoveObserver(this); }
void ClearData(int mask, void ClearData(int mask, base::Time from_time, base::Time to_time) {
base::Time from_time,
base::Time to_time) {
int origin_types = int origin_types =
content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB | content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB |
content::BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB; content::BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB;
......
...@@ -120,10 +120,10 @@ static jlong JNI_TopControlsContainerView_CreateTopControlsContainerView( ...@@ -120,10 +120,10 @@ static jlong JNI_TopControlsContainerView_CreateTopControlsContainerView(
const base::android::JavaParamRef<jobject>& const base::android::JavaParamRef<jobject>&
java_top_controls_container_view, java_top_controls_container_view,
jlong native_content_view_render_view) { jlong native_content_view_render_view) {
return reinterpret_cast<jlong>(new TopControlsContainerView( return reinterpret_cast<jlong>(
java_top_controls_container_view, new TopControlsContainerView(java_top_controls_container_view,
reinterpret_cast<ContentViewRenderView*>( reinterpret_cast<ContentViewRenderView*>(
native_content_view_render_view))); native_content_view_render_view)));
} }
} // namespace weblayer } // namespace weblayer
...@@ -17,6 +17,7 @@ import org.chromium.weblayer_private.interfaces.ObjectWrapper; ...@@ -17,6 +17,7 @@ import org.chromium.weblayer_private.interfaces.ObjectWrapper;
/** /**
* Delegates service calls to the chrome service implementation. * Delegates service calls to the chrome service implementation.
*/ */
@SuppressWarnings("JavadocType")
public abstract class ChildProcessService extends Service { public abstract class ChildProcessService extends Service {
private IChildProcessService mImpl; private IChildProcessService mImpl;
......
...@@ -125,43 +125,40 @@ public class WebLayerShellActivity extends FragmentActivity { ...@@ -125,43 +125,40 @@ public class WebLayerShellActivity extends FragmentActivity {
Fragment fragment = getOrCreateBrowserFragment(savedInstanceState); Fragment fragment = getOrCreateBrowserFragment(savedInstanceState);
mBrowser = Browser.fromFragment(fragment); mBrowser = Browser.fromFragment(fragment);
mBrowser.getActiveTab().setFullscreenCallback( mBrowser.getActiveTab().setFullscreenCallback(new FullscreenCallback() {
new FullscreenCallback() { private int mSystemVisibilityToRestore;
private int mSystemVisibilityToRestore;
@Override @Override
public void onEnterFullscreen(Runnable exitFullscreenRunnable) { public void onEnterFullscreen(Runnable exitFullscreenRunnable) {
// This comes from Chrome code to avoid an extra resize. // This comes from Chrome code to avoid an extra resize.
final WindowManager.LayoutParams attrs = getWindow().getAttributes(); final WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; attrs.flags |= WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
getWindow().setAttributes(attrs); getWindow().setAttributes(attrs);
View decorView = getWindow().getDecorView(); View decorView = getWindow().getDecorView();
// Caching the system ui visibility is ok for shell, but likely not ok for // Caching the system ui visibility is ok for shell, but likely not ok for
// real code. // real code.
mSystemVisibilityToRestore = decorView.getSystemUiVisibility(); mSystemVisibilityToRestore = decorView.getSystemUiVisibility();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); }
}
@Override @Override
public void onExitFullscreen() { public void onExitFullscreen() {
View decorView = getWindow().getDecorView(); View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(mSystemVisibilityToRestore); decorView.setSystemUiVisibility(mSystemVisibilityToRestore);
final WindowManager.LayoutParams attrs = getWindow().getAttributes(); final WindowManager.LayoutParams attrs = getWindow().getAttributes();
if ((attrs.flags & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) if ((attrs.flags & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) != 0) {
!= 0) { attrs.flags &= ~WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
attrs.flags &= ~WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; getWindow().setAttributes(attrs);
getWindow().setAttributes(attrs); }
} }
} });
});
mProfile = mBrowser.getProfile(); mProfile = mBrowser.getProfile();
mBrowser.setTopView(mTopContentsContainer); mBrowser.setTopView(mTopContentsContainer);
......
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