| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/printing/print_job_worker_owner.h" | 12 #include "chrome/browser/printing/print_job_worker_owner.h" |
| 13 #include "printing/print_job_constants.h" | 13 #include "printing/print_job_constants.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 | 15 |
| 16 class MessageLoop; | 16 class MessageLoop; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class DictionaryValue; | 19 class DictionaryValue; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace printing { | 22 namespace printing { |
| 23 | 23 |
| 24 class PrintJobWorker; | 24 class PrintDestinationInterface; |
| 25 class PrintJobWorker; |
| 25 | 26 |
| 26 // Query the printer for settings. | 27 // Query the printer for settings. |
| 27 class PrinterQuery : public PrintJobWorkerOwner { | 28 class PrinterQuery : public PrintJobWorkerOwner { |
| 28 public: | 29 public: |
| 29 // GetSettings() UI parameter. | 30 // GetSettings() UI parameter. |
| 30 enum GetSettingsAskParam { | 31 enum GetSettingsAskParam { |
| 31 DEFAULTS, | 32 DEFAULTS, |
| 32 ASK_USER, | 33 ASK_USER, |
| 33 }; | 34 }; |
| 34 | 35 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 50 gfx::NativeView parent_view, | 51 gfx::NativeView parent_view, |
| 51 int expected_page_count, | 52 int expected_page_count, |
| 52 bool has_selection, | 53 bool has_selection, |
| 53 MarginType margin_type, | 54 MarginType margin_type, |
| 54 const base::Closure& callback); | 55 const base::Closure& callback); |
| 55 | 56 |
| 56 // Updates the current settings with |new_settings| dictionary values. | 57 // Updates the current settings with |new_settings| dictionary values. |
| 57 void SetSettings(const base::DictionaryValue& new_settings, | 58 void SetSettings(const base::DictionaryValue& new_settings, |
| 58 const base::Closure& callback); | 59 const base::Closure& callback); |
| 59 | 60 |
| 61 // Set a destination for the worker. |
| 62 void SetWorkerDestination(PrintDestinationInterface* destination); |
| 63 |
| 60 // Stops the worker thread since the client is done with this object. | 64 // Stops the worker thread since the client is done with this object. |
| 61 void StopWorker(); | 65 void StopWorker(); |
| 62 | 66 |
| 63 // Returns true if a GetSettings() call is pending completion. | 67 // Returns true if a GetSettings() call is pending completion. |
| 64 bool is_callback_pending() const; | 68 bool is_callback_pending() const; |
| 65 | 69 |
| 66 PrintingContext::Result last_status() const { return last_status_; } | 70 PrintingContext::Result last_status() const { return last_status_; } |
| 67 | 71 |
| 68 // Returns if a worker thread is still associated to this instance. | 72 // Returns if a worker thread is still associated to this instance. |
| 69 bool is_valid() const; | 73 bool is_valid() const; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 97 | 101 |
| 98 // Callback waiting to be run. | 102 // Callback waiting to be run. |
| 99 base::Closure callback_; | 103 base::Closure callback_; |
| 100 | 104 |
| 101 DISALLOW_COPY_AND_ASSIGN(PrinterQuery); | 105 DISALLOW_COPY_AND_ASSIGN(PrinterQuery); |
| 102 }; | 106 }; |
| 103 | 107 |
| 104 } // namespace printing | 108 } // namespace printing |
| 105 | 109 |
| 106 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ | 110 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ |
| OLD | NEW |