diff --git a/DEPS b/DEPS
index d97abb225b3a..5f0d65435518 100644
--- a/DEPS
+++ b/DEPS
@@ -1413,7 +1413,19 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/jdk',
- 'version': '2Of9Pe_OdO4xoAATuiLDiMVNebKTNO3WrwJGqil4RosC',
+ 'version': 'U-h0kbYoIUjL__n_sfiudzFLH7-C9vKVsLSOA2XHkBEC',
+ },
+ ],
+ # Needed on Linux for use on chromium_presubmit (for checkstyle).
+ 'condition': 'checkout_android or checkout_linux',
+ 'dep_type': 'cipd',
+ },
+
+ 'src/third_party/jdk/current': {
+ 'packages': [
+ {
+ 'package': 'chromium/third_party/jdk',
+ 'version': 'U-h0kbYoIUjL__n_sfiudzFLH7-C9vKVsLSOA2XHkBEC',
},
],
# Needed on Linux for use on chromium_presubmit (for checkstyle).
@@ -1735,7 +1747,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/r8',
- 'version': 'iFuVaazPwWVf3lFPwZbgAKcF-mHQhFetogi2J9b5ktYC',
+ 'version': 'lrcfrwv2WpEoHAk051sZiwXxKxnNIUTYYEwM3oBDlhMC',
},
],
'condition': 'checkout_android',
@@ -1749,7 +1761,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/r8',
- 'version': 'PwglNZFRNPkBBXdnY9NfrZFk2ULWDTRxhV9rl2kvkpUC',
+ 'version': 'zh70w_Qc37LtNjNFZAOnZVT6jxYseh_1UEkt_lwbRuQC',
},
],
'condition': 'checkout_android',
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 434dc918c8e3..dc8265516ddd 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -4104,6 +4104,7 @@ if (enable_nocompile_tests) {
if (is_android || is_robolectric) {
generate_jni("base_jni_headers") {
+ jni_prefix = "cobalt"
sources = [
"android/java/src/org/chromium/base/ApkAssets.java",
"android/java/src/org/chromium/base/ApplicationStatus.java",
diff --git a/base/android/java/src/org/chromium/base/ApkAssets.java b/base/android/java/src/org/chromium/base/ApkAssets.java
index 407438a89e45..92d565688cff 100644
--- a/base/android/java/src/org/chromium/base/ApkAssets.java
+++ b/base/android/java/src/org/chromium/base/ApkAssets.java
@@ -26,6 +26,7 @@ public class ApkAssets {
@CalledByNative
public static long[] open(String fileName, String splitName) {
+ Log.e(LOGTAG, "here in ApkAssets_open "+fileName+", "+splitName);
AssetFileDescriptor afd = null;
try {
Context context = ContextUtils.getApplicationContext();
diff --git a/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java b/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java
index f1b1c8c07183..b210f75027a6 100644
--- a/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java
+++ b/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java
@@ -99,12 +99,12 @@ public SourceVersion getSupportedSourceVersion() {
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
super.init(processingEnv);
- if (processingEnv.getOptions().containsKey(PACKAGE_PREFIX_OPTION)) {
+ // if (processingEnv.getOptions().containsKey(PACKAGE_PREFIX_OPTION)) {
mGenJniClassName = ClassName.get(
- String.format("%s.%s", processingEnv.getOptions().get(PACKAGE_PREFIX_OPTION),
+ String.format("%s.%s", "cobalt",
mGenJniClassName.packageName()),
mGenJniClassName.simpleName());
- }
+ // }
}
/**
@@ -236,7 +236,7 @@ String getNativeMethodName(String packageName, String className, String oldMetho
// e.g. org.chromium.base.Foo_Class.bar
// => org_chromium_base_Foo_1Class_bar()
final String packagePrefix =
- processingEnv.getOptions().getOrDefault(PACKAGE_PREFIX_OPTION, "");
+ processingEnv.getOptions().getOrDefault(PACKAGE_PREFIX_OPTION, "cobalt");
return (packagePrefix.length() > 0
? String.format(
"%s.%s.%s.%s", packagePrefix, packageName, className, oldMethodName)
diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py
index b739c86d1547..403d8228ffaa 100755
--- a/base/android/jni_generator/jni_generator.py
+++ b/base/android/jni_generator/jni_generator.py
@@ -414,7 +414,10 @@ def JavaToJni(self, param):
'Inner class (%s) can not be imported '
'and used by JNI (%s). Please import the outer '
'class and use Outer.Inner instead.' % (qualified_name, param))
- return prefix + qualified_name + ';'
+ ret = prefix + qualified_name + ';'
+ ret = ret.replace('Lorg', 'Lcobalt/org')
+ print(ret)
+ return ret
# Is it an inner class from an outer class import? (e.g. referencing
# Class.Inner from import pkg.Class).
@@ -1551,7 +1554,7 @@ def GenerateJNIHeader(input_file, output_file, options):
# The current package-prefix implementation does not support adding
# prefix to java compiled classes. The current support is only for
# java source files.
- assert not options.package_prefix
+ options.package_prefix = None
jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, options)
content = jni_from_javap.GetContent()
else:
@@ -1685,6 +1688,7 @@ def main():
parser.add_argument('--stamp',
help='Process --prev_output_dir and touch this file.')
args = parser.parse_args()
+ args.package_prefix = 'cobalt'
# Kotlin files are not supported by jni_generator.py, but they do end up in
# the list of source files passed to jni_generator.py.
input_files = [f for f in args.input_files if not f.endswith('.kt')]
diff --git a/base/android/jni_generator/jni_registration_generator.py b/base/android/jni_generator/jni_registration_generator.py
index 4cb51c2e823d..27e25a35845c 100755
--- a/base/android/jni_generator/jni_registration_generator.py
+++ b/base/android/jni_generator/jni_registration_generator.py
@@ -891,6 +891,7 @@ def main(argv):
'Adds a prefix to the classes fully qualified-name. Effectively changing a class name from'
'foo.bar -> prefix.foo.bar')
args = arg_parser.parse_args(build_utils.ExpandFileArgs(argv[1:]))
+ args.package_prefix = 'cobalt'
if not args.enable_proxy_mocks and args.require_mocks:
arg_parser.error(
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index 3d5731bce593..c7cf2730f3a8 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -287,7 +287,8 @@ if (is_android || is_chromeos) {
enable_incremental_d8 = true
# Use hashed symbol names to reduce JNI symbol overhead.
- use_hashed_jni_names = !is_java_debug
+ # Cobalt avoids hash names to facilitate Kimono build.
+ use_hashed_jni_names = false
# Enables JNI multiplexing to reduce JNI native methods overhead.
allow_jni_multiplexing = false
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index fe3f7838c92b..6aaf66043dcd 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -228,6 +228,10 @@ if (enable_java_templates) {
args += [ "--split_name=${invoker.split_name}" ]
}
+ if (defined(invoker.jni_prefix)) {
+ args += ["--package_prefix=${invoker.jni_prefix}" ]
+ }
+
outputs = []
foreach(_name, _input_names) {
_name = get_path_info(_name, "name") + "_jni.h"
@@ -431,6 +435,10 @@ if (enable_java_templates && is_android) {
args += [ "--use-proxy-hash" ]
}
+ #if (defined(invoker.jni_prefix)) {
+ # args += ["--package_prefix=${invoker.jni_prefix}" ]
+ #}
+
if (defined(invoker.enable_native_mocks) && invoker.enable_native_mocks) {
args += [ "--enable-proxy-mocks" ]
diff --git a/cobalt/android/BUILD.gn b/cobalt/android/BUILD.gn
index d0664b718ad8..e41abb675230 100644
--- a/cobalt/android/BUILD.gn
+++ b/cobalt/android/BUILD.gn
@@ -15,6 +15,8 @@ android_resources("cobalt_java_resources") {
"apk/app/src/app/res/mipmap-xxhdpi/ic_app.png",
"apk/app/src/app/res/values/strings.xml",
"apk/app/src/main/res/layout/coat_error_dialog.xml",
+ "apk/app/src/main/res/layout/content_shell_activity.xml",
+ "apk/app/src/main/res/layout/shell_view.xml",
"apk/app/src/main/res/values/colors.xml",
"apk/app/src/main/res/values/ids.xml",
"apk/app/src/main/res/values/overlayable.xml",
@@ -44,7 +46,8 @@ android_library("cobalt_apk_java") {
"//components/embedder_support/android:view_java",
"//content/public/android:content_java",
"//content/shell/android:content_shell_apk_java",
- "//content/shell/android:content_shell_apk_resources",
+
+ #"//content/shell/android:content_shell_apk_resources",
"//content/shell/android:content_shell_java",
"//content/shell/android:content_shell_manifest",
"//media/capture/video/android:capture_java",
diff --git a/cobalt/android/apk/app/src/app/java/dev/cobalt/app/CobaltApplication.java b/cobalt/android/apk/app/src/app/java/dev/cobalt/app/CobaltApplication.java
index 7bae30a55a94..9fdb75921ae6 100644
--- a/cobalt/android/apk/app/src/app/java/dev/cobalt/app/CobaltApplication.java
+++ b/cobalt/android/apk/app/src/app/java/dev/cobalt/app/CobaltApplication.java
@@ -17,11 +17,18 @@
import android.app.Application;
import android.content.Context;
import dev.cobalt.coat.StarboardBridge;
-
-import org.chromium.content_shell_apk.ContentShellApplication;
+import org.chromium.base.ApplicationStatus;
+import org.chromium.base.CommandLine;
+import org.chromium.base.ContextUtils;
+import org.chromium.base.PathUtils;
+import org.chromium.base.library_loader.LibraryLoader;
+import org.chromium.base.library_loader.LibraryProcessType;
+import org.chromium.ui.base.ResourceBundle;
/** Android Application hosting the Starboard application. */
-public class CobaltApplication extends ContentShellApplication implements StarboardBridge.HostApplication {
+public class CobaltApplication extends Application implements StarboardBridge.HostApplication {
+ private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "content_shell";
+
StarboardBridge starboardBridge;
@Override
@@ -33,4 +40,19 @@ public void setStarboardBridge(StarboardBridge starboardBridge) {
public StarboardBridge getStarboardBridge() {
return starboardBridge;
}
+
+ @Override
+ protected void attachBaseContext(Context base) {
+ super.attachBaseContext(base);
+ boolean isBrowserProcess = !ContextUtils.getProcessName().contains(":");
+ ContextUtils.initApplicationContext(this);
+ ResourceBundle.setNoAvailableLocalePaks();
+ LibraryLoader.getInstance().setLibraryProcessType(isBrowserProcess
+ ? LibraryProcessType.PROCESS_BROWSER
+ : LibraryProcessType.PROCESS_CHILD);
+ if (isBrowserProcess) {
+ PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
+ ApplicationStatus.initialize(this);
+ }
+ }
}
diff --git a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
index b04f7bdff355..13524eac0fae 100644
--- a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
@@ -78,6 +78,7 @@ public abstract class CobaltActivity extends Activity {
private static final String ACTIVE_SHELL_URL_KEY = "activeUrl";
public static final String COMMAND_LINE_ARGS_KEY = "commandLineArgs";
+ public static final String COMMAND_LINE_FILE = "/data/local/tmp/content-shell-command-line";
private static final Pattern URL_PARAM_PATTERN = Pattern.compile("^[a-zA-Z0-9_=]*$");
@@ -102,7 +103,7 @@ public abstract class CobaltActivity extends Activity {
protected void createContent(final Bundle savedInstanceState) {
// Initializing the command line must occur before loading the library.
if (!CommandLine.isInitialized()) {
- ((CobaltApplication) getApplication()).initCommandLine();
+ CommandLine.initFromFile(COMMAND_LINE_FILE);
// Note that appendSwitchesAndArguments excludes cobaltCommandLineParams[0]
// as the program name, and all other arguments SHOULD start with '--'.
@@ -231,7 +232,7 @@ private void finishInitialization(Bundle savedInstanceState) {
mShellManager.getContentViewRenderView().setOverlayVideoMode(true);
mShellManager.launchShell(shellUrl);
- toggleFullscreenMode(true);
+ // toggleFullscreenMode(true);
}
// Initially copied from ContentShellActiviy.java
@@ -287,10 +288,10 @@ protected void shellHandleIntent(Intent intent) {
}
}
- protected void toggleFullscreenMode(boolean enterFullscreen) {
- LinearLayout toolBar = (LinearLayout) findViewById(R.id.toolbar);
- toolBar.setVisibility(enterFullscreen ? View.GONE : View.VISIBLE);
- }
+ // protected void toggleFullscreenMode(boolean enterFullscreen) {
+ // LinearLayout toolBar = (LinearLayout) findViewById(R.id.toolbar);
+ // toolBar.setVisibility(enterFullscreen ? View.GONE : View.VISIBLE);
+ // }
// Initially copied from ContentShellActiviy.java
@Override
diff --git a/cobalt/android/apk/app/src/main/res/layout/content_shell_activity.xml b/cobalt/android/apk/app/src/main/res/layout/content_shell_activity.xml
new file mode 100644
index 000000000000..45937868fc61
--- /dev/null
+++ b/cobalt/android/apk/app/src/main/res/layout/content_shell_activity.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/cobalt/android/apk/app/src/main/res/layout/shell_view.xml b/cobalt/android/apk/app/src/main/res/layout/shell_view.xml
new file mode 100644
index 000000000000..f89ed29cfebd
--- /dev/null
+++ b/cobalt/android/apk/app/src/main/res/layout/shell_view.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cobalt/android/apk/app/src/main/res/values/strings.xml b/cobalt/android/apk/app/src/main/res/values/strings.xml
index 8b7369fbca0a..4f6a11039443 100644
--- a/cobalt/android/apk/app/src/main/res/values/strings.xml
+++ b/cobalt/android/apk/app/src/main/res/values/strings.xml
@@ -1,33 +1,26 @@
-
-
- Can\'t connect right now
-
- Try again
-
- Open network settings
-
- Account not available.
-
- Account authorization failed.
-
- Account not available:\n%1$s
-
- Sign in requires Contacts permission to be granted in system settings.
+ Type URL Here
+ Initialization failed.
+
+ Can\'t connect right now
+
+ Try again
+
+ Open network settings
+
+ Account not available.
+
+ Account authorization failed.
+
+ Account not available:\n%1$s
+
+ Sign in requires Contacts permission to be granted in system settings.
diff --git a/cobalt/build/configs/android_common.gn b/cobalt/build/configs/android_common.gn
index 1507836bd621..e41caebedb65 100644
--- a/cobalt/build/configs/android_common.gn
+++ b/cobalt/build/configs/android_common.gn
@@ -3,6 +3,9 @@ import("//cobalt/build/configs/common.gn")
# This flag comes from build/config/compiler/compiler.gni
# TODO(b/380339614): Remove this flag after resolving build errors.
treat_warnings_as_errors = false
+# hashed jni names make build artifact opaque for Kimono build.
+use_hashed_jni_names = false
+use_errorprone_java_compiler = false
# Overriding flag from //media/media_options.gni.
# Cobalt doesn't use //third_party/ffmpeg.
diff --git a/cobalt/build/gn.py b/cobalt/build/gn.py
index a450f8d44c15..15a7df6dcc54 100755
--- a/cobalt/build/gn.py
+++ b/cobalt/build/gn.py
@@ -87,7 +87,7 @@ def write_build_args(build_args_path, original_lines, dict_settings,
if os.getenv('IS_CI', default='0') == '1':
f.write(f'cc_wrapper = "{CC_WRAPPER}" {gen_comment}\n')
else:
- f.write(f'use_remoteexec = true {gen_comment}\n')
+ f.write(f'use_remoteexec = false {gen_comment}\n')
f.write(f'build_type = "{build_type}" {gen_comment}\n')
for key, value in _BUILD_TYPES[build_type].items():
f.write(f'{key} = {value} {gen_comment}\n')
diff --git a/components/messages/android/message_wrapper.cc b/components/messages/android/message_wrapper.cc
index 1b18b7b9a94f..4ab68960156a 100644
--- a/components/messages/android/message_wrapper.cc
+++ b/components/messages/android/message_wrapper.cc
@@ -125,7 +125,7 @@ void MessageWrapper::AddSecondaryMenuItem(int item_id,
JNIEnv* env = base::android::AttachCurrentThread();
base::android::ScopedJavaLocalRef jitem_text =
base::android::ConvertUTF16ToJavaString(env, item_text);
- Java_MessageWrapper_addSecondaryMenuItemOCUMPM_I_I_JLS(
+ Java_MessageWrapper_addSecondaryMenuItemCOCUMPM_I_I_JLS(
env, java_message_wrapper_, item_id, resource_id, jitem_text);
}
@@ -140,7 +140,7 @@ void MessageWrapper::AddSecondaryMenuItem(
base::android::ConvertUTF16ToJavaString(env, item_text);
base::android::ScopedJavaLocalRef jitem_desc =
base::android::ConvertUTF16ToJavaString(env, item_description);
- Java_MessageWrapper_addSecondaryMenuItemOCUMPM_I_I_JLS_JLS(
+ Java_MessageWrapper_addSecondaryMenuItemCOCUMPM_I_I_JLS_JLS(
env, java_message_wrapper_, item_id, resource_id, jitem_text, jitem_desc);
}
diff --git a/content/browser/android/app_web_message_port.cc b/content/browser/android/app_web_message_port.cc
index eeff86b66c4c..d46ef700872f 100644
--- a/content/browser/android/app_web_message_port.cc
+++ b/content/browser/android/app_web_message_port.cc
@@ -39,7 +39,7 @@ base::android::ScopedJavaLocalRef CreateJavaMessagePort(
return base::android::ToTypedJavaArrayOfObjects(
env, base::make_span(j_descriptors),
base::android::GetClass(
- env, kClassPath_org_chromium_content_browser_AppWebMessagePort));
+ env, kClassPath_cobalt_org_chromium_content_browser_AppWebMessagePort));
}
// static
diff --git a/content/browser/renderer_host/render_frame_host_android.cc b/content/browser/renderer_host/render_frame_host_android.cc
index a9eec345d6b9..c22be92b9e43 100644
--- a/content/browser/renderer_host/render_frame_host_android.cc
+++ b/content/browser/renderer_host/render_frame_host_android.cc
@@ -132,7 +132,7 @@ ScopedJavaLocalRef RenderFrameHostAndroid::GetAllRenderFrameHosts(
render_frame_host_->ForEachRenderFrameHost(
[&frames](RenderFrameHostImpl* rfh) { frames.push_back(rfh); });
jclass clazz =
- org_chromium_content_browser_framehost_RenderFrameHostImpl_clazz(env);
+ cobalt_org_chromium_content_browser_framehost_RenderFrameHostImpl_clazz(env);
jobjectArray jframes = env->NewObjectArray(frames.size(), clazz, nullptr);
for (size_t i = 0; i < frames.size(); i++) {
ScopedJavaLocalRef frame = frames[i]->GetJavaRenderFrameHost();
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc
index 578730cc2ad1..d0ae8885898d 100644
--- a/content/browser/web_contents/web_contents_android.cc
+++ b/content/browser/web_contents/web_contents_android.cc
@@ -417,7 +417,7 @@ ScopedJavaLocalRef WebContentsAndroid::GetInnerWebContents(
std::vector inner_web_contents =
web_contents_->GetInnerWebContents();
jclass clazz =
- org_chromium_content_browser_webcontents_WebContentsImpl_clazz(env);
+ cobalt_org_chromium_content_browser_webcontents_WebContentsImpl_clazz(env);
jobjectArray array =
env->NewObjectArray(inner_web_contents.size(), clazz, nullptr);
for (size_t i = 0; i < inner_web_contents.size(); i++) {
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 d8633ce98d69..c6881d0e13af 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
@@ -55,7 +55,7 @@ public class Shell extends LinearLayout {
private final Runnable mClearProgressRunnable = new Runnable() {
@Override
public void run() {
- mProgressDrawable.setLevel(0);
+ // mProgressDrawable.setLevel(0);
}
};
@@ -150,50 +150,50 @@ protected void onFinishInflate() {
super.onFinishInflate();
View toolbar = findViewById(R.id.toolbar);
- mProgressDrawable = (ClipDrawable) toolbar.getBackground();
+ // mProgressDrawable = (ClipDrawable) toolbar.getBackground();
initializeUrlField();
initializeNavigationButtons();
}
private void initializeUrlField() {
- mUrlTextView = (EditText) findViewById(R.id.url);
- 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)) {
- return false;
- }
- loadUrl(mUrlTextView.getText().toString());
- setKeyboardVisibilityForUrl(false);
- getContentView().requestFocus();
- return true;
- }
- });
- mUrlTextView.setOnFocusChangeListener(new OnFocusChangeListener() {
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- setKeyboardVisibilityForUrl(hasFocus);
- mNextButton.setVisibility(hasFocus ? GONE : VISIBLE);
- mPrevButton.setVisibility(hasFocus ? GONE : VISIBLE);
- mStopReloadButton.setVisibility(hasFocus ? GONE : VISIBLE);
- if (!hasFocus) {
- mUrlTextView.setText(mWebContents.getVisibleUrl().getSpec());
- }
- }
- });
- mUrlTextView.setOnKeyListener(new OnKeyListener() {
- @Override
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK) {
- getContentView().requestFocus();
- return true;
- }
- return false;
- }
- });
- mUrlTextView.setPrivateImeOptions(IME_OPTION_RESTRICT_STYLUS_WRITING_AREA);
+ // mUrlTextView = (EditText) findViewById(R.id.url);
+ // 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)) {
+ // return false;
+ // }
+ // loadUrl(mUrlTextView.getText().toString());
+ // setKeyboardVisibilityForUrl(false);
+ // getContentView().requestFocus();
+ // return true;
+ // }
+ // });
+ // mUrlTextView.setOnFocusChangeListener(new OnFocusChangeListener() {
+ // @Override
+ // public void onFocusChange(View v, boolean hasFocus) {
+ // setKeyboardVisibilityForUrl(hasFocus);
+ // // mNextButton.setVisibility(hasFocus ? GONE : VISIBLE);
+ // // mPrevButton.setVisibility(hasFocus ? GONE : VISIBLE);
+ // // mStopReloadButton.setVisibility(hasFocus ? GONE : VISIBLE);
+ // // if (!hasFocus) {
+ // // mUrlTextView.setText(mWebContents.getVisibleUrl().getSpec());
+ // // }
+ // }
+ // });
+ // mUrlTextView.setOnKeyListener(new OnKeyListener() {
+ // @Override
+ // public boolean onKey(View v, int keyCode, KeyEvent event) {
+ // if (keyCode == KeyEvent.KEYCODE_BACK) {
+ // getContentView().requestFocus();
+ // return true;
+ // }
+ // return false;
+ // }
+ // });
+ // mUrlTextView.setPrivateImeOptions(IME_OPTION_RESTRICT_STYLUS_WRITING_AREA);
}
/**
@@ -228,43 +228,43 @@ public static String sanitizeUrl(String url) {
}
private void initializeNavigationButtons() {
- mPrevButton = (ImageButton) findViewById(R.id.prev);
- mPrevButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mNavigationController.canGoBack()) mNavigationController.goBack();
- }
- });
-
- mNextButton = (ImageButton) findViewById(R.id.next);
- mNextButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mNavigationController.canGoForward()) mNavigationController.goForward();
- }
- });
- mStopReloadButton = (ImageButton) findViewById(R.id.stop_reload_button);
- mStopReloadButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mLoading) mWebContents.stop();
- else mNavigationController.reload(true);
- }
- });
+ // mPrevButton = (ImageButton) findViewById(R.id.prev);
+ // mPrevButton.setOnClickListener(new OnClickListener() {
+ // @Override
+ // public void onClick(View v) {
+ // if (mNavigationController.canGoBack()) mNavigationController.goBack();
+ // }
+ // });
+
+ // mNextButton = (ImageButton) findViewById(R.id.next);
+ // mNextButton.setOnClickListener(new OnClickListener() {
+ // @Override
+ // public void onClick(View v) {
+ // if (mNavigationController.canGoForward()) mNavigationController.goForward();
+ // }
+ // });
+ // mStopReloadButton = (ImageButton) findViewById(R.id.stop_reload_button);
+ // mStopReloadButton.setOnClickListener(new OnClickListener() {
+ // @Override
+ // public void onClick(View v) {
+ // if (mLoading) mWebContents.stop();
+ // else mNavigationController.reload(true);
+ // }
+ // });
}
@SuppressWarnings("unused")
@CalledByNative
private void onUpdateUrl(String url) {
- mUrlTextView.setText(url);
+ // mUrlTextView.setText(url);
}
@SuppressWarnings("unused")
@CalledByNative
private void onLoadProgressChanged(double progress) {
- removeCallbacks(mClearProgressRunnable);
- mProgressDrawable.setLevel((int) (10000.0 * progress));
- if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
+ // removeCallbacks(mClearProgressRunnable);
+ // mProgressDrawable.setLevel((int) (10000.0 * progress));
+ // if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
}
@CalledByNative
@@ -283,12 +283,12 @@ private boolean isFullscreenForTabOrPending() {
@CalledByNative
private void setIsLoading(boolean loading) {
mLoading = loading;
- if (mLoading) {
- mStopReloadButton
- .setImageResource(android.R.drawable.ic_menu_close_clear_cancel);
- } else {
- mStopReloadButton.setImageResource(R.drawable.ic_refresh);
- }
+ // if (mLoading) {
+ // mStopReloadButton
+ // .setImageResource(android.R.drawable.ic_menu_close_clear_cancel);
+ // } else {
+ // mStopReloadButton.setImageResource(R.drawable.ic_refresh);
+ // }
}
public ShellViewAndroidDelegate getViewAndroidDelegate() {
@@ -315,7 +315,7 @@ private void initFromNativeTabContents(WebContents webContents) {
.setActionModeCallback(defaultActionCallback());
mNavigationController = mWebContents.getNavigationController();
if (getParent() != null) mWebContents.onShow();
- mUrlTextView.setText(mWebContents.getVisibleUrl().getSpec());
+ // mUrlTextView.setText(mWebContents.getVisibleUrl().getSpec());
((FrameLayout) findViewById(R.id.contentview_holder)).addView(cv,
new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
@@ -382,11 +382,11 @@ public void setOverayModeChangedCallbackForTesting(Callback callback) {
*/
@CalledByNative
private void enableUiControl(int controlId, boolean enabled) {
- if (controlId == 0) {
- mPrevButton.setEnabled(enabled);
- } else if (controlId == 1) {
- mNextButton.setEnabled(enabled);
- }
+ // if (controlId == 0) {
+ // mPrevButton.setEnabled(enabled);
+ // } else if (controlId == 1) {
+ // mNextButton.setEnabled(enabled);
+ // }
}
/**
@@ -405,13 +405,13 @@ public WebContents getWebContents() {
}
private void setKeyboardVisibilityForUrl(boolean visible) {
- InputMethodManager imm = (InputMethodManager) getContext().getSystemService(
- Context.INPUT_METHOD_SERVICE);
- if (visible) {
- imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT);
- } else {
- imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0);
- }
+ // InputMethodManager imm = (InputMethodManager) getContext().getSystemService(
+ // Context.INPUT_METHOD_SERVICE);
+ // if (visible) {
+ // imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT);
+ // } else {
+ // imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0);
+ // }
}
@NativeMethods
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
index 4c98a452302e..23ef177f99fb 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
@@ -96,9 +96,19 @@ private Object createShell(long nativeShellPtr) {
mContentViewRenderView = new ContentViewRenderView(getContext());
mContentViewRenderView.onNativeLibraryLoaded(mWindow);
}
- LayoutInflater inflater =
- (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
+ // LayoutInflater inflater =
+ // (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ // inflater.inflate(R.layout.shell_view, null);
+ // Shell shellView = (Shell) findViewById(R.layout.shell_view);
+ Shell shellView = new Shell(getContext(), null);
+ shellView.setId(R.id.container);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.WRAP_CONTENT);
+ FrameLayout frameLayout = new FrameLayout(getContext());
+ frameLayout.setId(R.id.contentview_holder);
+ shellView.addView(frameLayout);
+
shellView.initialize(nativeShellPtr, mWindow);
// TODO(tedchoc): Allow switching back to these inactive shells.
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
index 1afcdef2ff17..6d2e5104758a 100644
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
@@ -21,8 +21,8 @@
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_shell.Shell;
import org.chromium.content_shell.ShellManager;
-import org.chromium.ui.base.ActivityWindowAndroid;
-import org.chromium.ui.base.IntentRequestTracker;
+// import org.chromium.ui.base.ActivityWindowAndroid;
+// import org.chromium.ui.base.IntentRequestTracker;
/**
* Activity for managing the Content Shell.
@@ -38,10 +38,10 @@ public class ContentShellActivity extends Activity {
private static final String RUN_WEB_TESTS_SWITCH = "run-web-tests";
private ShellManager mShellManager;
- private ActivityWindowAndroid mWindowAndroid;
+ // private ActivityWindowAndroid mWindowAndroid;
private Intent mLastSentIntent;
private String mStartupUrl;
- private IntentRequestTracker mIntentRequestTracker;
+ // private IntentRequestTracker mIntentRequestTracker;
@Override
protected void onCreate(final Bundle savedInstanceState) {
@@ -63,15 +63,15 @@ protected void onCreate(final Bundle savedInstanceState) {
setContentView(R.layout.content_shell_activity);
mShellManager = findViewById(R.id.shell_container);
final boolean listenToActivityState = true;
- mIntentRequestTracker = IntentRequestTracker.createFromActivity(this);
- mWindowAndroid =
- new ActivityWindowAndroid(this, listenToActivityState, mIntentRequestTracker);
- mIntentRequestTracker.restoreInstanceState(savedInstanceState);
- mShellManager.setWindow(mWindowAndroid);
+ // mIntentRequestTracker = IntentRequestTracker.createFromActivity(this);
+ // mWindowAndroid =
+ // new ActivityWindowAndroid(this, listenToActivityState, mIntentRequestTracker);
+ // mIntentRequestTracker.restoreInstanceState(savedInstanceState);
+ // mShellManager.setWindow(mWindowAndroid);
// Set up the animation placeholder to be the SurfaceView. This disables the
// SurfaceView's 'hole' clipping during animations that are notified to the window.
- mWindowAndroid.setAnimationPlaceholderView(
- mShellManager.getContentViewRenderView().getSurfaceView());
+ // mWindowAndroid.setAnimationPlaceholderView(
+ // mShellManager.getContentViewRenderView().getSurfaceView());
mStartupUrl = getUrlFromIntent(getIntent());
if (!TextUtils.isEmpty(mStartupUrl)) {
@@ -130,7 +130,7 @@ protected void onSaveInstanceState(Bundle outState) {
outState.putString(ACTIVE_SHELL_URL_KEY, webContents.getLastCommittedUrl().getSpec());
}
- mIntentRequestTracker.saveInstanceState(outState);
+ // mIntentRequestTracker.saveInstanceState(outState);
}
@Override
@@ -174,7 +174,7 @@ protected void onStart() {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
- mIntentRequestTracker.onActivityResult(requestCode, resultCode, data);
+ // mIntentRequestTracker.onActivityResult(requestCode, resultCode, data);
}
@Override
@@ -186,7 +186,7 @@ public void startActivity(Intent i) {
@Override
protected void onDestroy() {
if (mShellManager != null) mShellManager.destroy();
- mWindowAndroid.destroy();
+ // mWindowAndroid.destroy();
super.onDestroy();
}
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index 1b7843b95921..142ea2f33256 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -167,6 +167,7 @@ base::File OpenV8File(const char* file_name,
base::File file(base::android::OpenApkAsset(path.value(), region_out));
OpenV8FileResult result = file.IsValid() ? OpenV8FileResult::OPENED
: OpenV8FileResult::FAILED_OTHER;
+ LOG(INFO)<<"opened v8 file? "<<(result== OpenV8FileResult::OPENED);
#else
// Re-try logic here is motivated by http://crbug.com/479537
// for A/V on Windows (https://support.microsoft.com/en-us/kb/316609).
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 355767d5e548..311db9ba48d1 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -2312,6 +2312,7 @@ if (is_android) {
"android/java/src/org/chromium/net/ProxyChangeListener.java",
"android/java/src/org/chromium/net/X509Util.java",
]
+ jni_prefix = "cobalt"
}
generate_jni("net_test_jni_headers") {
testonly = true
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
index 9df3df539fc5..5fa16f641466 100644
--- a/ui/android/BUILD.gn
+++ b/ui/android/BUILD.gn
@@ -240,13 +240,23 @@ android_library("ui_utils_java") {
"java/src/org/chromium/ui/KeyboardVisibilityDelegate.java",
"java/src/org/chromium/ui/MotionEventUtils.java",
"java/src/org/chromium/ui/UiUtils.java",
+ "java/src/org/chromium/ui/display/DisplaySwitches.java",
+ "java/src/org/chromium/ui/display/DisplayAndroid.java",
+ "java/src/org/chromium/ui/display/DisplayAndroidManager.java",
+ "java/src/org/chromium/ui/display/PhysicalDisplayAndroid.java",
]
deps = [
+ ":ui_android_jni_headers",
"//base:base_java",
+ "//base:jni_java",
+ "//third_party/androidx:androidx_annotation_annotation_experimental_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_appcompat_appcompat_resources_java",
"//third_party/androidx:androidx_core_core_java",
]
+ annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
+ # srcjar_deps = [ ":java_enums_srcjar" ]
+ resources_package = "org.chromium.ui"
}
android_library("ui_no_recycler_view_java") {
@@ -296,11 +306,7 @@ android_library("ui_no_recycler_view_java") {
"java/src/org/chromium/ui/base/ViewportInsets.java",
"java/src/org/chromium/ui/base/WindowAndroid.java",
"java/src/org/chromium/ui/base/WindowDelegate.java",
- "java/src/org/chromium/ui/display/DisplayAndroid.java",
- "java/src/org/chromium/ui/display/DisplayAndroidManager.java",
- "java/src/org/chromium/ui/display/DisplaySwitches.java",
"java/src/org/chromium/ui/display/DisplayUtil.java",
- "java/src/org/chromium/ui/display/PhysicalDisplayAndroid.java",
"java/src/org/chromium/ui/dragdrop/AnimatedImageDragShadowBuilder.java",
"java/src/org/chromium/ui/dragdrop/DragAndDropBrowserDelegate.java",
"java/src/org/chromium/ui/dragdrop/DragAndDropDelegate.java",
diff --git a/url/android/gurl_android.cc b/url/android/gurl_android.cc
index bf398a13218d..f215b1c792f2 100644
--- a/url/android/gurl_android.cc
+++ b/url/android/gurl_android.cc
@@ -112,7 +112,7 @@ ScopedJavaLocalRef GURLAndroid::EmptyGURL(JNIEnv* env) {
ScopedJavaLocalRef GURLAndroid::ToJavaArrayOfGURLs(
JNIEnv* env,
base::span> v) {
- jclass clazz = org_chromium_url_GURL_clazz(env);
+ jclass clazz = cobalt_org_chromium_url_GURL_clazz(env);
DCHECK(clazz);
jobjectArray joa = env->NewObjectArray(v.size(), clazz, nullptr);
base::android::CheckException(env);