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

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-location/iron-query-params-extracted.js

Issue 1862213002: Roll third_party/polymer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete appearance_browsertest.js, result of a previous bad merge. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/iron-location/iron-query-params-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-location/iron-query-params-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-location/iron-query-params-extracted.js
new file mode 100644
index 0000000000000000000000000000000000000000..8bd4de5ab770ffb33ff7ebfb89e838b733e6d706
--- /dev/null
+++ b/third_party/polymer/v1_0/components-chromium/iron-location/iron-query-params-extracted.js
@@ -0,0 +1,68 @@
+'use strict';
+
+ Polymer({
+ is: 'iron-query-params',
+ properties: {
+ paramsString: {
+ type: String,
+ notify: true,
+ observer: 'paramsStringChanged',
+ },
+ paramsObject: {
+ type: Object,
+ notify: true,
+ value: function() {
+ return {};
+ }
+ },
+ _dontReact: {
+ type: Boolean,
+ value: false
+ }
+ },
+ hostAttributes: {
+ hidden: true
+ },
+ observers: [
+ 'paramsObjectChanged(paramsObject.*)'
+ ],
+ paramsStringChanged: function() {
+ this._dontReact = true;
+ this.paramsObject = this._decodeParams(this.paramsString);
+ this._dontReact = false;
+ },
+ paramsObjectChanged: function() {
+ if (this._dontReact) {
+ return;
+ }
+ this.paramsString = this._encodeParams(this.paramsObject);
+ },
+ _encodeParams: function(params) {
+ var encodedParams = [];
+ for (var key in params) {
+ var value = params[key];
+ if (value === '') {
+ encodedParams.push(encodeURIComponent(key));
+ } else if (value) {
+ encodedParams.push(
+ encodeURIComponent(key) +
+ '=' +
+ encodeURIComponent(value.toString())
+ );
+ }
+ }
+ return encodedParams.join('&');
+ },
+ _decodeParams: function(paramString) {
+ var params = {};
+ var paramList = (paramString || '').split('&');
+ for (var i = 0; i < paramList.length; i++) {
+ var param = paramList[i].split('=');
+ if (param[0]) {
+ params[decodeURIComponent(param[0])] =
+ decodeURIComponent(param[1] || '');
+ }
+ }
+ return params;
+ }
+ });

Powered by Google App Engine
This is Rietveld 408576698