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

Unified Diff: chrome/browser/resources/options/origin_resources_list.js

Issue 380893005: Add an option page for searching and managing resources and permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last pass. Created 6 years, 5 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/options/origin_resources_list.js
diff --git a/chrome/browser/resources/options/origin_resources_list.js b/chrome/browser/resources/options/origin_resources_list.js
new file mode 100644
index 0000000000000000000000000000000000000000..62efad450a330719bf81cc1351ae61a2cb4b5aa9
--- /dev/null
+++ b/chrome/browser/resources/options/origin_resources_list.js
@@ -0,0 +1,52 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('options', function() {
+ /** @const */ List = cr.ui.List;
+ /** @const */ ListItem = cr.ui.ListItem;
+
+ function OriginListItem(origin) {
+ var el = cr.doc.createElement('div');
+ el.origin_ = origin;
+ el.__proto__ = OriginListItem.prototype;
+ el.decorate();
+ return el;
+ }
+
+ OriginListItem.prototype = {
+ __proto__: ListItem.prototype,
+
+ /** @override */
+ decorate: function() {
+ ListItem.prototype.decorate.call(this);
+
+ this.classList.add('deletable-item');
+
+ this.contentElement_ = this.ownerDocument.createElement('div');
+ this.appendChild(this.contentElement_);
+
+ var titleEl = this.ownerDocument.createElement('div');
+ titleEl.className = 'title favicon-cell weaktrl';
+ titleEl.textContent = this.origin_;
+ titleEl.style.backgroundImage = getFaviconImageSet(this.origin_);
+ this.contentElement_.appendChild(titleEl);
+ }
+ };
+
+ var OriginList = cr.ui.define('list');
+
+ OriginList.prototype = {
+ __proto__: List.prototype,
+
+ /** @override */
+ createItem: function(entry) {
+ return new OriginListItem(entry);
+ },
+ };
+
+ return {
+ OriginListItem: OriginListItem,
+ OriginList: OriginList,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698