| Index: chrome/browser/resources/options2/app_cookies_view.js
|
| diff --git a/chrome/browser/resources/options2/cookies_view.js b/chrome/browser/resources/options2/app_cookies_view.js
|
| similarity index 64%
|
| copy from chrome/browser/resources/options2/cookies_view.js
|
| copy to chrome/browser/resources/options2/app_cookies_view.js
|
| index 50a58afa6f0b636fe40c0e34991df3809fa19b4b..f6de2cfa1f69c3bd4b9b4be7c60c4f262d3d2dbb 100644
|
| --- a/chrome/browser/resources/options2/cookies_view.js
|
| +++ b/chrome/browser/resources/options2/app_cookies_view.js
|
| @@ -7,21 +7,23 @@ cr.define('options', function() {
|
| var OptionsPage = options.OptionsPage;
|
|
|
| /////////////////////////////////////////////////////////////////////////////
|
| - // CookiesView class:
|
| + // AppCookiesView class:
|
|
|
| /**
|
| - * Encapsulated handling of the cookies and other site data page.
|
| + * Encapsulated handling of app cookies and other data page.
|
| + * This is a copy of the regular CookiesView, customized for
|
| + * isolated apps.
|
| * @constructor
|
| */
|
| - function CookiesView(model) {
|
| - OptionsPage.call(this, 'cookies',
|
| + function AppCookiesView(model) {
|
| + OptionsPage.call(this, 'app-cookies',
|
| loadTimeData.getString('cookiesViewPageTabTitle'),
|
| - 'cookies-view-page');
|
| + 'app-cookies-view-page');
|
| }
|
|
|
| - cr.addSingletonGetter(CookiesView);
|
| + cr.addSingletonGetter(AppCookiesView);
|
|
|
| - CookiesView.prototype = {
|
| + AppCookiesView.prototype = {
|
| __proto__: OptionsPage.prototype,
|
|
|
| /**
|
| @@ -41,19 +43,19 @@ cr.define('options', function() {
|
| initializePage: function() {
|
| OptionsPage.prototype.initializePage.call(this);
|
|
|
| - $('cookies-search-box').addEventListener('search',
|
| + $('app-cookies-search-box').addEventListener('search',
|
| this.handleSearchQueryChange_.bind(this));
|
|
|
| - $('remove-all-cookies-button').onclick = function(e) {
|
| + $('remove-all-app-cookies-button').onclick = function(e) {
|
| chrome.send('removeAllCookies');
|
| };
|
|
|
| - var cookiesList = $('cookies-list');
|
| + var cookiesList = $('app-cookies-list');
|
| options.CookiesList.decorate(cookiesList);
|
|
|
| this.addEventListener('visibleChange', this.handleVisibleChange_);
|
|
|
| - $('cookies-view-overlay-confirm').onclick =
|
| + $('app-cookies-view-overlay-confirm').onclick =
|
| OptionsPage.closeOverlay.bind(OptionsPage);
|
| },
|
|
|
| @@ -62,7 +64,7 @@ cr.define('options', function() {
|
| * @inheritDoc
|
| */
|
| didShowPage: function() {
|
| - $('cookies-search-box').value = '';
|
| + $('app-cookies-search-box').value = '';
|
| },
|
|
|
| /**
|
| @@ -70,7 +72,7 @@ cr.define('options', function() {
|
| */
|
| searchCookie: function() {
|
| this.queryDelayTimerId_ = 0;
|
| - var filter = $('cookies-search-box').value;
|
| + var filter = $('app-cookies-search-box').value;
|
| if (this.lastQuery_ != filter) {
|
| this.lastQuery_ = filter;
|
| chrome.send('updateCookieSearchResults', [filter]);
|
| @@ -101,33 +103,37 @@ cr.define('options', function() {
|
| if (!this.visible)
|
| return;
|
|
|
| + // Inform the CookiesViewHandler that this is in the context of apps
|
| + // cookies dialog.
|
| + chrome.send('setViewContext', [true]);
|
| +
|
| if (!this.initialized_) {
|
| this.initialized_ = true;
|
| this.searchCookie();
|
| } else {
|
| - $('cookies-list').redraw();
|
| + $('app-cookies-list').redraw();
|
| }
|
|
|
| - $('cookies-search-box').focus();
|
| + $('app-cookies-search-box').focus();
|
| },
|
| };
|
|
|
| // CookiesViewHandler callbacks.
|
| - CookiesView.onTreeItemAdded = function(args) {
|
| - $('cookies-list').addByParentId(args[0], args[1], args[2]);
|
| + AppCookiesView.onTreeItemAdded = function(args) {
|
| + $('app-cookies-list').addByParentId(args[0], args[1], args[2]);
|
| };
|
|
|
| - CookiesView.onTreeItemRemoved = function(args) {
|
| - $('cookies-list').removeByParentId(args[0], args[1], args[2]);
|
| + AppCookiesView.onTreeItemRemoved = function(args) {
|
| + $('app-cookies-list').removeByParentId(args[0], args[1], args[2]);
|
| };
|
|
|
| - CookiesView.loadChildren = function(args) {
|
| - $('cookies-list').loadChildren(args[0], args[1]);
|
| + AppCookiesView.loadChildren = function(args) {
|
| + $('app-cookies-list').loadChildren(args[0], args[1]);
|
| };
|
|
|
| // Export
|
| return {
|
| - CookiesView: CookiesView
|
| + AppCookiesView: AppCookiesView
|
| };
|
|
|
| });
|
|
|