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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js

Issue 2567873002: DevTools: Add ability to add and edit cookies (Closed)
Patch Set: Code review fixes - part 3. Created 4 years 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
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Nothing to show. 96 // Nothing to show.
97 this._emptyWidget.show(this.element); 97 this._emptyWidget.show(this.element);
98 this._clearButton.setVisible(false); 98 this._clearButton.setVisible(false);
99 this._deleteButton.setVisible(false); 99 this._deleteButton.setVisible(false);
100 if (this._cookiesTable) 100 if (this._cookiesTable)
101 this._cookiesTable.detach(); 101 this._cookiesTable.detach();
102 return; 102 return;
103 } 103 }
104 104
105 if (!this._cookiesTable) { 105 if (!this._cookiesTable) {
106 const parsedURL = this._cookieDomain.asParsedURL();
dgozman 2016/12/14 17:20:21 Note that asParsedURL can return null.
106 this._cookiesTable = 107 this._cookiesTable =
107 new Components.CookiesTable(false, this._update.bind(this), this._show DeleteButton.bind(this)); 108 new Components.CookiesTable(false, this._update.bind(this), this._show DeleteButton.bind(this), parsedURL.domain());
108 } 109 }
109 110
110 this._cookiesTable.setCookies(this._cookies); 111 this._cookiesTable.setCookies(this._cookies);
111 this._emptyWidget.detach(); 112 this._emptyWidget.detach();
112 this._cookiesTable.show(this.element); 113 this._cookiesTable.show(this.element);
113 this._treeElement.subtitle = 114 this._treeElement.subtitle =
114 String.sprintf(Common.UIString('%d cookies (%s)'), this._cookies.length, Number.bytesToString(this._totalSize)); 115 String.sprintf(Common.UIString('%d cookies (%s)'), this._cookies.length, Number.bytesToString(this._totalSize));
115 this._clearButton.setVisible(true); 116 this._clearButton.setVisible(true);
116 this._deleteButton.setVisible(!!this._cookiesTable.selectedCookie()); 117 this._deleteButton.setVisible(!!this._cookiesTable.selectedCookie());
117 } 118 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 178 }
178 179
179 _contextMenu(event) { 180 _contextMenu(event) {
180 if (!this._cookies.length) { 181 if (!this._cookies.length) {
181 var contextMenu = new UI.ContextMenu(event); 182 var contextMenu = new UI.ContextMenu(event);
182 contextMenu.appendItem(Common.UIString('Refresh'), this._update.bind(this) ); 183 contextMenu.appendItem(Common.UIString('Refresh'), this._update.bind(this) );
183 contextMenu.show(); 184 contextMenu.show();
184 } 185 }
185 } 186 }
186 }; 187 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698