Commit 3aa1162e authored by dpapad's avatar dpapad Committed by Commit Bot

Settings: Check-in search_engines_page/ Polymer3.

Migrating everything in that folder, except
search_engines_browser_proxy.html/js which is still used by CrOS
Settings and therefore still has to be generated at build time.

Bug: 1069258
Change-Id: Ifd48616cdc4a8d2075b115c9e47511e69945cdfb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151891
Commit-Queue: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759891}
parent c30e5910
...@@ -8,7 +8,7 @@ import './autofill_page/password_check.m.js'; ...@@ -8,7 +8,7 @@ import './autofill_page/password_check.m.js';
import './autofill_page/passwords_section.m.js'; import './autofill_page/passwords_section.m.js';
import './autofill_page/payments_section.m.js'; import './autofill_page/payments_section.m.js';
import './clear_browsing_data_dialog/clear_browsing_data_dialog.m.js'; import './clear_browsing_data_dialog/clear_browsing_data_dialog.m.js';
import './search_engines_page/search_engines_page.m.js'; import './search_engines_page/search_engines_page.js';
import './privacy_page/cookies_page.m.js'; import './privacy_page/cookies_page.m.js';
import './privacy_page/security_keys_subpage.m.js'; import './privacy_page/security_keys_subpage.m.js';
import './privacy_page/security_page.m.js'; import './privacy_page/security_page.m.js';
......
...@@ -8,48 +8,7 @@ import("//ui/webui/resources/tools/js_modulizer.gni") ...@@ -8,48 +8,7 @@ import("//ui/webui/resources/tools/js_modulizer.gni")
import("../settings.gni") import("../settings.gni")
js_type_check("closure_compile") { js_type_check("closure_compile") {
deps = [ deps = [ ":search_engines_browser_proxy" ]
":omnibox_extension_entry",
":search_engine_dialog",
":search_engine_entry",
":search_engines_browser_proxy",
":search_engines_list",
":search_engines_page",
]
}
js_library("search_engine_dialog") {
deps = [
":search_engines_browser_proxy",
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
}
js_library("search_engine_entry") {
deps = [
":search_engines_browser_proxy",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:icon",
"//ui/webui/resources/js/cr/ui:focus_row_behavior",
"//ui/webui/resources/js/cr/ui:focus_without_ink",
]
}
js_library("omnibox_extension_entry") {
deps = [
":search_engines_browser_proxy",
"..:extension_control_browser_proxy",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:icon",
"//ui/webui/resources/js/cr/ui:focus_row_behavior",
]
} }
js_library("search_engines_browser_proxy") { js_library("search_engines_browser_proxy") {
...@@ -59,41 +18,20 @@ js_library("search_engines_browser_proxy") { ...@@ -59,41 +18,20 @@ js_library("search_engines_browser_proxy") {
] ]
} }
js_library("search_engines_list") {
deps = [
":search_engines_browser_proxy",
"//ui/webui/resources/js:cr",
]
}
js_library("search_engines_page") {
deps = [
":search_engines_browser_proxy",
"..:global_scroll_target_behavior",
"..:route",
"//third_party/polymer/v1_0/components-chromium/iron-list:iron-list-extracted",
"//third_party/polymer/v1_0/components-chromium/iron-resizable-behavior:iron-resizable-behavior-extracted",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js/cr/ui:focus_without_ink",
]
}
js_type_check("closure_compile_module") { js_type_check("closure_compile_module") {
is_polymer3 = true is_polymer3 = true
closure_flags = settings_closure_flags
deps = [ deps = [
":omnibox_extension_entry.m", ":omnibox_extension_entry",
":search_engine_dialog.m", ":search_engine_dialog",
":search_engine_entry.m", ":search_engine_entry",
":search_engines_browser_proxy.m", ":search_engines_browser_proxy.m",
":search_engines_list.m", ":search_engines_list",
":search_engines_page.m", ":search_engines_page",
] ]
} }
js_library("omnibox_extension_entry.m") { js_library("omnibox_extension_entry") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.m.js" ]
deps = [ deps = [
":search_engines_browser_proxy.m", ":search_engines_browser_proxy.m",
"..:extension_control_browser_proxy.m", "..:extension_control_browser_proxy.m",
...@@ -102,11 +40,9 @@ js_library("omnibox_extension_entry.m") { ...@@ -102,11 +40,9 @@ js_library("omnibox_extension_entry.m") {
"//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js/cr/ui:focus_row_behavior.m", "//ui/webui/resources/js/cr/ui:focus_row_behavior.m",
] ]
extra_deps = [ ":omnibox_extension_entry_module" ]
} }
js_library("search_engine_dialog.m") { js_library("search_engine_dialog") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/search_engines_page/search_engine_dialog.m.js" ]
deps = [ deps = [
":search_engines_browser_proxy.m", ":search_engines_browser_proxy.m",
"..:i18n_setup.m", "..:i18n_setup.m",
...@@ -114,11 +50,9 @@ js_library("search_engine_dialog.m") { ...@@ -114,11 +50,9 @@ js_library("search_engine_dialog.m") {
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m", "//ui/webui/resources/js:web_ui_listener_behavior.m",
] ]
extra_deps = [ ":search_engine_dialog_module" ]
} }
js_library("search_engine_entry.m") { js_library("search_engine_entry") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/search_engines_page/search_engine_entry.m.js" ]
deps = [ deps = [
":search_engines_browser_proxy.m", ":search_engines_browser_proxy.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
...@@ -126,7 +60,6 @@ js_library("search_engine_entry.m") { ...@@ -126,7 +60,6 @@ js_library("search_engine_entry.m") {
"//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js/cr/ui:focus_row_behavior.m", "//ui/webui/resources/js/cr/ui:focus_row_behavior.m",
] ]
extra_deps = [ ":search_engine_entry_module" ]
} }
js_library("search_engines_browser_proxy.m") { js_library("search_engines_browser_proxy.m") {
...@@ -135,17 +68,14 @@ js_library("search_engines_browser_proxy.m") { ...@@ -135,17 +68,14 @@ js_library("search_engines_browser_proxy.m") {
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
js_library("search_engines_list.m") { js_library("search_engines_list") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/search_engines_page/search_engines_list.m.js" ]
deps = [ deps = [
":search_engines_browser_proxy.m", ":search_engines_browser_proxy.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
] ]
extra_deps = [ ":search_engines_list_module" ]
} }
js_library("search_engines_page.m") { js_library("search_engines_page") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/search_engines_page/search_engines_page.m.js" ]
deps = [ deps = [
":search_engines_browser_proxy.m", ":search_engines_browser_proxy.m",
"..:global_scroll_target_behavior.m", "..:global_scroll_target_behavior.m",
...@@ -155,7 +85,6 @@ js_library("search_engines_page.m") { ...@@ -155,7 +85,6 @@ js_library("search_engines_page.m") {
"//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m", "//ui/webui/resources/js:web_ui_listener_behavior.m",
] ]
extra_deps = [ ":search_engines_page_module" ]
} }
group("polymer3_elements") { group("polymer3_elements") {
...@@ -173,59 +102,37 @@ group("polymer3_elements") { ...@@ -173,59 +102,37 @@ group("polymer3_elements") {
polymer_modulizer("omnibox_extension_entry") { polymer_modulizer("omnibox_extension_entry") {
js_file = "omnibox_extension_entry.js" js_file = "omnibox_extension_entry.js"
html_file = "omnibox_extension_entry.html" html_file = "omnibox_extension_entry.html"
html_type = "dom-module" html_type = "v3-ready"
namespace_rewrites = settings_namespace_rewrites
auto_imports = settings_auto_imports + [
"chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.html|SearchEngine",
"ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.html|AnchorAlignment",
"ui/webui/resources/html/assert.html|assert",
]
} }
polymer_modulizer("search_engine_dialog") { polymer_modulizer("search_engine_dialog") {
js_file = "search_engine_dialog.js" js_file = "search_engine_dialog.js"
html_file = "search_engine_dialog.html" html_file = "search_engine_dialog.html"
html_type = "dom-module" html_type = "v3-ready"
namespace_rewrites = settings_namespace_rewrites
auto_imports = settings_auto_imports + [ "chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.html|SearchEnginesBrowserProxyImpl,SearchEnginesBrowserProxy,SearchEngine,SearchEnginesInfo" ]
} }
polymer_modulizer("search_engine_entry") { polymer_modulizer("search_engine_entry") {
js_file = "search_engine_entry.js" js_file = "search_engine_entry.js"
html_file = "search_engine_entry.html" html_file = "search_engine_entry.html"
html_type = "dom-module" html_type = "v3-ready"
namespace_rewrites = settings_namespace_rewrites
auto_imports = settings_auto_imports + [
"chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.html|SearchEnginesBrowserProxyImpl,SearchEnginesBrowserProxy,SearchEngine",
"ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.html|AnchorAlignment",
"ui/webui/resources/html/assert.html|assert",
]
} }
polymer_modulizer("search_engine_entry_css") { polymer_modulizer("search_engine_entry_css") {
js_file = "search_engine_entry_css.m.js" js_file = "search_engine_entry_css.js"
html_file = "search_engine_entry_css.html" html_file = "search_engine_entry_css.html"
html_type = "style-module" html_type = "v3-ready"
} }
polymer_modulizer("search_engines_list") { polymer_modulizer("search_engines_list") {
js_file = "search_engines_list.js" js_file = "search_engines_list.js"
html_file = "search_engines_list.html" html_file = "search_engines_list.html"
html_type = "dom-module" html_type = "v3-ready"
auto_imports = [ "chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.html|SearchEngine" ]
} }
polymer_modulizer("search_engines_page") { polymer_modulizer("search_engines_page") {
js_file = "search_engines_page.js" js_file = "search_engines_page.js"
html_file = "search_engines_page.html" html_file = "search_engines_page.html"
html_type = "dom-module" html_type = "v3-ready"
namespace_rewrites = settings_namespace_rewrites
auto_imports = settings_auto_imports + [
"chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.html|SearchEnginesBrowserProxyImpl,SearchEngine,SearchEnginesInfo",
"chrome/browser/resources/settings/route.html|routes",
"ui/webui/resources/html/assert.html|assert",
"ui/webui/resources/html/polymer.html|afterNextRender,html,Polymer",
]
} }
js_modulizer("modulize") { js_modulizer("modulize") {
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_row_behavior.html">
<link rel="import" href="../extension_control_browser_proxy.html">
<link rel="import" href="search_engine_entry_css.html">
<link rel="import" href="search_engines_browser_proxy.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../site_favicon.html">
<dom-module id="settings-omnibox-extension-entry">
<template>
<style include="settings-shared search-engine-entry"> <style include="settings-shared search-engine-entry">
.name-column { .name-column {
align-items: center; align-items: center;
...@@ -45,6 +30,3 @@ ...@@ -45,6 +30,3 @@
</button> </button>
</cr-action-menu> </cr-action-menu>
</div> </div>
</template>
<script src="omnibox_extension_entry.js"></script>
</dom-module>
...@@ -6,23 +6,39 @@ ...@@ -6,23 +6,39 @@
* @fileoverview 'settings-omnibox-extension-entry' is a component for showing * @fileoverview 'settings-omnibox-extension-entry' is a component for showing
* an omnibox extension with its name and keyword. * an omnibox extension with its name and keyword.
*/ */
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/icons.m.js';
import './search_engine_entry_css.js';
import '../settings_shared_css.m.js';
import '../site_favicon.m.js';
import {AnchorAlignment} from 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.m.js';
import {assert} from 'chrome://resources/js/assert.m.js';
import {FocusRowBehavior} from 'chrome://resources/js/cr/ui/focus_row_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {ExtensionControlBrowserProxy, ExtensionControlBrowserProxyImpl} from '../extension_control_browser_proxy.m.js';
import {SearchEngine} from './search_engines_browser_proxy.m.js';
Polymer({ Polymer({
is: 'settings-omnibox-extension-entry', is: 'settings-omnibox-extension-entry',
_template: html`{__html_template__}`,
properties: { properties: {
/** @type {!SearchEngine} */ /** @type {!SearchEngine} */
engine: Object, engine: Object,
}, },
behaviors: [cr.ui.FocusRowBehavior], behaviors: [FocusRowBehavior],
/** @private {?settings.ExtensionControlBrowserProxy} */ /** @private {?ExtensionControlBrowserProxy} */
browserProxy_: null, browserProxy_: null,
/** @override */ /** @override */
created() { created() {
this.browserProxy_ = this.browserProxy_ = ExtensionControlBrowserProxyImpl.getInstance();
settings.ExtensionControlBrowserProxyImpl.getInstance();
}, },
/** @private */ /** @private */
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="search_engines_browser_proxy.html">
<dom-module id="settings-search-engine-dialog">
<template>
<style include="settings-shared"> <style include="settings-shared">
</style> </style>
<cr-dialog id="dialog" close-text="$i18n{close}"> <cr-dialog id="dialog" close-text="$i18n{close}">
...@@ -41,6 +30,3 @@ ...@@ -41,6 +30,3 @@
</cr-button> </cr-button>
</div> </div>
</cr-dialog> </cr-dialog>
</template>
<script src="search_engine_dialog.js"></script>
</dom-module>
...@@ -6,9 +6,22 @@ ...@@ -6,9 +6,22 @@
* @fileoverview 'settings-search-engine-dialog' is a component for adding * @fileoverview 'settings-search-engine-dialog' is a component for adding
* or editing a search engine entry. * or editing a search engine entry.
*/ */
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js';
import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.m.js';
import 'chrome://resources/cr_elements/cr_input/cr_input.m.js';
import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {loadTimeData} from '../i18n_setup.m.js';
import {SearchEngine, SearchEnginesBrowserProxy, SearchEnginesBrowserProxyImpl, SearchEnginesInfo} from './search_engines_browser_proxy.m.js';
Polymer({ Polymer({
is: 'settings-search-engine-dialog', is: 'settings-search-engine-dialog',
_template: html`{__html_template__}`,
behaviors: [WebUIListenerBehavior], behaviors: [WebUIListenerBehavior],
properties: { properties: {
...@@ -35,7 +48,7 @@ Polymer({ ...@@ -35,7 +48,7 @@ Polymer({
actionButtonText_: String, actionButtonText_: String,
}, },
/** @private {settings.SearchEnginesBrowserProxy} */ /** @private {SearchEnginesBrowserProxy} */
browserProxy_: null, browserProxy_: null,
/** /**
...@@ -48,7 +61,7 @@ Polymer({ ...@@ -48,7 +61,7 @@ Polymer({
/** @override */ /** @override */
created() { created() {
this.browserProxy_ = settings.SearchEnginesBrowserProxyImpl.getInstance(); this.browserProxy_ = SearchEnginesBrowserProxyImpl.getInstance();
}, },
/** @override */ /** @override */
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_row_behavior.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="../controls/extension_controlled_indicator.html">
<link rel="import" href="search_engine_entry_css.html">
<link rel="import" href="search_engines_browser_proxy.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../site_favicon.html">
<dom-module id="settings-search-engine-entry">
<template>
<style include="settings-shared search-engine-entry"> <style include="settings-shared search-engine-entry">
:host([is-default]) .list-item { :host([is-default]) .list-item {
font-weight: 500; font-weight: 500;
...@@ -74,6 +58,3 @@ ...@@ -74,6 +58,3 @@
extension-can-be-disabled="[[engine.extension.canBeDisabled]]"> extension-can-be-disabled="[[engine.extension.canBeDisabled]]">
</extension-controlled-indicator> </extension-controlled-indicator>
</template> </template>
</template>
<script src="search_engine_entry.js"></script>
</dom-module>
...@@ -6,10 +6,26 @@ ...@@ -6,10 +6,26 @@
* @fileoverview 'settings-search-engine-entry' is a component for showing a * @fileoverview 'settings-search-engine-entry' is a component for showing a
* search engine with its name, domain and query URL. * search engine with its name, domain and query URL.
*/ */
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/icons.m.js';
import '../controls/extension_controlled_indicator.m.js';
import './search_engine_entry_css.js';
import '../settings_shared_css.m.js';
import '../site_favicon.m.js';
import {AnchorAlignment} from 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.m.js';
import {assert} from 'chrome://resources/js/assert.m.js';
import {FocusRowBehavior} from 'chrome://resources/js/cr/ui/focus_row_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {SearchEngine, SearchEnginesBrowserProxy, SearchEnginesBrowserProxyImpl} from './search_engines_browser_proxy.m.js';
Polymer({ Polymer({
is: 'settings-search-engine-entry', is: 'settings-search-engine-entry',
behaviors: [cr.ui.FocusRowBehavior], _template: html`{__html_template__}`,
behaviors: [FocusRowBehavior],
properties: { properties: {
/** @type {!SearchEngine} */ /** @type {!SearchEngine} */
...@@ -32,12 +48,12 @@ Polymer({ ...@@ -32,12 +48,12 @@ Polymer({
}, },
}, },
/** @private {settings.SearchEnginesBrowserProxy} */ /** @private {SearchEnginesBrowserProxy} */
browserProxy_: null, browserProxy_: null,
/** @override */ /** @override */
created() { created() {
this.browserProxy_ = settings.SearchEnginesBrowserProxyImpl.getInstance(); this.browserProxy_ = SearchEnginesBrowserProxyImpl.getInstance();
}, },
/** @private */ /** @private */
......
<dom-module id="search-engine-entry">
<template> <template>
<style> <style>
site-favicon { site-favicon {
...@@ -7,4 +7,3 @@ ...@@ -7,4 +7,3 @@
} }
</style> </style>
</template> </template>
</dom-module>
// 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.
const template = document.createElement('template');
template.innerHTML = `
<dom-module id="search-engine-entry">{__html_template__}</dom-module>
`;
document.body.appendChild(template.content.cloneNode(true));
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
<link rel="import" href="search_engine_entry.html">
<link rel="import" href="search_engines_browser_proxy.html">
<dom-module id="settings-search-engines-list">
<template>
<style include="settings-shared"> <style include="settings-shared">
#headers { #headers {
display: flex; display: flex;
...@@ -66,6 +55,3 @@ ...@@ -66,6 +55,3 @@
</iron-list> </iron-list>
</div> </div>
</div> </div>
</template>
<script src="search_engines_list.js"></script>
</dom-module>
...@@ -6,9 +6,21 @@ ...@@ -6,9 +6,21 @@
* @fileoverview 'settings-search-engines-list' is a component for showing a * @fileoverview 'settings-search-engines-list' is a component for showing a
* list of search engines. * list of search engines.
*/ */
import 'chrome://resources/cr_elements/shared_vars_css.m.js';
import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js';
import '../settings_shared_css.m.js';
import '../settings_vars_css.m.js';
import './search_engine_entry.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {SearchEngine} from './search_engines_browser_proxy.m.js';
Polymer({ Polymer({
is: 'settings-search-engines-list', is: 'settings-search-engines-list',
_template: html`{__html_template__}`,
properties: { properties: {
/** @type {!Array<!SearchEngine>} */ /** @type {!Array<!SearchEngine>} */
engines: Array, engines: Array,
......
<link rel="import" href="chrome://resources/html/polymer.html"> <style include="settings-shared">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/action_link.html">
<link rel="import" href="chrome://resources/cr_elements/action_link_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="search_engines_browser_proxy.html">
<link rel="import" href="search_engine_dialog.html">
<link rel="import" href="search_engines_list.html">
<link rel="import" href="omnibox_extension_entry.html">
<link rel="import" href="../global_scroll_target_behavior.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
<dom-module id="settings-search-engines-page">
<template>
<style include="settings-shared action-link">
.extension-engines, .extension-engines,
#noOtherEngines, #noOtherEngines,
.no-search-results { .no-search-results {
...@@ -85,6 +64,3 @@ ...@@ -85,6 +64,3 @@
</template> </template>
</iron-list> </iron-list>
</template> </template>
</template>
<script src="search_engines_page.js"></script>
</dom-module>
...@@ -6,10 +6,31 @@ ...@@ -6,10 +6,31 @@
* @fileoverview 'settings-search-engines-page' is the settings page * @fileoverview 'settings-search-engines-page' is the settings page
* containing search engines settings. * containing search engines settings.
*/ */
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js';
import 'chrome://resources/cr_elements/shared_vars_css.m.js';
import 'chrome://resources/js/cr.m.js';
import './search_engine_dialog.js';
import './search_engines_list.js';
import './omnibox_extension_entry.js';
import '../settings_shared_css.m.js';
import '../settings_vars_css.m.js';
import {assert} from 'chrome://resources/js/assert.m.js';
import {focusWithoutInk} from 'chrome://resources/js/cr/ui/focus_without_ink.m.js';
import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js';
import {afterNextRender, html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {GlobalScrollTargetBehavior} from '../global_scroll_target_behavior.m.js';
import {routes} from '../route.m.js';
import {SearchEngine, SearchEnginesBrowserProxyImpl, SearchEnginesInfo} from './search_engines_browser_proxy.m.js';
Polymer({ Polymer({
is: 'settings-search-engines-page', is: 'settings-search-engines-page',
behaviors: [settings.GlobalScrollTargetBehavior, WebUIListenerBehavior], _template: html`{__html_template__}`,
behaviors: [GlobalScrollTargetBehavior, WebUIListenerBehavior],
properties: { properties: {
/** @type {!Array<!SearchEngine>} */ /** @type {!Array<!SearchEngine>} */
...@@ -27,7 +48,7 @@ Polymer({ ...@@ -27,7 +48,7 @@ Polymer({
*/ */
subpageRoute: { subpageRoute: {
type: Object, type: Object,
value: settings.routes.SEARCH_ENGINES, value: routes.SEARCH_ENGINES,
}, },
/** @private {boolean} */ /** @private {boolean} */
...@@ -95,14 +116,13 @@ Polymer({ ...@@ -95,14 +116,13 @@ Polymer({
/** @override */ /** @override */
ready() { ready() {
settings.SearchEnginesBrowserProxyImpl.getInstance() SearchEnginesBrowserProxyImpl.getInstance().getSearchEnginesList().then(
.getSearchEnginesList() this.enginesChanged_.bind(this));
.then(this.enginesChanged_.bind(this));
this.addWebUIListener( this.addWebUIListener(
'search-engines-changed', this.enginesChanged_.bind(this)); 'search-engines-changed', this.enginesChanged_.bind(this));
// Sets offset in iron-list that uses the page as a scrollTarget. // Sets offset in iron-list that uses the page as a scrollTarget.
Polymer.RenderStatus.afterNextRender(this, function() { afterNextRender(this, function() {
this.$.otherEngines.scrollOffset = this.$.otherEngines.offsetTop; this.$.otherEngines.scrollOffset = this.$.otherEngines.offsetTop;
}); });
}, },
...@@ -122,7 +142,7 @@ Polymer({ ...@@ -122,7 +142,7 @@ Polymer({
onCloseDialog_() { onCloseDialog_() {
this.showDialog_ = false; this.showDialog_ = false;
const anchor = /** @type {!HTMLElement} */ (this.dialogAnchorElement_); const anchor = /** @type {!HTMLElement} */ (this.dialogAnchorElement_);
cr.ui.focusWithoutInk(anchor); focusWithoutInk(anchor);
this.dialogModel_ = null; this.dialogModel_ = null;
this.dialogAnchorElement_ = null; this.dialogAnchorElement_ = null;
}, },
......
...@@ -575,28 +575,28 @@ ...@@ -575,28 +575,28 @@
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" compress="false" type="BINDATA"
preprocess="true" /> preprocess="true" />
<include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_OMNIBOX_EXTENSION_ENTRY_M_JS" <include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_OMNIBOX_EXTENSION_ENTRY_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.js"
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" /> compress="false" type="BINDATA" />
<include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINE_DIALOG_M_JS" <include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINE_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engine_dialog.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engine_dialog.js"
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" /> compress="false" type="BINDATA" />
<include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINE_ENTRY_CSS_M_JS" <include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINE_ENTRY_CSS_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engine_entry_css.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engine_entry_css.js"
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" /> compress="false" type="BINDATA" />
<include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINE_ENTRY_M_JS" <include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINE_ENTRY_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engine_entry.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engine_entry.js"
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" /> compress="false" type="BINDATA" />
<include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINES_LIST_M_JS" <include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINES_LIST_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engines_list.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engines_list.js"
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" /> compress="false" type="BINDATA" />
<include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINES_PAGE_M_JS" <include name="IDR_SETTINGS_SEARCH_ENGINES_PAGE_SEARCH_ENGINES_PAGE_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engines_page.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/search_engines_page/search_engines_page.js"
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" /> compress="false" type="BINDATA" />
<include name="IDR_SETTINGS_SEARCH_PAGE_JS" <include name="IDR_SETTINGS_SEARCH_PAGE_JS"
......
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