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 // This file implements common select dialog functionality between GTK and KDE. | 5 // This file implements common select dialog functionality between GTK and KDE. |
6 | 6 |
7 #ifndef CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ | 7 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_SELECT_FILE_DIALOG_IMPL_H_ |
8 #define CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ | 8 #define CHROME_BROWSER_UI_LIBGTK2UI_SELECT_FILE_DIALOG_IMPL_H_ |
9 | 9 |
10 #include <set> | 10 #include <set> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/nix/xdg_util.h" | 13 #include "base/nix/xdg_util.h" |
14 #include "chrome/browser/ui/select_file_dialog.h" | 14 #include "ui/base/dialogs/select_file_dialog.h" |
| 15 #include "ui/base/dialogs/select_file_policy.h" |
| 16 #include "ui/aura/window.h" |
| 17 |
| 18 namespace libgtk2ui { |
15 | 19 |
16 // Shared implementation SelectFileDialog used by SelectFileDialogImplGTK | 20 // Shared implementation SelectFileDialog used by SelectFileDialogImplGTK |
17 class SelectFileDialogImpl : public SelectFileDialog { | 21 class SelectFileDialogImpl : public ui::SelectFileDialog { |
18 public: | 22 public: |
| 23 // Main factory method which returns correct type. |
| 24 static ui::SelectFileDialog* Create(Listener* listener, |
| 25 ui::SelectFilePolicy* policy); |
| 26 |
19 // Factory method for creating a GTK-styled SelectFileDialogImpl | 27 // Factory method for creating a GTK-styled SelectFileDialogImpl |
20 static SelectFileDialogImpl* NewSelectFileDialogImplGTK( | 28 static SelectFileDialogImpl* NewSelectFileDialogImplGTK( |
21 Listener* listener, | 29 Listener* listener, |
22 ui::SelectFilePolicy* policy); | 30 ui::SelectFilePolicy* policy); |
23 // Factory method for creating a KDE-styled SelectFileDialogImpl | 31 // Factory method for creating a KDE-styled SelectFileDialogImpl |
24 static SelectFileDialogImpl* NewSelectFileDialogImplKDE( | 32 static SelectFileDialogImpl* NewSelectFileDialogImplKDE( |
25 Listener* listener, | 33 Listener* listener, |
26 ui::SelectFilePolicy* policy, | 34 ui::SelectFilePolicy* policy, |
27 base::nix::DesktopEnvironment desktop); | 35 base::nix::DesktopEnvironment desktop); |
28 | 36 |
(...skipping 28 matching lines...) Expand all Loading... |
57 bool CallDirectoryExistsOnUIThread(const FilePath& path); | 65 bool CallDirectoryExistsOnUIThread(const FilePath& path); |
58 | 66 |
59 // The file filters. | 67 // The file filters. |
60 FileTypeInfo file_types_; | 68 FileTypeInfo file_types_; |
61 | 69 |
62 // The index of the default selected file filter. | 70 // The index of the default selected file filter. |
63 // Note: This starts from 1, not 0. | 71 // Note: This starts from 1, not 0. |
64 size_t file_type_index_; | 72 size_t file_type_index_; |
65 | 73 |
66 // The set of all parent windows for which we are currently running dialogs. | 74 // The set of all parent windows for which we are currently running dialogs. |
67 std::set<GtkWindow*> parents_; | 75 std::set<aura::Window*> parents_; |
68 | 76 |
69 // The type of dialog we are showing the user. | 77 // The type of dialog we are showing the user. |
70 Type type_; | 78 Type type_; |
71 | 79 |
72 // These two variables track where the user last saved a file or opened a | 80 // These two variables track where the user last saved a file or opened a |
73 // file so that we can display future dialogs with the same starting path. | 81 // file so that we can display future dialogs with the same starting path. |
74 static FilePath* last_saved_path_; | 82 static FilePath* last_saved_path_; |
75 static FilePath* last_opened_path_; | 83 static FilePath* last_opened_path_; |
76 | 84 |
77 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); | 85 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); |
78 }; | 86 }; |
79 | 87 |
80 #endif // CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ | 88 } // namespace libgtk2ui |
| 89 |
| 90 #endif // CHROME_BROWSER_UI_LIBGTK2UI_SELECT_FILE_DIALOG_IMPL_H_ |
OLD | NEW |