diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 02:27:01 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 02:27:01 +0000 |
commit | 0d3dc8e2804b0adc4f572944db027929e2b5af5a (patch) | |
tree | efe4a3ecde226002698017cceba2952b8979a66f /chrome/browser/views | |
parent | 8dc291a4dbeed088fbdc36115b250c5f83d3edde (diff) | |
download | chromium_src-0d3dc8e2804b0adc4f572944db027929e2b5af5a.zip chromium_src-0d3dc8e2804b0adc4f572944db027929e2b5af5a.tar.gz chromium_src-0d3dc8e2804b0adc4f572944db027929e2b5af5a.tar.bz2 |
Fifth patch in getting rid of caching MessageLoop pointers.
BUG=25354
Review URL: http://codereview.chromium.org/345037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/shell_dialogs_win.cc | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/chrome/browser/views/shell_dialogs_win.cc b/chrome/browser/views/shell_dialogs_win.cc index 5c5b1f9..e3a0ab0 100644 --- a/chrome/browser/views/shell_dialogs_win.cc +++ b/chrome/browser/views/shell_dialogs_win.cc @@ -19,7 +19,7 @@ #include "base/scoped_comptr_win.h" #include "base/string_util.h" #include "base/thread.h" -#include "chrome/browser/browser_process.h" +#include "chrome/browser/chrome_thread.h" #include "grit/generated_resources.h" // Helpers to show certain types of Windows shell dialogs in a way that doesn't @@ -90,9 +90,6 @@ class BaseShellDialogImpl { // returns. void DisableOwner(HWND owner); - // The UI thread's message loop. - MessageLoop* ui_loop_; - private: // Creates a thread to run a shell dialog on. Each dialog requires its own // thread otherwise in some situations where a singleton owns a single @@ -126,8 +123,7 @@ class BaseShellDialogImpl { BaseShellDialogImpl::Owners BaseShellDialogImpl::owners_; int BaseShellDialogImpl::instance_count_ = 0; -BaseShellDialogImpl::BaseShellDialogImpl() - : ui_loop_(MessageLoop::current()) { +BaseShellDialogImpl::BaseShellDialogImpl() { ++instance_count_; } @@ -372,21 +368,27 @@ void SelectFileDialogImpl::ExecuteSelectFile( std::vector<FilePath> paths; if (RunOpenMultiFileDialog(params.title, filter, params.run_state.owner, &paths)) { - ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, - &SelectFileDialogImpl::MultiFilesSelected, - paths, params.params, params.run_state)); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, + NewRunnableMethod( + this, &SelectFileDialogImpl::MultiFilesSelected, paths, + params.params, params.run_state)); return; } } if (success) { - ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, - &SelectFileDialogImpl::FileSelected, path, filter_index, - params.params, params.run_state)); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, + NewRunnableMethod( + this, &SelectFileDialogImpl::FileSelected, path, filter_index, + params.params, params.run_state)); } else { - ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, - &SelectFileDialogImpl::FileNotSelected, params.params, - params.run_state)); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, + NewRunnableMethod( + this, &SelectFileDialogImpl::FileNotSelected, params.params, + params.run_state)); } } @@ -657,11 +659,16 @@ void SelectFontDialogImpl::ExecuteSelectFont(RunState run_state, void* params) { bool success = !!ChooseFont(&cf); DisableOwner(run_state.owner); if (success) { - ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, - &SelectFontDialogImpl::FontSelected, logfont, params, run_state)); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, + NewRunnableMethod( + this, &SelectFontDialogImpl::FontSelected, logfont, params, + run_state)); } else { - ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, - &SelectFontDialogImpl::FontNotSelected, params, run_state)); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, + NewRunnableMethod( + this, &SelectFontDialogImpl::FontNotSelected, params, run_state)); } } @@ -715,11 +722,16 @@ void SelectFontDialogImpl::ExecuteSelectFontWithNameSize( bool success = !!ChooseFont(&cf); DisableOwner(run_state.owner); if (success) { - ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, - &SelectFontDialogImpl::FontSelected, logfont, params, run_state)); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, + NewRunnableMethod( + this, &SelectFontDialogImpl::FontSelected, logfont, params, + run_state)); } else { - ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, - &SelectFontDialogImpl::FontNotSelected, params, run_state)); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, + NewRunnableMethod(this, &SelectFontDialogImpl::FontNotSelected, params, + run_state)); } } |