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

Side by Side Diff: chrome/browser/resources/options2/cookies_view.js

Issue 10536017: Refactoring CookiesTreeModel to support multiple data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for commes by James and Evan. Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('options', function() { 5 cr.define('options', function() {
6 6
7 var OptionsPage = options.OptionsPage; 7 var OptionsPage = options.OptionsPage;
8 8
9 ///////////////////////////////////////////////////////////////////////////// 9 /////////////////////////////////////////////////////////////////////////////
10 // CookiesView class: 10 // CookiesView class:
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // CookiesViewHandler callbacks. 115 // CookiesViewHandler callbacks.
116 CookiesView.onTreeItemAdded = function(args) { 116 CookiesView.onTreeItemAdded = function(args) {
117 $('cookies-list').addByParentId(args[0], args[1], args[2]); 117 $('cookies-list').addByParentId(args[0], args[1], args[2]);
118 }; 118 };
119 119
120 CookiesView.onTreeItemRemoved = function(args) { 120 CookiesView.onTreeItemRemoved = function(args) {
121 $('cookies-list').removeByParentId(args[0], args[1], args[2]); 121 $('cookies-list').removeByParentId(args[0], args[1], args[2]);
122 }; 122 };
123 123
124 CookiesView.loadChildren = function(args) { 124 CookiesView.loadChildren = function(args) {
125 $('cookies-list').loadChildren(args[0], args[1]); 125 // TODO(nasko): this should be temporary, until the UI is modified to
126 // properly account for the new "app" level in the tree model.
127 if (args[0] == null) {
128 // We are at the root of the tree, just load the browser wide cookies.
129 var browser = null;
130 for (var i = 0; i < args[1].length; ++i) {
131 if (args[1][i] && args[1][i].appId === '') {
132 browser = args[1][i];
133 break;
134 }
135 }
136 if (browser) {
137 $('cookies-list').rootId = browser.id;
138 chrome.send('loadCookie', [browser.id]);
139 }
140 } else {
141 $('cookies-list').loadChildren(args[0], args[1]);
142 }
126 }; 143 };
127 144
128 // Export 145 // Export
129 return { 146 return {
130 CookiesView: CookiesView 147 CookiesView: CookiesView
131 }; 148 };
132 149
133 }); 150 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options2/cookies_list.js ('k') | chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698