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> |
11 #include <set> | 11 #include <set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/mac/bundle_locations.h" | 16 #include "base/mac/bundle_locations.h" |
17 #include "base/mac/foundation_util.h" | 17 #include "base/mac/foundation_util.h" |
18 #include "base/mac/mac_util.h" | 18 #include "base/mac/mac_util.h" |
19 #include "base/mac/scoped_cftyperef.h" | 19 #include "base/mac/scoped_cftyperef.h" |
20 #import "base/memory/scoped_nsobject.h" | 20 #import "base/mac/scoped_nsobject.h" |
21 #include "base/strings/sys_string_conversions.h" | 21 #include "base/strings/sys_string_conversions.h" |
22 #include "base/threading/thread_restrictions.h" | 22 #include "base/threading/thread_restrictions.h" |
23 #include "grit/ui_strings.h" | 23 #include "grit/ui_strings.h" |
24 #import "ui/base/cocoa/nib_loading.h" | 24 #import "ui/base/cocoa/nib_loading.h" |
25 #include "ui/base/l10n/l10n_util_mac.h" | 25 #include "ui/base/l10n/l10n_util_mac.h" |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 const int kFileTypePopupTag = 1234; | 29 const int kFileTypePopupTag = 1234; |
30 | 30 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 private: | 93 private: |
94 virtual ~SelectFileDialogImpl(); | 94 virtual ~SelectFileDialogImpl(); |
95 | 95 |
96 // Gets the accessory view for the save dialog. | 96 // Gets the accessory view for the save dialog. |
97 NSView* GetAccessoryView(const FileTypeInfo* file_types, | 97 NSView* GetAccessoryView(const FileTypeInfo* file_types, |
98 int file_type_index); | 98 int file_type_index); |
99 | 99 |
100 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; | 100 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; |
101 | 101 |
102 // The bridge for results from Cocoa to return to us. | 102 // The bridge for results from Cocoa to return to us. |
103 scoped_nsobject<SelectFileDialogBridge> bridge_; | 103 base::scoped_nsobject<SelectFileDialogBridge> bridge_; |
104 | 104 |
105 // A map from file dialogs to the |params| user data associated with them. | 105 // A map from file dialogs to the |params| user data associated with them. |
106 std::map<NSSavePanel*, void*> params_map_; | 106 std::map<NSSavePanel*, void*> params_map_; |
107 | 107 |
108 // The set of all parent windows for which we are currently running dialogs. | 108 // The set of all parent windows for which we are currently running dialogs. |
109 std::set<NSWindow*> parents_; | 109 std::set<NSWindow*> parents_; |
110 | 110 |
111 // A map from file dialogs to their types. | 111 // A map from file dialogs to their types. |
112 std::map<NSSavePanel*, Type> type_map_; | 112 std::map<NSSavePanel*, Type> type_map_; |
113 | 113 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |