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

Side by Side Diff: chrome/browser/system_monitor/image_capture_device.mm

Issue 11416089: [Media Galleries] Filesystem interface for Mac PTP/MTP devices using ImageCaptureCore (part 3) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable GalleryNameMTP test for mac Created 7 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 unified diff | Download patch
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 #import "chrome/browser/system_monitor/image_capture_device.h" 5 #import "chrome/browser/system_monitor/image_capture_device.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/system_monitor/system_monitor.h" 8 #include "base/system_monitor/system_monitor.h"
9 #include "chrome/browser/system_monitor/media_storage_util.h" 9 #include "chrome/browser/system_monitor/media_storage_util.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 listener_->NoMoreItems(); 152 listener_->NoMoreItems();
153 } 153 }
154 154
155 - (void)didDownloadFile:(ICCameraFile*)file 155 - (void)didDownloadFile:(ICCameraFile*)file
156 error:(NSError*)error 156 error:(NSError*)error
157 options:(NSDictionary*)options 157 options:(NSDictionary*)options
158 contextInfo:(void*)contextInfo { 158 contextInfo:(void*)contextInfo {
159 std::string name = base::SysNSStringToUTF8([file name]); 159 std::string name = base::SysNSStringToUTF8([file name]);
160 160
161 if (error) { 161 if (error) {
162 DLOG(INFO) << "error..."
163 << base::SysNSStringToUTF8([error localizedDescription]);
162 if (listener_) 164 if (listener_)
163 listener_->DownloadedFile(name, base::PLATFORM_FILE_ERROR_FAILED); 165 listener_->DownloadedFile(name, base::PLATFORM_FILE_ERROR_FAILED);
164 return; 166 return;
165 } 167 }
166 168
167 std::string savedFilename = 169 std::string savedFilename =
168 base::SysNSStringToUTF8([options objectForKey:ICSavedFilename]); 170 base::SysNSStringToUTF8([options objectForKey:ICSavedFilename]);
169 std::string saveAsFilename = 171 std::string saveAsFilename =
170 base::SysNSStringToUTF8([options objectForKey:ICSaveAsFilename]); 172 base::SysNSStringToUTF8([options objectForKey:ICSaveAsFilename]);
171 if (savedFilename == saveAsFilename) { 173 if (savedFilename == saveAsFilename) {
(...skipping 12 matching lines...) Expand all
184 // Shared result value from file-copy closure to tell-listener closure. 186 // Shared result value from file-copy closure to tell-listener closure.
185 base::PlatformFileError* copyResult = new base::PlatformFileError(); 187 base::PlatformFileError* copyResult = new base::PlatformFileError();
186 content::BrowserThread::PostTaskAndReply( 188 content::BrowserThread::PostTaskAndReply(
187 content::BrowserThread::FILE, 189 content::BrowserThread::FILE,
188 FROM_HERE, 190 FROM_HERE,
189 base::Bind(&RenameFile, savedPath, saveAsPath, copyResult), 191 base::Bind(&RenameFile, savedPath, saveAsPath, copyResult),
190 base::Bind(&ReturnRenameResultToListener, listener_, name, copyResult)); 192 base::Bind(&ReturnRenameResultToListener, listener_, name, copyResult));
191 } 193 }
192 194
193 @end // ImageCaptureDevice 195 @end // ImageCaptureDevice
OLDNEW
« no previous file with comments | « chrome/browser/media_gallery/media_file_system_registry_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698