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

Unified 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: Fixed all comments by 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options2/cookies_view.js
diff --git a/chrome/browser/resources/options2/cookies_view.js b/chrome/browser/resources/options2/cookies_view.js
index 50a58afa6f0b636fe40c0e34991df3809fa19b4b..e1327e04ebb84e7f1f4eb45b6a1e86def0113e06 100644
--- a/chrome/browser/resources/options2/cookies_view.js
+++ b/chrome/browser/resources/options2/cookies_view.js
@@ -122,7 +122,26 @@ cr.define('options', function() {
};
CookiesView.loadChildren = function(args) {
- $('cookies-list').loadChildren(args[0], args[1]);
+ // TODO(nasko): this should be temporary, until the UI is modified to
+ // properly account for the new "app" level in the tree model.
+ if (args[0] == null) {
+ // We are at the root of the tree, just load the browser wide cookies.
+ var browser = null;
+ for (var i = 0; i < args[1].length; ++i) {
+ if (args[1][i]) {
Evan Stade 2012/06/21 04:01:41 combine these two if conditions into one with &&
nasko 2012/06/21 16:22:12 Done.
+ if (args[1][i].appId == '') {
Evan Stade 2012/06/21 04:01:41 ===
nasko 2012/06/21 16:22:12 Done.
+ browser = args[1][i];
+ break;
+ }
+ }
+ }
+ if (browser) {
+ $('cookies-list').rootId = browser.id;
+ chrome.send('loadCookie', [browser.id]);
+ }
+ } else {
+ $('cookies-list').loadChildren(args[0], args[1]);
+ }
};
// Export

Powered by Google App Engine
This is Rietveld 408576698