Commit 08aa085d authored by dpapad's avatar dpapad Committed by Commit Bot

Settings: Port incompatible_applications_page/ to Polymer 3.

Bug: 1026426
Change-Id: I3c8f1da0776a279d250969a2c2384339b405ae51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076544
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745212}
parent ea7f3b8a
......@@ -240,6 +240,7 @@ group("closure_compile_module") {
if (is_win) {
deps += [
"chrome_cleanup_page:closure_compile_module",
"incompatible_applications_page:closure_compile_module",
]
}
}
......@@ -386,7 +387,6 @@ group("polymer3_elements") {
"clear_browsing_data_dialog:polymer3_elements",
"controls:polymer3_elements",
"downloads_page:polymer3_elements",
"incompatible_applications_page:polymer3_elements",
"languages_page:polymer3_elements",
"on_startup_page:polymer3_elements",
"people_page:polymer3_elements",
......@@ -422,6 +422,7 @@ group("polymer3_elements") {
if (is_win) {
public_deps += [
"chrome_cleanup_page:polymer3_elements",
"incompatible_applications_page:polymer3_elements",
]
}
}
......
......@@ -3,6 +3,9 @@
# found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/polymer/polymer.gni")
import("//ui/webui/resources/tools/js_modulizer.gni")
import("../settings.gni")
js_type_check("closure_compile") {
deps = [
......@@ -33,44 +36,47 @@ js_library("incompatible_application_item") {
]
}
# TODO(crbug.com/1026426): Fix and enable.
#js_type_check("closure_compile_module") {
# is_polymer3 = true
# deps = [
# ":incompatible_application_item.m",
# ":incompatible_applications_browser_proxy.m",
# ":incompatible_applications_page.m",
# ]
#}
js_type_check("closure_compile_module") {
is_polymer3 = true
deps = [
":incompatible_application_item.m",
":incompatible_applications_browser_proxy.m",
":incompatible_applications_page.m",
]
}
js_library("incompatible_application_item.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/incompatible_applications_page/incompatible_application_item.m.js" ]
deps = [
# TODO: Fill those in.
":incompatible_applications_browser_proxy.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:i18n_behavior.m",
]
extra_deps = [ ":incompatible_application_item_module" ]
}
js_library("incompatible_applications_browser_proxy.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_browser_proxy.m.js" ]
deps = [
# TODO: Fill those in.
]
deps = [ "//ui/webui/resources/js:cr.m" ]
externs_list = [ "$externs_path/chrome_send.js" ]
extra_deps = [ ":modulize" ]
}
js_library("incompatible_applications_page.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_page.m.js" ]
deps = [
# TODO: Fill those in.
":incompatible_applications_browser_proxy.m",
"..:i18n_setup.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:i18n_behavior.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
]
extra_deps = [ ":incompatible_applications_page_module" ]
}
import("//tools/polymer/polymer.gni")
group("polymer3_elements") {
deps = [
public_deps = [
":incompatible_application_item_module",
":incompatible_applications_page_module",
":modulize",
......@@ -81,16 +87,26 @@ polymer_modulizer("incompatible_application_item") {
js_file = "incompatible_application_item.js"
html_file = "incompatible_application_item.html"
html_type = "dom-module"
namespace_rewrites =
settings_namespace_rewrites + [ "settings.ActionTypes|ActionTypes" ]
auto_imports = [
"ui/webui/resources/html/assert.html|assertNotReached",
"chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_browser_proxy.html|ActionTypes,IncompatibleApplicationsBrowserProxyImpl,IncompatibleApplicationsBrowserProxy",
]
}
polymer_modulizer("incompatible_applications_page") {
js_file = "incompatible_applications_page.js"
html_file = "incompatible_applications_page.html"
html_type = "dom-module"
namespace_rewrites = settings_namespace_rewrites
auto_imports = settings_auto_imports + [
"ui/webui/resources/html/assert.html|assert",
"chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_browser_proxy.html|IncompatibleApplicationsBrowserProxyImpl, IncompatibleApplication",
]
}
import("//ui/webui/resources/tools/js_modulizer.gni")
js_modulizer("modulize") {
input_files = [ "incompatible_applications_browser_proxy.js" ]
namespace_rewrites = settings_namespace_rewrites
}
......@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// clang-format off
// #import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js';
// clang-format on
cr.define('settings', function() {
/**
* All possible actions to take on an incompatible application.
......@@ -11,7 +15,7 @@ cr.define('settings', function() {
* @readonly
* @enum {number}
*/
const ActionTypes = {
/* #export */ const ActionTypes = {
UNINSTALL: 0,
MORE_INFO: 1,
UPGRADE: 2,
......@@ -24,10 +28,10 @@ cr.define('settings', function() {
* actionUrl: string,
* }}
*/
let IncompatibleApplication;
/* #export */ let IncompatibleApplication;
/** @interface */
class IncompatibleApplicationsBrowserProxy {
/* #export */ class IncompatibleApplicationsBrowserProxy {
/**
* Get the list of incompatible applications.
* @return {!Promise<!Array<!settings.IncompatibleApplication>>}
......@@ -73,7 +77,7 @@ cr.define('settings', function() {
}
/** @implements {settings.IncompatibleApplicationsBrowserProxy} */
class IncompatibleApplicationsBrowserProxyImpl {
/* #export */ class IncompatibleApplicationsBrowserProxyImpl {
/** @override */
requestIncompatibleApplicationsList() {
return cr.sendWithPromise('requestIncompatibleApplicationsList');
......
......@@ -5,6 +5,7 @@
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="incompatible_application_item.html">
<link rel="import" href="incompatible_applications_browser_proxy.html">
......
......@@ -16,6 +16,8 @@ settings_namespace_rewrites = [
"settings.ExtensionControlBrowserProxy|ExtensionControlBrowserProxy",
"settings.FontsBrowserProxy|FontsBrowserProxy",
"settings.GlobalScrollTargetBehavior|GlobalScrollTargetBehavior",
"settings.IncompatibleApplicationsBrowserProxy|IncompatibleApplicationsBrowserProxy",
"settings.IncompatibleApplication|IncompatibleApplication",
"settings.LifetimeBrowserProxy|LifetimeBrowserProxy",
"settings.MinimumRoutes|MinimumRoutes",
"settings.OnStartupBrowserProxy|OnStartupBrowserProxy",
......
......@@ -28,6 +28,10 @@ import './settings_menu/settings_menu.m.js';
import './settings_page/settings_subpage.m.js';
import './settings_page/settings_animated_pages.m.js';
// <if expr="_google_chrome and is_win">
import './incompatible_applications_page/incompatible_applications_page.m.js';
// </if>
// <if expr="not chromeos">
import './default_browser_page/default_browser_page.m.js';
import './system_page/system_page.m.js';
......@@ -37,6 +41,7 @@ import './system_page/system_page.m.js';
export {CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW} from './chrome_cleanup_page/items_to_remove_list.m.js';
export {ChromeCleanupIdleReason} from './chrome_cleanup_page/chrome_cleanup_page.m.js';
export {ChromeCleanupProxyImpl} from './chrome_cleanup_page/chrome_cleanup_proxy.m.js';
export {IncompatibleApplication, IncompatibleApplicationsBrowserProxyImpl} from './incompatible_applications_page/incompatible_applications_browser_proxy.m.js';
// </if>
// <if expr="not chromeos">
......
......@@ -132,6 +132,20 @@
use_base_dir="false"
type="BINDATA"
preprocess="true" />
<if expr="is_win and _google_chrome">
<include name="IDR_SETTINGS_INCOMPATIBLE_APPLICATIONS_PAGE_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_page.m.js"
use_base_dir="false"
type="BINDATA" />
<include name="IDR_SETTINGS_INCOMPATIBLE_APPLICATIONS_BROWSER_PROXY_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_browser_proxy.m.js"
use_base_dir="false"
type="BINDATA" />
<include name="IDR_SETTINGS_INCOMPATIBLE_APPLICATIONS_INCOMPATIBLE_APPLICATION_ITEM_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/incompatible_applications_page/incompatible_application_item.m.js"
use_base_dir="false"
type="BINDATA" />
</if>
<include name="IDR_SETTINGS_LIFETIME_BROWSER_PROXY_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/lifetime_browser_proxy.m.js"
use_base_dir="false"
......
......@@ -243,7 +243,10 @@ js2gtest("browser_tests_js_webui") {
"$root_gen_dir/chrome/test/data/webui/test_util.m.js",
]
if (is_win) {
data += [ "$root_gen_dir/chrome/test/data/webui/settings/chrome_cleanup_page_test.m.js" ]
data += [
"$root_gen_dir/chrome/test/data/webui/settings/chrome_cleanup_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/incompatible_applications_page_test.m.js",
]
}
if (is_chromeos) {
data += [ "$root_gen_dir/chrome/test/data/webui/cr_elements/cr_searchable_drop_down_tests.m.js" ]
......
......@@ -41,7 +41,10 @@ js_modulizer("modulize") {
"test_util.js",
]
if (is_win) {
input_files += [ "chrome_cleanup_page_test.js" ]
input_files += [
"chrome_cleanup_page_test.js",
"incompatible_applications_page_test.js",
]
}
namespace_rewrites = settings_namespace_rewrites + test_namespace_rewrites + [
"settings.CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW|CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW",
......@@ -50,7 +53,6 @@ js_modulizer("modulize") {
"settings_search.createSampleSearchEngine|createSampleSearchEngine",
"settings_search.TestSearchEnginesBrowserProxy|TestSearchEnginesBrowserProxy",
"settings.TestLifetimeBrowserProxy|TestLifetimeBrowserProxy",
"settings.TestLifetimeBrowserProxy|TestLifetimeBrowserProxy",
"test_util.setupPopstateListener|setupPopstateListener",
]
}
......@@ -137,6 +137,23 @@ TEST_F('CrSettingsExtensionControlledIndicatorV3Test', 'All', function() {
mocha.run();
});
GEN('#if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)');
// eslint-disable-next-line no-var
var CrSettingsIncompatibleApplicationsPageV3Test =
class extends CrSettingsV3BrowserTest {
/** @override */
get browsePreload() {
return 'chrome://settings/test_loader.html?module=settings/incompatible_applications_page_test.m.js';
}
};
TEST_F('CrSettingsIncompatibleApplicationsPageV3Test', 'All', function() {
mocha.run();
});
GEN('#endif // defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)');
// eslint-disable-next-line no-var
var CrSettingsPrefUtilV3Test = class extends CrSettingsV3BrowserTest {
/** @override */
......
......@@ -2,6 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// clang-format off
// #import {IncompatibleApplicationsBrowserProxyImpl, IncompatibleApplication} from 'chrome://settings/settings.js';
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js';
// #import {webUIListenerCallback} from 'chrome://resources/js/cr.m.js';
// clang-format on
/** @implements {settings.IncompatibleApplicationsBrowserProxy} */
class TestIncompatibleApplicationsBrowserProxy extends TestBrowserProxy {
constructor() {
......
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