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

Side by Side Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 9696029: Updating pinning/unpinning code to be consistent with current API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Setting the src of an img to an empty string can crash the browser, so we 5 // Setting the src of an img to an empty string can crash the browser, so we
6 // use an empty 1x1 gif instead. 6 // use an empty 1x1 gif instead.
7 7
8 /** 8 /**
9 * FileManager constructor. 9 * FileManager constructor.
10 * 10 *
(...skipping 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after
3081 // checkbox and avoid the trouble. 3081 // checkbox and avoid the trouble.
3082 event.preventDefault(); 3082 event.preventDefault();
3083 } 3083 }
3084 }; 3084 };
3085 3085
3086 FileManager.prototype.onPinClick_ = function(checkbox, entry, event) { 3086 FileManager.prototype.onPinClick_ = function(checkbox, entry, event) {
3087 function callback(props) { 3087 function callback(props) {
3088 checkbox.checked = entry.gdata_.isPinned = props[0].isPinned; 3088 checkbox.checked = entry.gdata_.isPinned = props[0].isPinned;
3089 } 3089 }
3090 3090
3091 if (checkbox.checked) { 3091 chrome.fileBrowserPrivate.pinGDataFile([entry.toURL()],
3092 chrome.fileBrowserPrivate.pinGDataFile([entry.toURL()], callback); 3092 !checkbox.checked, callback);
3093 console.log('Pinning file ', entry.toURL());
3094 }
3095 event.preventDefault(); 3093 event.preventDefault();
3096 }; 3094 };
3097 3095
3098 FileManager.prototype.selectDefaultPathInFilenameInput_ = function() { 3096 FileManager.prototype.selectDefaultPathInFilenameInput_ = function() {
3099 var input = this.filenameInput_; 3097 var input = this.filenameInput_;
3100 input.focus(); 3098 input.focus();
3101 var selectionEnd = input.value.lastIndexOf('.'); 3099 var selectionEnd = input.value.lastIndexOf('.');
3102 if (selectionEnd == -1) { 3100 if (selectionEnd == -1) {
3103 input.select(); 3101 input.select();
3104 } else { 3102 } else {
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
4145 }); 4143 });
4146 }, onError); 4144 }, onError);
4147 4145
4148 function onError(err) { 4146 function onError(err) {
4149 console.log('Error while checking free space: ' + err); 4147 console.log('Error while checking free space: ' + err);
4150 setTimeout(doCheck, 1000 * 60); 4148 setTimeout(doCheck, 1000 * 60);
4151 } 4149 }
4152 } 4150 }
4153 } 4151 }
4154 })(); 4152 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698