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

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: Moving from wstring to string16. 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]) {
132 if (args[1][i].appId == '') {
133 browser = args[1][i];
134 break;
135 }
136 }
137 }
138 if (browser) {
139 $('cookies-list').rootId = browser.id;
140 chrome.send('loadCookie', [browser.id]);
141 }
142 } else {
143 $('cookies-list').loadChildren(args[0], args[1]);
144 }
126 }; 145 };
127 146
128 // Export 147 // Export
129 return { 148 return {
130 CookiesView: CookiesView 149 CookiesView: CookiesView
131 }; 150 };
132 151
133 }); 152 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698