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

Side by Side Diff: ui/shell_dialogs/select_file_dialog_mac.mm

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
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 #include "ui/shell_dialogs/select_file_dialog.h" 5 #include "ui/shell_dialogs/select_file_dialog.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 if (!title.empty()) 194 if (!title.empty())
195 [dialog setTitle:base::SysUTF16ToNSString(title)]; 195 [dialog setTitle:base::SysUTF16ToNSString(title)];
196 196
197 NSString* default_dir = nil; 197 NSString* default_dir = nil;
198 NSString* default_filename = nil; 198 NSString* default_filename = nil;
199 if (!default_path.empty()) { 199 if (!default_path.empty()) {
200 // The file dialog is going to do a ton of stats anyway. Not much 200 // The file dialog is going to do a ton of stats anyway. Not much
201 // point in eliminating this one. 201 // point in eliminating this one.
202 base::ThreadRestrictions::ScopedAllowIO allow_io; 202 base::ThreadRestrictions::ScopedAllowIO allow_io;
203 if (file_util::DirectoryExists(default_path)) { 203 if (base::DirectoryExists(default_path)) {
204 default_dir = base::SysUTF8ToNSString(default_path.value()); 204 default_dir = base::SysUTF8ToNSString(default_path.value());
205 } else { 205 } else {
206 default_dir = base::SysUTF8ToNSString(default_path.DirName().value()); 206 default_dir = base::SysUTF8ToNSString(default_path.DirName().value());
207 default_filename = 207 default_filename =
208 base::SysUTF8ToNSString(default_path.BaseName().value()); 208 base::SysUTF8ToNSString(default_path.BaseName().value());
209 } 209 }
210 } 210 }
211 211
212 NSArray* allowed_file_types = nil; 212 NSArray* allowed_file_types = nil;
213 if (file_types) { 213 if (file_types) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 namespace ui { 418 namespace ui {
419 419
420 SelectFileDialog* CreateMacSelectFileDialog( 420 SelectFileDialog* CreateMacSelectFileDialog(
421 SelectFileDialog::Listener* listener, 421 SelectFileDialog::Listener* listener,
422 SelectFilePolicy* policy) { 422 SelectFilePolicy* policy) {
423 return new SelectFileDialogImpl(listener, policy); 423 return new SelectFileDialogImpl(listener, policy);
424 } 424 }
425 425
426 } // namespace ui 426 } // namespace ui
OLDNEW
« no previous file with comments | « ui/shell_dialogs/gtk/select_file_dialog_impl.cc ('k') | webkit/browser/appcache/appcache_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698