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

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

Issue 2567873002: DevTools: Add ability to add and edit cookies (Closed)
Patch Set: Fix formatting. Created 3 years, 11 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/WebKit/Source/devtools/front_end/resources/CookieItemsView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js b/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js
index 74b1d1141472261a12a81f48b0941f407d3b4825..cebb4f8750f9cfcd1e907b8232bbd8e3d0d0b48d 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js
@@ -56,13 +56,6 @@ Resources.CookieItemsView = class extends UI.SimpleView {
this._treeElement = treeElement;
this._cookieDomain = cookieDomain;
- this._emptyWidget = new UI.EmptyWidget(
- cookieDomain ?
dgozman 2017/01/20 01:54:51 Let's only show cookies for http:// and https:// o
kdzwinel 2017/01/21 02:12:20 It looks like it's possible to set cookies on file
- Common.UIString('This site has no cookies.') :
- Common.UIString(
- 'By default cookies are disabled for local files.\nYou could override this by starting the browser with --enable-file-cookies command line flag.'));
- this._emptyWidget.show(this.element);
-
this.element.addEventListener('contextmenu', this._contextMenu.bind(this), true);
}
@@ -107,25 +100,15 @@ Resources.CookieItemsView = class extends UI.SimpleView {
_updateWithCookies(allCookies) {
this._cookies = this._filterCookiesForDomain(allCookies);
- if (!this._cookies.length) {
- // Nothing to show.
- this._emptyWidget.show(this.element);
- this._filterButton.setEnabled(false);
- this._clearButton.setEnabled(false);
- this._deleteButton.setEnabled(false);
- if (this._cookiesTable)
- this._cookiesTable.detach();
- return;
- }
-
if (!this._cookiesTable) {
+ const parsedURL = this._cookieDomain.asParsedURL();
+ const domain = parsedURL ? parsedURL.domain() : '';
this._cookiesTable =
- new CookieTable.CookiesTable(false, this._update.bind(this), this._enableDeleteButton.bind(this));
+ new CookieTable.CookiesTable(false, this._update.bind(this), this._enableDeleteButton.bind(this), domain);
}
var shownCookies = this._filterCookiesForFilters(this._cookies);
this._cookiesTable.setCookies(shownCookies);
- this._emptyWidget.detach();
this._cookiesTable.show(this.element);
this._filterBar.show(this.element);
this._treeElement.subtitle =

Powered by Google App Engine
This is Rietveld 408576698