Commit 77ed27ef authored by Justin DeWitt's avatar Justin DeWitt Committed by Commit Bot

Rename SurfaceDependencyProvider [Part 1]

SurfaceDependencyProvider is badly named (since it is application level
dependencies). However, a rename is not possible without breaking the
internal tree for some period of time. So, we will do a 3 sided change.

First step is to move all methods into a properly-named interface
superclass.

Change-Id: I7da10b5bfffb53c2e3b685bdc5b4145f1e83d7c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2261633
Auto-Submit: Justin DeWitt <dewittj@chromium.org>
Commit-Queue: Cathy Li <chili@chromium.org>
Reviewed-by: default avatarCathy Li <chili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782044}
parent b2b10b8d
......@@ -11,6 +11,7 @@ android_library("java") {
"android/java/src/org/chromium/chrome/browser/xsurface/ListContentManager.java",
"android/java/src/org/chromium/chrome/browser/xsurface/ListContentManagerObserver.java",
"android/java/src/org/chromium/chrome/browser/xsurface/ProcessScope.java",
"android/java/src/org/chromium/chrome/browser/xsurface/ProcessScopeDependencyProvider.java",
"android/java/src/org/chromium/chrome/browser/xsurface/SurfaceActionsHandler.java",
"android/java/src/org/chromium/chrome/browser/xsurface/SurfaceDependencyProvider.java",
"android/java/src/org/chromium/chrome/browser/xsurface/SurfaceRenderer.java",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.xsurface;
import android.content.Context;
import androidx.annotation.Nullable;
/**
* Provides application-level dependencies for an external surface.
*
* Note: this will replace SurfaceDependencyProvider and so does not have any methods.
*/
public interface ProcessScopeDependencyProvider {
/** @return the context associated with the application. */
@Nullable
default Context getContext() {
return null;
}
/** Returns the account name of the signed-in user, or the empty string. */
default String getAccountName() {
return "";
}
/** Returns the client instance id for this chrome. */
default String getClientInstanceId() {
return "";
}
/** Returns the collection of currently active experiment ids. */
default int[] getExperimentIds() {
return new int[0];
}
/** @see {Log.e} */
default void logError(String tag, String messageTemplate, Object... args) {}
/** @see {Log.w} */
default void logWarning(String tag, String messageTemplate, Object... args) {}
}
......@@ -4,38 +4,10 @@
package org.chromium.chrome.browser.xsurface;
import android.content.Context;
import androidx.annotation.Nullable;
/**
* Provides logging and context for an external surface.
*
* Note: this will replace SurfaceDependencyProvider and so does not have any methods.
*/
public interface SurfaceDependencyProvider {
/** @return the context associated with the application. */
@Nullable
default Context getContext() {
return null;
}
/** Returns the account name of the signed-in user, or the empty string. */
default String getAccountName() {
return "";
}
/** Returns the client instance id for this chrome. */
default String getClientInstanceId() {
return "";
}
/** Returns the collection of currently active experiment ids. */
default int[] getExperimentIds() {
return new int[0];
}
/** @see {Log.e} */
default void logError(String tag, String messageTemplate, Object... args) {}
/** @see {Log.w} */
default void logWarning(String tag, String messageTemplate, Object... args) {}
}
@Deprecated
public interface SurfaceDependencyProvider extends ProcessScopeDependencyProvider {}
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