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

Unified Diff: ui/file_manager/file_manager/foreground/js/navigation_list_model.js

Issue 593573003: Populate volume items without resolving their display roots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and update browser_tests. Created 6 years, 3 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: ui/file_manager/file_manager/foreground/js/navigation_list_model.js
diff --git a/ui/file_manager/file_manager/foreground/js/navigation_list_model.js b/ui/file_manager/file_manager/foreground/js/navigation_list_model.js
index 77e4f29c2dec7e2ab8c888ad3e9102f854caf86a..33c68809f005c030fcc9c10f2449b71a82d0c0d2 100644
--- a/ui/file_manager/file_manager/foreground/js/navigation_list_model.js
+++ b/ui/file_manager/file_manager/foreground/js/navigation_list_model.js
@@ -18,6 +18,22 @@ NavigationModelItem.prototype = {
};
/**
+ * Check whether given two model items are same.
+ * @param {NavigationModelItem} item1 The first item to be compared.
+ * @param {NavigationModelItem} item2 The second item to be compared.
+ * @return {boolean} True if given two model items are same.
+ */
+NavigationModelItem.isSame = function(item1, item2) {
+ if (item1.isVolume != item2.isVolume)
+ return false;
+
+ if (item1.isVolume)
+ return item1.volumeInfo === item2.volumeInfo;
+ else
+ return util.isSameEntry(item1.entry, item2.entry);
+};
+
+/**
* Item of NavigationListModel for shortcuts.
*
* @param {string} label Label.

Powered by Google App Engine
This is Rietveld 408576698