Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: ui/base/dialogs/select_file_dialog.h

Issue 10698168: Part 3 of Move SelectFileDialog implementation to ui/base/dialogs/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More namespace to force rebuild. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/dialogs/base_shell_dialog_win.cc ('k') | ui/base/dialogs/select_file_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dialogs/select_file_dialog.h
diff --git a/chrome/browser/ui/select_file_dialog.h b/ui/base/dialogs/select_file_dialog.h
similarity index 91%
copy from chrome/browser/ui/select_file_dialog.h
copy to ui/base/dialogs/select_file_dialog.h
index 7bd81d5861e76a8d7d6624629aae80e25dfd2399..da5ab1f59f77c1aa4ef19c4ccd8ab2cb7b9c27e2 100644
--- a/chrome/browser/ui/select_file_dialog.h
+++ b/ui/base/dialogs/select_file_dialog.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_SELECT_FILE_DIALOG_H_
-#define CHROME_BROWSER_UI_SELECT_FILE_DIALOG_H_
+#ifndef UI_BASE_DIALOGS_SELECT_FILE_DIALOG_H_
+#define UI_BASE_DIALOGS_SELECT_FILE_DIALOG_H_
#include <string>
#include <vector>
@@ -15,28 +15,16 @@
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
#include "ui/base/dialogs/base_shell_dialog.h"
+#include "ui/base/ui_export.h"
#include "ui/gfx/native_widget_types.h"
namespace ui {
+class SelectFileDialogFactory;
class SelectFilePolicy;
-}
-
-namespace content {
-class WebContents;
-}
-
-namespace ui {
struct SelectedFileInfo;
-}
-
-// This function is declared extern such that it is accessible for unit tests
-// in /chrome/browser/ui/views/select_file_dialog_win_unittest.cc
-extern std::wstring AppendExtensionIfNeeded(const std::wstring& filename,
- const std::wstring& filter_selected,
- const std::wstring& suggested_ext);
// Shows a dialog box for selecting a file or a folder.
-class SelectFileDialog
+class UI_EXPORT SelectFileDialog
: public base::RefCountedThreadSafe<SelectFileDialog>,
public ui::BaseShellDialog {
public:
@@ -51,7 +39,7 @@ class SelectFileDialog
// An interface implemented by a Listener object wishing to know about the
// the result of the Select File/Folder action. These callbacks must be
// re-entrant.
- class Listener {
+ class UI_EXPORT Listener {
public:
// Notifies the Listener that a file/folder selection has been made. The
// file/folder path is in |path|. |params| is contextual passed to
@@ -91,6 +79,14 @@ class SelectFileDialog
virtual ~Listener() {}
};
+ // Sets the factory that creates SelectFileDialog objects, overriding default
+ // behaviour.
+ //
+ // This is optional and should only be used by components that have to live
+ // elsewhere in the tree due to layering violations. (For example, because of
+ // a dependency on chrome's extension system.)
+ static void SetFactory(ui::SelectFileDialogFactory* factory);
+
// Creates a dialog box helper. This object is ref-counted, but the returned
// object will have no reference (refcount is 0). |policy| is an optional
// class that can prevent showing a dialog.
@@ -107,7 +103,7 @@ class SelectFileDialog
// the system descriptions will be used.
// |include_all_files| specifies whether there will be a filter added for all
// files (i.e. *.*).
- struct FileTypeInfo {
+ struct UI_EXPORT FileTypeInfo {
FileTypeInfo();
~FileTypeInfo();
@@ -193,4 +189,6 @@ class SelectFileDialog
DISALLOW_COPY_AND_ASSIGN(SelectFileDialog);
};
-#endif // CHROME_BROWSER_UI_SELECT_FILE_DIALOG_H_
+} // namespace ui
+
+#endif // UI_BASE_DIALOGS_SELECT_FILE_DIALOG_H_
« no previous file with comments | « ui/base/dialogs/base_shell_dialog_win.cc ('k') | ui/base/dialogs/select_file_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698