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

Side by Side Diff: chrome/browser/ui/views/select_file_dialog_extension.h

Issue 10584026: Allow ChromeOS file selection dialog to be shown from shell windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another rebase Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_
6 #define CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_ 6 #define CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "chrome/browser/ui/select_file_dialog.h" 13 #include "chrome/browser/ui/select_file_dialog.h"
14 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" 14 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h"
15 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow 15 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow
16 16
17 class Browser;
18 class ExtensionDialog; 17 class ExtensionDialog;
18 class Profile;
19 19
20 namespace content { 20 namespace content {
21 class RenderViewHost; 21 class RenderViewHost;
22 struct SelectedFileInfo; 22 struct SelectedFileInfo;
23 } 23 }
24 24
25 // Shows a dialog box for selecting a file or a folder, using the 25 // Shows a dialog box for selecting a file or a folder, using the
26 // file manager extension implementation. 26 // file manager extension implementation.
27 class SelectFileDialogExtension 27 class SelectFileDialogExtension
28 : public SelectFileDialog, 28 : public SelectFileDialog,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; 85 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE;
86 86
87 bool has_multiple_file_type_choices_; 87 bool has_multiple_file_type_choices_;
88 88
89 // Host for the extension that implements this dialog. 89 // Host for the extension that implements this dialog.
90 scoped_refptr<ExtensionDialog> extension_dialog_; 90 scoped_refptr<ExtensionDialog> extension_dialog_;
91 91
92 // ID of the tab that spawned this dialog, used to route callbacks. 92 // ID of the tab that spawned this dialog, used to route callbacks.
93 int32 tab_id_; 93 int32 tab_id_;
94 94
95 // Cache a pointer to our owner browser. Since we're a child window of our 95 // Pointer to the profile the dialog is running in.
96 // owner browser, if this browser gets deleted, it will also close us. 96 Profile* profile_;
97 Browser* owner_browser_;
98 97
98 // The window that created the dialog.
99 gfx::NativeWindow owner_window_; 99 gfx::NativeWindow owner_window_;
100 100
101 // We defer the callback into SelectFileDialog::Listener until the window 101 // We defer the callback into SelectFileDialog::Listener until the window
102 // closes, to match the semantics of file selection on Windows and Mac. 102 // closes, to match the semantics of file selection on Windows and Mac.
103 // These are the data passed to the listener. 103 // These are the data passed to the listener.
104 enum SelectionType { 104 enum SelectionType {
105 CANCEL = 0, 105 CANCEL = 0,
106 SINGLE_FILE, 106 SINGLE_FILE,
107 MULTIPLE_FILES 107 MULTIPLE_FILES
108 }; 108 };
109 SelectionType selection_type_; 109 SelectionType selection_type_;
110 std::vector<content::SelectedFileInfo> selection_files_; 110 std::vector<content::SelectedFileInfo> selection_files_;
111 int selection_index_; 111 int selection_index_;
112 void* params_; 112 void* params_;
113 113
114 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogExtension); 114 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogExtension);
115 }; 115 };
116 116
117 #endif // CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_ 117 #endif // CHROME_BROWSER_UI_VIEWS_SELECT_FILE_DIALOG_EXTENSION_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_dialog.cc ('k') | chrome/browser/ui/views/select_file_dialog_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698