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

Unified Diff: chrome/browser/resources/settings/internet_page/internet_detail_page.js

Issue 2188163003: MD Settings: Internet: Add 'forget' button, more fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_609156_internet_cleanup_6a
Patch Set: Rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/internet_page/internet_detail_page.js
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
index 75668a3be39aaca8f6d612d91bce657165c23054..de49c267f4a8f33d9ffefa781085f3018e3fa1ad 100644
--- a/chrome/browser/resources/settings/internet_page/internet_detail_page.js
+++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -114,15 +114,30 @@ Polymer({
},
/** @override */
+ ready: function() {
+ if (!this.guid)
+ this.close_();
+ },
+
+ /** @override */
detached: function() {
this.networkingPrivate.onNetworksChanged.removeListener(
this.networksChangedListener_);
},
/** @private */
+ close_: function() {
+ // Delay sending subpage-back until the next render frame to allow other
+ // subpages to load first.
+ setTimeout(function() {
+ this.fire('subpage-back');
+ }.bind(this));
+ },
+
+ /** @private */
guidChanged_: function() {
if (!this.guid)
- return;
+ this.close_();
this.getNetworkDetails_();
},
@@ -198,7 +213,7 @@ Polymer({
if (!properties) {
// If |properties| becomes null (i.e. the network is no longer visible),
// close the page.
- this.fire('close');
+ this.close_();
}
},
@@ -298,6 +313,17 @@ Polymer({
* @return {boolean}
* @private
*/
+ showForget_: function() {
+ var type = this.networkProperties.Type;
+ if (type != CrOnc.Type.WI_FI && type != CrOnc.Type.VPN)
+ return false;
+ return this.isRemembered_();
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
showActivate_: function() {
if (this.networkProperties.Type != CrOnc.Type.CELLULAR)
return false;
@@ -369,6 +395,11 @@ Polymer({
},
/** @private */
+ onForgetTap_: function() {
+ this.networkingPrivate.forgetNetwork(this.guid);
+ },
+
+ /** @private */
onActivateTap_: function() {
this.networkingPrivate.startActivate(this.guid);
},

Powered by Google App Engine
This is Rietveld 408576698