| OLD | NEW |
| 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/base/dialogs/select_file_dialog.h" | 5 #include "ui/base/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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // NSSavePanel delegate method | 55 // NSSavePanel delegate method |
| 56 - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename; | 56 - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename; |
| 57 | 57 |
| 58 @end | 58 @end |
| 59 | 59 |
| 60 // Implementation of SelectFileDialog that shows Cocoa dialogs for choosing a | 60 // Implementation of SelectFileDialog that shows Cocoa dialogs for choosing a |
| 61 // file or folder. | 61 // file or folder. |
| 62 class SelectFileDialogImpl : public ui::SelectFileDialog { | 62 class SelectFileDialogImpl : public ui::SelectFileDialog { |
| 63 public: | 63 public: |
| 64 explicit SelectFileDialogImpl(Listener* listener, | 64 SelectFileDialogImpl(Listener* listener, |
| 65 ui::SelectFilePolicy* policy); | 65 ui::SelectFilePolicy* policy); |
| 66 | 66 |
| 67 // BaseShellDialog implementation. | 67 // BaseShellDialog implementation. |
| 68 virtual bool IsRunning(gfx::NativeWindow parent_window) const; | 68 virtual bool IsRunning(gfx::NativeWindow parent_window) const; |
| 69 virtual void ListenerDestroyed(); | 69 virtual void ListenerDestroyed(); |
| 70 | 70 |
| 71 // Callback from ObjC bridge. | 71 // Callback from ObjC bridge. |
| 72 void FileWasSelected(NSSavePanel* dialog, | 72 void FileWasSelected(NSSavePanel* dialog, |
| 73 NSWindow* parent_window, | 73 NSWindow* parent_window, |
| 74 bool was_cancelled, | 74 bool was_cancelled, |
| 75 bool is_multi, | 75 bool is_multi, |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 namespace ui { | 416 namespace ui { |
| 417 | 417 |
| 418 SelectFileDialog* CreateMacSelectFileDialog( | 418 SelectFileDialog* CreateMacSelectFileDialog( |
| 419 SelectFileDialog::Listener* listener, | 419 SelectFileDialog::Listener* listener, |
| 420 SelectFilePolicy* policy) { | 420 SelectFilePolicy* policy) { |
| 421 return new SelectFileDialogImpl(listener, policy); | 421 return new SelectFileDialogImpl(listener, policy); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace ui | 424 } // namespace ui |
| OLD | NEW |