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

Side by Side Diff: chrome/browser/download/download_status_updater_mac.mm

Issue 2391573004: [Mac] Remove usage of deprecated FNNotifyByPath(). (Closed)
Patch Set: Created 4 years, 2 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
« 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 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
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 }
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