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

Unified Diff: ui/file_manager/gallery/js/slide_mode.js

Issue 971173002: Gallery: Start to use new metadata model in Gallery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 5 years, 10 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
« no previous file with comments | « ui/file_manager/gallery/js/ribbon.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/slide_mode.js
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index fb91ef2ed3e39ee248d0d1fd6489abc33572cc59..e04be8a3ee93ba7699cfd27e9ac9990c5c94d0b9 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -13,18 +13,22 @@
* @param {!ErrorBanner} errorBanner Error banner.
* @param {!cr.ui.ArrayDataModel} dataModel Data model.
* @param {!cr.ui.ListSelectionModel} selectionModel Selection model.
+ * @param {!MetadataModel} metadataModel
+ * @param {!ThumbnailModel} thumbnailModel
* @param {!Object} context Context.
* @param {!VolumeManager} volumeManager Volume manager.
* @param {function(function())} toggleMode Function to toggle the Gallery mode.
* @param {function(string):string} displayStringFunction String formatting
* function.
+
* @constructor
* @struct
* @suppress {checkStructDictInheritance}
* @extends {cr.EventTarget}
*/
function SlideMode(container, content, toolbar, prompt, errorBanner, dataModel,
- selectionModel, context, volumeManager, toggleMode, displayStringFunction) {
+ selectionModel, metadataModel, thumbnailModel, context, volumeManager,
+ toggleMode, displayStringFunction) {
/**
* @type {!HTMLElement}
* @private
@@ -337,7 +341,7 @@ function SlideMode(container, content, toolbar, prompt, errorBanner, dataModel,
* @const
*/
this.ribbon_ = new Ribbon(
- this.document_, this.dataModel_, this.selectionModel_);
+ this.document_, this.dataModel_, this.selectionModel_, thumbnailModel);
this.ribbonSpacer_.appendChild(this.ribbon_);
util.createChild(this.container_, 'spinner');
@@ -428,7 +432,8 @@ function SlideMode(container, content, toolbar, prompt, errorBanner, dataModel,
*/
this.imageView_ = new ImageView(
this.imageContainer_,
- this.viewport_);
+ this.viewport_,
+ metadataModel);
/**
* @type {!ImageEditor}
@@ -993,7 +998,6 @@ SlideMode.prototype.loadItem_ = function(
SlideMode.prototype.itemLoaded_ = function(
item, loadCallback, loadType, delay, opt_error) {
var entry = item.getEntry();
- var metadata = item.getMetadata();
this.showSpinner_(false);
if (loadType === ImageView.LoadType.ERROR) {
@@ -1015,7 +1019,7 @@ SlideMode.prototype.itemLoaded_ = function(
};
ImageUtil.metrics.recordSmallCount(ImageUtil.getMetricName('Size.MB'),
- toMillions(metadata.filesystem.size));
+ toMillions(item.getMetadataItem().size));
var canvas = this.imageView_.getCanvas();
ImageUtil.metrics.recordSmallCount(ImageUtil.getMetricName('Size.MPix'),
« no previous file with comments | « ui/file_manager/gallery/js/ribbon.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698