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