Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: chrome/browser/resources/settings/on_startup_page/startup_url_dialog.js

Issue 1869883003: MD Settings: On Startup, extract dialog to its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview 'settings-startup-url-dialog' is a component for adding
7 * or editing a startup URL entry.
8 */
9 Polymer({
10 is: 'settings-startup-url-dialog',
11
12 properties: {
13 /** @private {string} */
14 url_: String,
15 },
16
17 /** @private {!settings.SearchEnginesBrowserProxy} */
18 browserProxy_: null,
19
20 /** @override */
21 ready: function() {
22 this.browserProxy_ = settings.StartupUrlsPageBrowserProxyImpl.getInstance();
23 },
24
25 /** @override */
26 attached: function() {
27 this.$.dialog.open();
28 },
29
30 /** @private */
31 onCancelTap_: function() {
32 this.$.dialog.close();
33 },
34
35 /** @private */
36 onAddTap_: function() {
37 this.browserProxy_.addStartupPage(this.url_).then(function(success) {
38 if (success)
39 this.$.dialog.close();
40 // If the URL was invalid, there is nothing to do, just leave the dialog
41 // open and let the user fix the URL or cancel.
42 }.bind(this));
43 },
44
45 /** @private */
46 validate_: function() {
47 this.browserProxy_.validateStartupPage(this.url_).then(function(isValid) {
48 this.$.add.disabled = !isValid;
49 }.bind(this));
50 },
51 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698