| 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_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/compiler_specific.h" |
| 14 #include "base/nix/xdg_util.h" | 14 #include "base/nix/xdg_util.h" |
| 15 #include "chrome/browser/ui/select_file_dialog.h" | 15 #include "chrome/browser/ui/select_file_dialog.h" |
| 16 | 16 |
| 17 // Shared implementation SelectFileDialog used by SelectFileDialogImplGTK | 17 // Shared implementation SelectFileDialog used by SelectFileDialogImplGTK |
| 18 class SelectFileDialogImpl : public SelectFileDialog { | 18 class SelectFileDialogImpl : public SelectFileDialog { |
| 19 public: | 19 public: |
| 20 // Factory method for creating a GTK-styled SelectFileDialogImpl | 20 // Factory method for creating a GTK-styled SelectFileDialogImpl |
| 21 static SelectFileDialogImpl* NewSelectFileDialogImplGTK( | 21 static SelectFileDialogImpl* NewSelectFileDialogImplGTK(Listener* listener); |
| 22 Listener* listener, | |
| 23 ui::SelectFilePolicy* policy); | |
| 24 // Factory method for creating a KDE-styled SelectFileDialogImpl | 22 // Factory method for creating a KDE-styled SelectFileDialogImpl |
| 25 static SelectFileDialogImpl* NewSelectFileDialogImplKDE( | 23 static SelectFileDialogImpl* NewSelectFileDialogImplKDE( |
| 26 Listener* listener, | 24 Listener* listener, |
| 27 ui::SelectFilePolicy* policy, | |
| 28 base::nix::DesktopEnvironment desktop); | 25 base::nix::DesktopEnvironment desktop); |
| 29 | 26 |
| 30 // Returns true if the SelectFileDialog class returned by | 27 // Returns true if the SelectFileDialog class returned by |
| 31 // NewSelectFileDialogImplKDE will actually work. | 28 // NewSelectFileDialogImplKDE will actually work. |
| 32 static bool CheckKDEDialogWorksOnUIThread(); | 29 static bool CheckKDEDialogWorksOnUIThread(); |
| 33 | 30 |
| 34 // BaseShellDialog implementation. | 31 // BaseShellDialog implementation. |
| 35 virtual bool IsRunning(gfx::NativeWindow parent_window) const OVERRIDE; | 32 virtual bool IsRunning(gfx::NativeWindow parent_window) const OVERRIDE; |
| 36 virtual void ListenerDestroyed() OVERRIDE; | 33 virtual void ListenerDestroyed() OVERRIDE; |
| 37 | 34 |
| 38 protected: | 35 protected: |
| 39 explicit SelectFileDialogImpl(Listener* listener, | 36 explicit SelectFileDialogImpl(Listener* listener); |
| 40 ui::SelectFilePolicy* policy); | |
| 41 virtual ~SelectFileDialogImpl(); | 37 virtual ~SelectFileDialogImpl(); |
| 42 | 38 |
| 43 // SelectFileDialog implementation. | 39 // SelectFileDialog implementation. |
| 44 // |params| is user data we pass back via the Listener interface. | 40 // |params| is user data we pass back via the Listener interface. |
| 45 virtual void SelectFileImpl(Type type, | 41 virtual void SelectFileImpl(Type type, |
| 46 const string16& title, | 42 const string16& title, |
| 47 const FilePath& default_path, | 43 const FilePath& default_path, |
| 48 const FileTypeInfo* file_types, | 44 const FileTypeInfo* file_types, |
| 49 int file_type_index, | 45 int file_type_index, |
| 50 const FilePath::StringType& default_extension, | 46 const FilePath::StringType& default_extension, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 72 | 68 |
| 73 // These two variables track where the user last saved a file or opened a | 69 // These two variables track where the user last saved a file or opened a |
| 74 // file so that we can display future dialogs with the same starting path. | 70 // file so that we can display future dialogs with the same starting path. |
| 75 static FilePath* last_saved_path_; | 71 static FilePath* last_saved_path_; |
| 76 static FilePath* last_opened_path_; | 72 static FilePath* last_opened_path_; |
| 77 | 73 |
| 78 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); | 74 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); |
| 79 }; | 75 }; |
| 80 | 76 |
| 81 #endif // CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ | 77 #endif // CHROME_BROWSER_UI_GTK_SELECT_FILE_DIALOG_IMPL_H_ |
| OLD | NEW |