OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 #include <map> | 6 #include <map> |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 explicit SelectFileDialogImplGTK(Listener* listener, | 42 explicit SelectFileDialogImplGTK(Listener* listener, |
43 ui::SelectFilePolicy* policy); | 43 ui::SelectFilePolicy* policy); |
44 | 44 |
45 protected: | 45 protected: |
46 virtual ~SelectFileDialogImplGTK(); | 46 virtual ~SelectFileDialogImplGTK(); |
47 | 47 |
48 // SelectFileDialog implementation. | 48 // SelectFileDialog implementation. |
49 // |params| is user data we pass back via the Listener interface. | 49 // |params| is user data we pass back via the Listener interface. |
50 virtual void SelectFileImpl( | 50 virtual void SelectFileImpl( |
51 Type type, | 51 Type type, |
52 const string16& title, | 52 const base::string16& title, |
53 const base::FilePath& default_path, | 53 const base::FilePath& default_path, |
54 const FileTypeInfo* file_types, | 54 const FileTypeInfo* file_types, |
55 int file_type_index, | 55 int file_type_index, |
56 const base::FilePath::StringType& default_extension, | 56 const base::FilePath::StringType& default_extension, |
57 gfx::NativeWindow owning_window, | 57 gfx::NativeWindow owning_window, |
58 void* params) OVERRIDE; | 58 void* params) OVERRIDE; |
59 | 59 |
60 private: | 60 private: |
61 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; | 61 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; |
62 | 62 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 bool SelectFileDialogImplGTK::HasMultipleFileTypeChoicesImpl() { | 162 bool SelectFileDialogImplGTK::HasMultipleFileTypeChoicesImpl() { |
163 return file_types_.extensions.size() > 1; | 163 return file_types_.extensions.size() > 1; |
164 } | 164 } |
165 | 165 |
166 // We ignore |default_extension|. | 166 // We ignore |default_extension|. |
167 void SelectFileDialogImplGTK::SelectFileImpl( | 167 void SelectFileDialogImplGTK::SelectFileImpl( |
168 Type type, | 168 Type type, |
169 const string16& title, | 169 const base::string16& title, |
170 const base::FilePath& default_path, | 170 const base::FilePath& default_path, |
171 const FileTypeInfo* file_types, | 171 const FileTypeInfo* file_types, |
172 int file_type_index, | 172 int file_type_index, |
173 const base::FilePath::StringType& default_extension, | 173 const base::FilePath::StringType& default_extension, |
174 gfx::NativeWindow owning_window, | 174 gfx::NativeWindow owning_window, |
175 void* params) { | 175 void* params) { |
176 type_ = type; | 176 type_ = type; |
177 // |owning_window| can be null when user right-clicks on a downloadable item | 177 // |owning_window| can be null when user right-clicks on a downloadable item |
178 // and chooses 'Open Link in New Tab' when 'Ask where to save each file | 178 // and chooses 'Open Link in New Tab' when 'Ask where to save each file |
179 // before downloading.' preference is turned on. (http://crbug.com/29213) | 179 // before downloading.' preference is turned on. (http://crbug.com/29213) |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 } // namespace | 572 } // namespace |
573 | 573 |
574 namespace ui { | 574 namespace ui { |
575 | 575 |
576 SelectFileDialogImpl* SelectFileDialogImpl::NewSelectFileDialogImplGTK( | 576 SelectFileDialogImpl* SelectFileDialogImpl::NewSelectFileDialogImplGTK( |
577 Listener* listener, ui::SelectFilePolicy* policy) { | 577 Listener* listener, ui::SelectFilePolicy* policy) { |
578 return new SelectFileDialogImplGTK(listener, policy); | 578 return new SelectFileDialogImplGTK(listener, policy); |
579 } | 579 } |
580 | 580 |
581 } // namespace ui | 581 } // namespace ui |
OLD | NEW |