Commit ce886003 authored by Kuo Jen Wei's avatar Kuo Jen Wei Committed by Commit Bot

[CCA] Convert background_ops.js into ES6 module.

Bug: 141518780
Test: Pass closure compiler check, tast run <DUT> 'camera.CCAUI*' on both HALv1
and v3 devices.

Change-Id: I10d4a870ba2495b0338e412dcdf1791129868c56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989287Reviewed-by: default avatarShik Chen <shik@chromium.org>
Commit-Queue: Kuo Jen Wei <inker@chromium.org>
Auto-Submit: Kuo Jen Wei <inker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728832}
parent 660a29da
......@@ -2,23 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
/**
* Namespace for the Camera app.
*/
var cca = cca || {};
/**
* Namespace for the background page.
*/
cca.bg = cca.bg || {};
// eslint-disable-next-line no-unused-vars
import {Intent} from './intent.js';
// eslint-disable-next-line no-unused-vars
import {PerfLogger} from './perf.js';
/**
* Operations supported by foreground window.
* @interface
*/
cca.bg.ForegroundOps = class {
export class ForegroundOps {
/**
* Suspend foreground window.
* @return {!Promise}
......@@ -31,29 +24,29 @@ cca.bg.ForegroundOps = class {
* @abstract
*/
resume() {}
};
}
/**
* Operations supported by background window.
* @interface
*/
cca.bg.BackgroundOps = class {
export class BackgroundOps {
/**
* Sets the implementation of ForegroundOps from foreground window.
* @param {!cca.bg.ForegroundOps} ops
* @param {!ForegroundOps} ops
*/
bindForegroundOps(ops) {}
/**
* Gets intent associate with cca.bg.Window object.
* @return {?cca.intent.Intent}
* Gets intent associate with CCA Window object.
* @return {?Intent}
* @abstract
*/
getIntent() {}
/**
* Gets the perf logger associate with cca.bg.Window object.
* @return {!cca.perf.PerfLogger}
* Gets the perf logger associate with CCA Window object.
* @return {!PerfLogger}
* @abstract
*/
getPerfLogger() {}
......@@ -69,4 +62,9 @@ cca.bg.BackgroundOps = class {
* @abstract
*/
notifySuspension() {}
};
}
/** @const */
cca.bg.ForegroundOps = ForegroundOps;
/** @const */
cca.bg.BackgroundOps = BackgroundOps;
......@@ -9,6 +9,7 @@
// eslint-disable-next-line no-unused-vars
var cca = {
bg: {},
device: {},
intent: {},
metrics: {},
......
......@@ -12,7 +12,6 @@
<script type="module" src="../js/type.js"></script>
<script type="module" src="../js/perf.js"></script>
<script type="module" src="../js/intent.js"></script>
<script defer src="../js/background_ops.js"></script>
<script defer src="../js/background.js"></script>
</head>
</html>
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