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

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

Issue 14061025: ui: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 #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.h" 9 #include "base/message_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void* params) { 110 void* params) {
111 DCHECK(listener_); 111 DCHECK(listener_);
112 112
113 if (select_file_policy_.get() && 113 if (select_file_policy_.get() &&
114 !select_file_policy_->CanOpenSelectFileDialog()) { 114 !select_file_policy_->CanOpenSelectFileDialog()) {
115 select_file_policy_->SelectFileDenied(); 115 select_file_policy_->SelectFileDenied();
116 116
117 // Inform the listener that no file was selected. 117 // Inform the listener that no file was selected.
118 // Post a task rather than calling FileSelectionCanceled directly to ensure 118 // Post a task rather than calling FileSelectionCanceled directly to ensure
119 // that the listener is called asynchronously. 119 // that the listener is called asynchronously.
120 MessageLoop::current()->PostTask( 120 base::MessageLoop::current()->PostTask(
121 FROM_HERE, base::Bind(&SelectFileDialog::CancelFileSelection, this, 121 FROM_HERE,
122 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 bool SelectFileDialog::HasMultipleFileTypeChoices() { 131 bool SelectFileDialog::HasMultipleFileTypeChoices() {
132 return HasMultipleFileTypeChoicesImpl(); 132 return HasMultipleFileTypeChoicesImpl();
(...skipping 16 matching lines...) Expand all
149 void SelectFileDialog::CancelFileSelection(void* params) { 149 void SelectFileDialog::CancelFileSelection(void* params) {
150 if (listener_) 150 if (listener_)
151 listener_->FileSelectionCanceled(params); 151 listener_->FileSelectionCanceled(params);
152 } 152 }
153 153
154 ShellDialogsDelegate* SelectFileDialog::GetShellDialogsDelegate() { 154 ShellDialogsDelegate* SelectFileDialog::GetShellDialogsDelegate() {
155 return g_shell_dialogs_delegate_; 155 return g_shell_dialogs_delegate_;
156 } 156 }
157 157
158 } // namespace ui 158 } // namespace ui
OLDNEW
« no previous file with comments | « ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc ('k') | ui/shell_dialogs/select_file_dialog_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698