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 3 // found in the LICENSE file. 4 5 #ifndef UI_SHELL_DIALOGS_LINUX_SHELL_DIALOG_H_ 6 #define UI_SHELL_DIALOGS_LINUX_SHELL_DIALOG_H_ 7 8 #include "ui/shell_dialogs/select_file_dialog.h" 9 #include "ui/shell_dialogs/shell_dialogs_export.h" 10 11 namespace ui { 12 13 // An interface that lets different Linux platforms override the 14 // CreateSelectFileDialog function declared here to return native file dialogs. 15 class SHELL_DIALOGS_EXPORT LinuxShellDialog { 16 public: ~LinuxShellDialog()17 virtual ~LinuxShellDialog() {} 18 19 // Sets the dynamically loaded singleton that draws the desktop native 20 // UI. This pointer is not owned, and if this method is called a second time, 21 // the first instance is not deleted. 22 static void SetInstance(LinuxShellDialog* instance); 23 24 // Returns a LinuxUI instance for the toolkit used in the user's desktop 25 // environment. 26 // 27 // Can return NULL, in case no toolkit has been set. (For example, if we're 28 // running with the "--ash" flag.) 29 static const LinuxShellDialog* instance(); 30 31 // Returns a native file selection dialog. 32 virtual SelectFileDialog* CreateSelectFileDialog( 33 SelectFileDialog::Listener* listener, 34 SelectFilePolicy* policy) const = 0; 35 }; 36 37 } // namespace ui 38 39 #endif // UI_SHELL_DIALOGS_LINUX_SHELL_DIALOG_H_ 40 41