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

Unified Diff: ui/base/dialogs/select_file_dialog_win.cc

Issue 10815057: Fix top crasher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dialogs/select_file_dialog_win.cc
diff --git a/ui/base/dialogs/select_file_dialog_win.cc b/ui/base/dialogs/select_file_dialog_win.cc
index 7366cfeb5a6ff8a4392f86081865473ce4d13a48..3a699915885e26c80c2070efa97d6c71176ae782 100644
--- a/ui/base/dialogs/select_file_dialog_win.cc
+++ b/ui/base/dialogs/select_file_dialog_win.cc
@@ -16,6 +16,7 @@
#include "base/file_util.h"
#include "base/i18n/case_conversion.h"
#include "base/message_loop.h"
+#include "base/message_loop_proxy.h"
#include "base/string_split.h"
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
@@ -423,6 +424,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog,
file_type_index(file_type_index),
default_extension(default_extension),
run_state(run_state),
+ ui_proxy(MessageLoopForUI::current()->message_loop_proxy()),
owner(owner),
params(params) {
if (file_types) {
@@ -438,6 +440,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog,
int file_type_index;
std::wstring default_extension;
RunState run_state;
+ scoped_refptr<base::MessageLoopProxy> ui_proxy;
HWND owner;
void* params;
};
@@ -581,7 +584,7 @@ void SelectFileDialogImpl::ExecuteSelectFile(
std::vector<FilePath> paths;
if (RunOpenMultiFileDialog(params.title, filter,
params.run_state.owner, &paths)) {
- params.run_state.dialog_thread->message_loop()->PostTask(
+ params.ui_proxy->PostTask(
FROM_HERE,
base::Bind(&SelectFileDialogImpl::MultiFilesSelected, this, paths,
params.params, params.run_state));
@@ -590,12 +593,12 @@ void SelectFileDialogImpl::ExecuteSelectFile(
}
if (success) {
- params.run_state.dialog_thread->message_loop()->PostTask(
+ params.ui_proxy->PostTask(
FROM_HERE,
base::Bind(&SelectFileDialogImpl::FileSelected, this, path,
filter_index, params.params, params.run_state));
} else {
- params.run_state.dialog_thread->message_loop()->PostTask(
+ params.ui_proxy->PostTask(
FROM_HERE,
base::Bind(&SelectFileDialogImpl::FileNotSelected, this, params.params,
params.run_state));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698