Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/download/download_status_updater.h" | 5 #include "chrome/browser/download/download_status_updater.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/mac/sdk_forward_declarations.h" | 9 #include "base/mac/sdk_forward_declarations.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 NSString* download_path = | 235 NSString* download_path = |
| 236 base::mac::FilePathToNSString(download->GetTargetFilePath()); | 236 base::mac::FilePathToNSString(download->GetTargetFilePath()); |
| 237 if (download->GetState() == content::DownloadItem::COMPLETE) { | 237 if (download->GetState() == content::DownloadItem::COMPLETE) { |
| 238 // Bounce the dock icon. | 238 // Bounce the dock icon. |
| 239 [[NSDistributedNotificationCenter defaultCenter] | 239 [[NSDistributedNotificationCenter defaultCenter] |
| 240 postNotificationName:@"com.apple.DownloadFileFinished" | 240 postNotificationName:@"com.apple.DownloadFileFinished" |
| 241 object:download_path]; | 241 object:download_path]; |
| 242 } | 242 } |
| 243 | 243 |
| 244 // Notify the Finder. | 244 // Notify the Finder. |
| 245 NSString* parent_path = [download_path stringByDeletingLastPathComponent]; | 245 [[NSWorkspace sharedWorkspace] noteFileSystemChanged:download_path]; |
|
Avi (use Gerrit)
2016/10/04 22:12:29
-noteFileSystemChanged: has the note:
"Use of thi
Robert Sesek
2016/10/04 22:38:49
Yes, as far as I know, the only public FSEvents AP
| |
| 246 FNNotifyByPath( | |
| 247 reinterpret_cast<const UInt8*>([parent_path fileSystemRepresentation]), | |
| 248 kFNDirectoryModifiedMessage, | |
| 249 kNilOptions); | |
| 250 } | 246 } |
| 251 } | 247 } |
| OLD | NEW |