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

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

Issue 54493010: Use title on Mac file select dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 #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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 // Note: we need to retain the dialog as owning_window can be null. 187 // Note: we need to retain the dialog as owning_window can be null.
188 // (See http://crbug.com/29213 .) 188 // (See http://crbug.com/29213 .)
189 NSSavePanel* dialog; 189 NSSavePanel* dialog;
190 if (type == SELECT_SAVEAS_FILE) 190 if (type == SELECT_SAVEAS_FILE)
191 dialog = [[NSSavePanel savePanel] retain]; 191 dialog = [[NSSavePanel savePanel] retain];
192 else 192 else
193 dialog = [[NSOpenPanel openPanel] retain]; 193 dialog = [[NSOpenPanel openPanel] retain];
194 194
195 if (!title.empty()) 195 if (!title.empty())
196 [dialog setTitle:base::SysUTF16ToNSString(title)]; 196 [dialog setMessage:base::SysUTF16ToNSString(title)];
197 197
198 NSString* default_dir = nil; 198 NSString* default_dir = nil;
199 NSString* default_filename = nil; 199 NSString* default_filename = nil;
200 if (!default_path.empty()) { 200 if (!default_path.empty()) {
201 // The file dialog is going to do a ton of stats anyway. Not much 201 // The file dialog is going to do a ton of stats anyway. Not much
202 // point in eliminating this one. 202 // point in eliminating this one.
203 base::ThreadRestrictions::ScopedAllowIO allow_io; 203 base::ThreadRestrictions::ScopedAllowIO allow_io;
204 if (base::DirectoryExists(default_path)) { 204 if (base::DirectoryExists(default_path)) {
205 default_dir = base::SysUTF8ToNSString(default_path.value()); 205 default_dir = base::SysUTF8ToNSString(default_path.value());
206 } else { 206 } else {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 420
421 namespace ui { 421 namespace ui {
422 422
423 SelectFileDialog* CreateMacSelectFileDialog( 423 SelectFileDialog* CreateMacSelectFileDialog(
424 SelectFileDialog::Listener* listener, 424 SelectFileDialog::Listener* listener,
425 SelectFilePolicy* policy) { 425 SelectFilePolicy* policy) {
426 return new SelectFileDialogImpl(listener, policy); 426 return new SelectFileDialogImpl(listener, policy);
427 } 427 }
428 428
429 } // namespace ui 429 } // namespace ui
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