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/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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // SelectFileDialog implementation. | 78 // SelectFileDialog implementation. |
79 // |params| is user data we pass back via the Listener interface. | 79 // |params| is user data we pass back via the Listener interface. |
80 void SelectFileImpl(Type type, | 80 void SelectFileImpl(Type type, |
81 const base::string16& title, | 81 const base::string16& title, |
82 const base::FilePath& default_path, | 82 const base::FilePath& default_path, |
83 const FileTypeInfo* file_types, | 83 const FileTypeInfo* file_types, |
84 int file_type_index, | 84 int file_type_index, |
85 const base::FilePath::StringType& default_extension, | 85 const base::FilePath::StringType& default_extension, |
86 gfx::NativeWindow owning_window, | 86 gfx::NativeWindow owning_window, |
87 void* params) override; | 87 void* params) override; |
| 88 void CloseImpl() override; |
88 | 89 |
89 private: | 90 private: |
90 ~SelectFileDialogImpl() override; | 91 ~SelectFileDialogImpl() override; |
91 | 92 |
92 // Gets the accessory view for the save dialog. | 93 // Gets the accessory view for the save dialog. |
93 NSView* GetAccessoryView(const FileTypeInfo* file_types, | 94 NSView* GetAccessoryView(const FileTypeInfo* file_types, |
94 int file_type_index); | 95 int file_type_index); |
95 | 96 |
96 bool HasMultipleFileTypeChoicesImpl() override; | 97 bool HasMultipleFileTypeChoicesImpl() override; |
97 | 98 |
(...skipping 14 matching lines...) Expand all Loading... |
112 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); | 113 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); |
113 }; | 114 }; |
114 | 115 |
115 SelectFileDialogImpl::SelectFileDialogImpl(Listener* listener, | 116 SelectFileDialogImpl::SelectFileDialogImpl(Listener* listener, |
116 ui::SelectFilePolicy* policy) | 117 ui::SelectFilePolicy* policy) |
117 : SelectFileDialog(listener, policy), | 118 : SelectFileDialog(listener, policy), |
118 bridge_([[SelectFileDialogBridge alloc] | 119 bridge_([[SelectFileDialogBridge alloc] |
119 initWithSelectFileDialogImpl:this]) { | 120 initWithSelectFileDialogImpl:this]) { |
120 } | 121 } |
121 | 122 |
| 123 void SelectFileDialogImpl::CloseImpl() { |
| 124 NOTIMPLEMENTED(); |
| 125 } |
| 126 |
122 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow parent_window) const { | 127 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow parent_window) const { |
123 return parents_.find(parent_window) != parents_.end(); | 128 return parents_.find(parent_window) != parents_.end(); |
124 } | 129 } |
125 | 130 |
126 void SelectFileDialogImpl::ListenerDestroyed() { | 131 void SelectFileDialogImpl::ListenerDestroyed() { |
127 listener_ = NULL; | 132 listener_ = NULL; |
128 } | 133 } |
129 | 134 |
130 void SelectFileDialogImpl::FileWasSelected( | 135 void SelectFileDialogImpl::FileWasSelected( |
131 NSSavePanel* dialog, | 136 NSSavePanel* dialog, |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 425 |
421 namespace ui { | 426 namespace ui { |
422 | 427 |
423 SelectFileDialog* CreateMacSelectFileDialog( | 428 SelectFileDialog* CreateMacSelectFileDialog( |
424 SelectFileDialog::Listener* listener, | 429 SelectFileDialog::Listener* listener, |
425 SelectFilePolicy* policy) { | 430 SelectFilePolicy* policy) { |
426 return new SelectFileDialogImpl(listener, policy); | 431 return new SelectFileDialogImpl(listener, policy); |
427 } | 432 } |
428 | 433 |
429 } // namespace ui | 434 } // namespace ui |
OLD | NEW |