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

Side by Side Diff: ui/shell_dialogs/select_file_dialog.cc

Issue 1233913009: Make File-Picker modal on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: close the file-picker when the test is done. Created 5 years, 2 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
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 #include "ui/shell_dialogs/select_file_dialog.h" 5 #include "ui/shell_dialogs/select_file_dialog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 FROM_HERE, 121 FROM_HERE,
122 base::Bind(&SelectFileDialog::CancelFileSelection, this, params)); 122 base::Bind(&SelectFileDialog::CancelFileSelection, this, params));
123 return; 123 return;
124 } 124 }
125 125
126 // Call the platform specific implementation of the file selection dialog. 126 // Call the platform specific implementation of the file selection dialog.
127 SelectFileImpl(type, title, default_path, file_types, file_type_index, 127 SelectFileImpl(type, title, default_path, file_types, file_type_index,
128 default_extension, owning_window, params); 128 default_extension, owning_window, params);
129 } 129 }
130 130
131 void SelectFileDialog::Close() {
132 CloseImpl();
133 }
134
131 bool SelectFileDialog::HasMultipleFileTypeChoices() { 135 bool SelectFileDialog::HasMultipleFileTypeChoices() {
132 return HasMultipleFileTypeChoicesImpl(); 136 return HasMultipleFileTypeChoicesImpl();
133 } 137 }
134 138
135 // static 139 // static
136 void SelectFileDialog::SetShellDialogsDelegate(ShellDialogsDelegate* delegate) { 140 void SelectFileDialog::SetShellDialogsDelegate(ShellDialogsDelegate* delegate) {
137 g_shell_dialogs_delegate_ = delegate; 141 g_shell_dialogs_delegate_ = delegate;
138 } 142 }
139 143
140 SelectFileDialog::SelectFileDialog(Listener* listener, 144 SelectFileDialog::SelectFileDialog(Listener* listener,
141 ui::SelectFilePolicy* policy) 145 ui::SelectFilePolicy* policy)
142 : listener_(listener), 146 : listener_(listener),
143 select_file_policy_(policy) { 147 select_file_policy_(policy) {
144 DCHECK(listener_); 148 DCHECK(listener_);
145 } 149 }
146 150
147 SelectFileDialog::~SelectFileDialog() {} 151 SelectFileDialog::~SelectFileDialog() {}
148 152
149 void SelectFileDialog::CancelFileSelection(void* params) { 153 void SelectFileDialog::CancelFileSelection(void* params) {
150 if (listener_) 154 if (listener_)
151 listener_->FileSelectionCanceled(params); 155 listener_->FileSelectionCanceled(params);
152 } 156 }
153 157
154 ShellDialogsDelegate* SelectFileDialog::GetShellDialogsDelegate() { 158 ShellDialogsDelegate* SelectFileDialog::GetShellDialogsDelegate() {
155 return g_shell_dialogs_delegate_; 159 return g_shell_dialogs_delegate_;
156 } 160 }
157 161
158 } // namespace ui 162 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698