diff options
author | ben <ben@chromium.org> | 2015-06-11 16:38:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-11 23:38:36 +0000 |
commit | 05d2eeaef48e3ebb83b20dbf3b915ba4b0739fc2 (patch) | |
tree | 4093fd65800f71b66788970da25f8d2db1f938a6 /mandoline/tools | |
parent | 8ac3722706a07d6bd648359987510833535319ab (diff) | |
download | chromium_src-05d2eeaef48e3ebb83b20dbf3b915ba4b0739fc2.zip chromium_src-05d2eeaef48e3ebb83b20dbf3b915ba4b0739fc2.tar.gz chromium_src-05d2eeaef48e3ebb83b20dbf3b915ba4b0739fc2.tar.bz2 |
Allow Mandoline to load URLs via Intent while its singleTask activity is still running.
- Requires implementing onNewIntent in the activity. This seemed unnecessary/unneeded in MojoShellActivity so I took this opportunity to fork the activity impl and provide a Mandoline-specific implementation.
- This required additional paramaterization of some of the run scripts to support a different package (org.chromium.mandoline) and start activity.
- Added an interface LaunchHandler that allows the shell embedder to connect to the browser & pass the subsequently requested URLs along.
- Added a script that only installs Mandoline on the device and doesn't run it. Not all pushes need to be run (e.g. when debugging launch via intent).
- Renamed/moved the run/install scripts to a subdir for easier autocomplete.
- Moved the Omnibox and ViewEmbedder interfaces into the canonical public/interfaces subdir along with LaunchHandler.
- Light cleanup in ShellMain - ShellMain.Start() can no longer fail.
R=sky@chromium.org
Review URL: https://codereview.chromium.org/1177893002
Cr-Commit-Position: refs/heads/master@{#334079}
Diffstat (limited to 'mandoline/tools')
-rwxr-xr-x | mandoline/tools/android/install_mandoline.py | 45 | ||||
-rwxr-xr-x | mandoline/tools/android/run_mandoline.py (renamed from mandoline/tools/android_run_mandoline.py) | 11 |
2 files changed, 53 insertions, 3 deletions
diff --git a/mandoline/tools/android/install_mandoline.py b/mandoline/tools/android/install_mandoline.py new file mode 100755 index 0000000..3cf465b --- /dev/null +++ b/mandoline/tools/android/install_mandoline.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# Copyright 2014 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. + +import argparse +import logging +import os +import sys + +sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), + os.pardir, os.pardir, os.pardir, 'mojo', + 'tools')) + +from mopy.android import AndroidShell +from mopy.config import Config + +USAGE = ("install_mandoline.py [<shell-and-app-args>]") + +def main(): + logging.basicConfig() + + parser = argparse.ArgumentParser(usage=USAGE) + + debug_group = parser.add_mutually_exclusive_group() + debug_group.add_argument('--debug', help='Debug build (default)', + default=True, action='store_true') + debug_group.add_argument('--release', help='Release build', default=False, + dest='debug', action='store_false') + parser.add_argument('--target-cpu', help='CPU architecture to run for.', + choices=['x64', 'x86', 'arm'], default='arm') + parser.add_argument('--device', help='Serial number of the target device.') + runner_args, args = parser.parse_known_args() + + config = Config(target_os=Config.OS_ANDROID, + target_cpu=runner_args.target_cpu, + is_debug=runner_args.debug, + apk_name="Mandoline.apk") + shell = AndroidShell(config) + shell.InitShell(None, runner_args.device) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/mandoline/tools/android_run_mandoline.py b/mandoline/tools/android/run_mandoline.py index 71ac9ad3..78a3d90 100755 --- a/mandoline/tools/android_run_mandoline.py +++ b/mandoline/tools/android/run_mandoline.py @@ -9,12 +9,13 @@ import os import sys sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), - os.pardir, os.pardir, 'mojo', 'tools')) + os.pardir, os.pardir, os.pardir, 'mojo', + 'tools')) from mopy.android import AndroidShell from mopy.config import Config -USAGE = ("android_run_mandoline.py [<shell-and-app-args>] [<mojo-app>]") +USAGE = ("run_mandoline.py [<shell-and-app-args>] [<start-page-url>]") def main(): logging.basicConfig() @@ -40,7 +41,11 @@ def main(): shell = AndroidShell(config) shell.InitShell(None, runner_args.device) p = shell.ShowLogs() - shell.StartShell(args, sys.stdout, p.terminate, runner_args.gdb) + shell.StartActivity('MandolineActivity', + args, + sys.stdout, + p.terminate, + runner_args.gdb) return 0 |