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

Unified Diff: chrome/browser/resources/file_manager/js/image_editor/gallery_demo.js

Issue 8819013: Add UMA metrics to Photo Editor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years 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/file_manager/js/image_editor/gallery_demo.js
diff --git a/chrome/browser/resources/file_manager/js/image_editor/gallery_demo.js b/chrome/browser/resources/file_manager/js/image_editor/gallery_demo.js
index d6b3029c742160f961c4d0f3fa2d2a29ac8ba8a6..a28df8dbe4799a2bf832a958b3180c0ec006d160 100644
--- a/chrome/browser/resources/file_manager/js/image_editor/gallery_demo.js
+++ b/chrome/browser/resources/file_manager/js/image_editor/gallery_demo.js
@@ -17,41 +17,31 @@ var mockActions = [
}];
-var mockDisplayStrings = {
- GALLERY_EDIT: 'Edit',
- GALLERY_SHARE: 'Share',
- GALLERY_ENTER_WHEN_DONE: 'Press Enter when done',
- GALLERY_AUTOFIX: 'Auto-fix',
- GALLERY_FIXED: 'Fixed',
- GALLERY_CROP: 'Crop',
- GALLERY_EXPOSURE: 'Brightness',
- GALLERY_BRIGHTNESS: 'Brightness',
- GALLERY_CONTRAST: 'Contrast',
- GALLERY_ROTATE_LEFT: 'Left',
- GALLERY_ROTATE_RIGHT: 'Right',
- GALLERY_UNDO: 'Undo',
- GALLERY_REDO: 'Redo'
-};
+// For quick access from JS console. Use trace.dump() to print all lines.
+var trace;
function loadGallery(items) {
if (!items) items = [createTestGrid()];
var iframe = document.querySelector('.gallery-frame');
var contentWindow = iframe.contentWindow;
-
- contentWindow.ImageUtil.trace.bindToDOM(
- document.querySelector('.debug-output'));
-
- contentWindow.Gallery.open(
- null, // No local file access
- items,
- items[0],
- function() {}, // Do nothing on Close
- metadataProvider,
- mockActions,
- function(id) { return mockDisplayStrings[id] || id } );
-
- iframe.focus();
+ trace = contentWindow.ImageUtil.trace;
+ trace.bindToDOM(document.querySelector('.debug-output'));
+
+ contentWindow.ImageUtil.metrics = metrics;
+
+ chrome.fileBrowserPrivate.getStrings(function(strings) {
+ contentWindow.Gallery.open(
+ null, // No local file access
+ items,
+ items[0],
+ function() {}, // Do nothing on Close
+ metadataProvider,
+ mockActions,
+ function(id) { return strings[id] || id } );
+
+ iframe.focus();
+ });
}
function createTestGrid() {

Powered by Google App Engine
This is Rietveld 408576698