diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 23:21:40 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 23:21:40 +0000 |
commit | 71892af26eba94c7d231ce0bba333286df4630b3 (patch) | |
tree | e54cbe281f9c3308eae136d7297117ea853c2b64 | |
parent | f03195ed45a98e1af138acf07ece658c227f9855 (diff) | |
download | chromium_src-71892af26eba94c7d231ce0bba333286df4630b3.zip chromium_src-71892af26eba94c7d231ce0bba333286df4630b3.tar.gz chromium_src-71892af26eba94c7d231ce0bba333286df4630b3.tar.bz2 |
Printing: Call PrintingContext::AskUserForSettings() on the UI thread for Linux
as well, because gtk cannot be called on a non-UI thread.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3384035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60724 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/printing/print_job_worker.cc | 8 | ||||
-rw-r--r-- | chrome/browser/printing/print_job_worker.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc index ce1623b..cac0abf 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc @@ -78,7 +78,7 @@ void PrintJobWorker::GetSettings(bool ask_user_for_settings, printing_context_.SetUseOverlays(use_overlays); if (ask_user_for_settings) { -#if defined(OS_MACOSX) +#if defined(OS_MACOSX) || defined(USE_X11) ChromeThread::PostTask( ChromeThread::UI, FROM_HERE, NewRunnableMethod(this, &PrintJobWorker::GetSettingsWithUI, @@ -90,7 +90,7 @@ void PrintJobWorker::GetSettings(bool ask_user_for_settings, document_page_count, has_selection, NewCallback(this, &PrintJobWorker::GetSettingsDone)); -#endif +#endif // defined(OS_MACOSX) || defined(USE_X11) } else { PrintingContext::Result result = printing_context_.UseDefaultSettings(); GetSettingsDone(result); @@ -112,7 +112,7 @@ void PrintJobWorker::GetSettingsDone(PrintingContext::Result result) { result)); } -#if defined(OS_MACOSX) +#if defined(OS_MACOSX) || defined(USE_X11) void PrintJobWorker::GetSettingsWithUI(gfx::NativeView parent_view, int document_page_count, bool has_selection) { @@ -129,7 +129,7 @@ void PrintJobWorker::GetSettingsWithUIDone(PrintingContext::Result result) { message_loop()->PostTask(FROM_HERE, NewRunnableMethod( this, &PrintJobWorker::GetSettingsDone, result)); } -#endif +#endif // defined(OS_MACOSX) || defined(USE_X11) void PrintJobWorker::StartPrinting(PrintedDocument* new_document) { DCHECK_EQ(message_loop(), MessageLoop::current()); diff --git a/chrome/browser/printing/print_job_worker.h b/chrome/browser/printing/print_job_worker.h index f79ca86..69b35e4 100644 --- a/chrome/browser/printing/print_job_worker.h +++ b/chrome/browser/printing/print_job_worker.h @@ -81,9 +81,9 @@ class PrintJobWorker : public base::Thread { // context. void OnFailure(); -#if defined(OS_MACOSX) +#if defined(OS_MACOSX) || defined(USE_X11) // Asks the user for print settings. Must be called on the UI thread. - // Mac-only since Windows can display UI from non-main threads. + // Mac and Linux-only since Windows can display UI from non-main threads. void GetSettingsWithUI(gfx::NativeView parent_view, int document_page_count, bool has_selection); |