OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GTK_SELECT_FILE_DIALOG_IMPL_H_ |
8 #define CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ | 8 #define CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <set> | 11 #include <set> |
12 | 12 |
| 13 #include "base/compiler_specific.h" |
13 #include "base/nix/xdg_util.h" | 14 #include "base/nix/xdg_util.h" |
14 #include "chrome/browser/ui/select_file_dialog.h" | 15 #include "chrome/browser/ui/select_file_dialog.h" |
15 | 16 |
16 // Shared implementation SelectFileDialog used by SelectFileDialogImplGTK | 17 // Shared implementation SelectFileDialog used by SelectFileDialogImplGTK |
17 class SelectFileDialogImpl : public SelectFileDialog { | 18 class SelectFileDialogImpl : public SelectFileDialog { |
18 public: | 19 public: |
19 // Factory method for creating a GTK-styled SelectFileDialogImpl | 20 // Factory method for creating a GTK-styled SelectFileDialogImpl |
20 static SelectFileDialogImpl* NewSelectFileDialogImplGTK(Listener* listener); | 21 static SelectFileDialogImpl* NewSelectFileDialogImplGTK(Listener* listener); |
21 // Factory method for creating a KDE-styled SelectFileDialogImpl | 22 // Factory method for creating a KDE-styled SelectFileDialogImpl |
22 static SelectFileDialogImpl* NewSelectFileDialogImplKDE( | 23 static SelectFileDialogImpl* NewSelectFileDialogImplKDE( |
23 Listener* listener, | 24 Listener* listener, |
24 base::nix::DesktopEnvironment desktop); | 25 base::nix::DesktopEnvironment desktop); |
25 | 26 |
26 // BaseShellDialog implementation. | 27 // BaseShellDialog implementation. |
27 virtual bool IsRunning(gfx::NativeWindow parent_window) const; | 28 virtual bool IsRunning(gfx::NativeWindow parent_window) const OVERRIDE; |
28 virtual void ListenerDestroyed(); | 29 virtual void ListenerDestroyed() OVERRIDE; |
29 | 30 |
30 protected: | 31 protected: |
31 explicit SelectFileDialogImpl(Listener* listener); | 32 explicit SelectFileDialogImpl(Listener* listener); |
32 virtual ~SelectFileDialogImpl(); | 33 virtual ~SelectFileDialogImpl(); |
33 | 34 |
34 // SelectFileDialog implementation. | 35 // SelectFileDialog implementation. |
35 // |params| is user data we pass back via the Listener interface. | 36 // |params| is user data we pass back via the Listener interface. |
36 virtual void SelectFileImpl(Type type, | 37 virtual void SelectFileImpl(Type type, |
37 const string16& title, | 38 const string16& title, |
38 const FilePath& default_path, | 39 const FilePath& default_path, |
(...skipping 24 matching lines...) Expand all Loading... |
63 | 64 |
64 // These two variables track where the user last saved a file or opened a | 65 // These two variables track where the user last saved a file or opened a |
65 // file so that we can display future dialogs with the same starting path. | 66 // file so that we can display future dialogs with the same starting path. |
66 static FilePath* last_saved_path_; | 67 static FilePath* last_saved_path_; |
67 static FilePath* last_opened_path_; | 68 static FilePath* last_opened_path_; |
68 | 69 |
69 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); | 70 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); |
70 }; | 71 }; |
71 | 72 |
72 #endif // CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ | 73 #endif // CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ |
OLD | NEW |