summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options/cookies_view_app.js
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/resources/options/cookies_view_app.js')
-rw-r--r--chrome/browser/resources/options/cookies_view_app.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/chrome/browser/resources/options/cookies_view_app.js b/chrome/browser/resources/options/cookies_view_app.js
new file mode 100644
index 0000000..b9ee641
--- /dev/null
+++ b/chrome/browser/resources/options/cookies_view_app.js
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 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() {
+
+ /////////////////////////////////////////////////////////////////////////////
+ // CookiesViewApp class:
+
+ /**
+ * Encapsulated handling of app cookies and other data page. It
+ * derives from the regular CookiesView.
+ * @constructor
+ */
+ function CookiesViewApp(model) {
+ options.OptionsPage.call(this, 'app-cookies',
+ loadTimeData.getString('cookiesViewPageTabTitle'),
+ 'app-cookies-view-page');
+ }
+
+ cr.addSingletonGetter(CookiesViewApp);
+
+ CookiesViewApp.prototype = {
+ __proto__: options.CookiesView.prototype,
+
+ isAppContext: function() {
+ return true;
+ },
+ };
+
+ // CookiesViewHandler callbacks.
+ CookiesViewApp.onTreeItemAdded = function(args) {
+ $('app-cookies-list').addByParentId(args[0], args[1], args[2]);
+ };
+
+ CookiesViewApp.onTreeItemRemoved = function(args) {
+ $('app-cookies-list').removeByParentId(args[0], args[1], args[2]);
+ };
+
+ CookiesViewApp.loadChildren = function(args) {
+ $('app-cookies-list').loadChildren(args[0], args[1]);
+ };
+
+ // Export
+ return {
+ CookiesViewApp: CookiesViewApp
+ };
+});