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

Side by Side Diff: chrome/browser/cocoa/shell_dialogs_mac.mm

Issue 155264: Set the save file type index properly (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
« 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/shell_dialogs.h" 5 #include "chrome/browser/shell_dialogs.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 if (type == SelectFileDialog::SELECT_SAVEAS_FILE) { 319 if (type == SelectFileDialog::SELECT_SAVEAS_FILE) {
320 paths.push_back(FilePath(base::SysNSStringToUTF8([panel filename]))); 320 paths.push_back(FilePath(base::SysNSStringToUTF8([panel filename])));
321 321
322 NSView* accessoryView = [panel accessoryView]; 322 NSView* accessoryView = [panel accessoryView];
323 if (accessoryView) { 323 if (accessoryView) {
324 NSPopUpButton* popup = [accessoryView viewWithTag:kFileTypePopupTag]; 324 NSPopUpButton* popup = [accessoryView viewWithTag:kFileTypePopupTag];
325 if (popup) { 325 if (popup) {
326 // File type indexes are 1-based. 326 // File type indexes are 1-based.
327 index = [popup indexOfSelectedItem] + 1; 327 index = [popup indexOfSelectedItem] + 1;
328 } 328 }
329 } else {
330 index = 1;
329 } 331 }
330 } else { 332 } else {
331 NSArray* filenames = [panel filenames]; 333 NSArray* filenames = [panel filenames];
332 for (NSString* filename in filenames) 334 for (NSString* filename in filenames)
333 paths.push_back(FilePath(base::SysNSStringToUTF8(filename))); 335 paths.push_back(FilePath(base::SysNSStringToUTF8(filename)));
334 } 336 }
335 } 337 }
336 338
337 selectFileDialogImpl_->FileWasSelected(panel, 339 selectFileDialogImpl_->FileWasSelected(panel,
338 parentWindow, 340 parentWindow,
339 did_cancel, 341 did_cancel,
340 isMulti, 342 isMulti,
341 paths, 343 paths,
342 index); 344 index);
343 } 345 }
344 346
345 @end 347 @end
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