| OLD | NEW |
| 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 #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 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void StopWorker(); | 57 void StopWorker(); |
| 58 | 58 |
| 59 // Returns true if a GetSettings() call is pending completion. | 59 // Returns true if a GetSettings() call is pending completion. |
| 60 bool is_callback_pending() const; | 60 bool is_callback_pending() const; |
| 61 | 61 |
| 62 PrintingContext::Result last_status() const { return last_status_; } | 62 PrintingContext::Result last_status() const { return last_status_; } |
| 63 | 63 |
| 64 // Returns if a worker thread is still associated to this instance. | 64 // Returns if a worker thread is still associated to this instance. |
| 65 bool is_valid() const; | 65 bool is_valid() const; |
| 66 | 66 |
| 67 void SetInitiatedFromAndroidScript(); |
| 68 |
| 67 private: | 69 private: |
| 68 ~PrinterQuery() override; | 70 ~PrinterQuery() override; |
| 69 | 71 |
| 70 // Lazy create the worker thread. There is one worker thread per print job. | 72 // Lazy create the worker thread. There is one worker thread per print job. |
| 71 void StartWorker(const base::Closure& callback); | 73 void StartWorker(const base::Closure& callback); |
| 72 | 74 |
| 73 // All the UI is done in a worker thread because many Win32 print functions | 75 // All the UI is done in a worker thread because many Win32 print functions |
| 74 // are blocking and enters a message loop without your consent. There is one | 76 // are blocking and enters a message loop without your consent. There is one |
| 75 // worker thread per print job. | 77 // worker thread per print job. |
| 76 scoped_ptr<PrintJobWorker> worker_; | 78 scoped_ptr<PrintJobWorker> worker_; |
| 77 | 79 |
| 78 // Cache of the print context settings for access in the UI thread. | 80 // Cache of the print context settings for access in the UI thread. |
| 79 PrintSettings settings_; | 81 PrintSettings settings_; |
| 80 | 82 |
| 81 // Is the Print... dialog box currently shown. | 83 // Is the Print... dialog box currently shown. |
| 82 bool is_print_dialog_box_shown_; | 84 bool is_print_dialog_box_shown_; |
| 83 | 85 |
| 86 bool is_initiated_from_android_scripted_print_; |
| 87 |
| 84 // Cookie that make this instance unique. | 88 // Cookie that make this instance unique. |
| 85 int cookie_; | 89 int cookie_; |
| 86 | 90 |
| 87 // Results from the last GetSettingsDone() callback. | 91 // Results from the last GetSettingsDone() callback. |
| 88 PrintingContext::Result last_status_; | 92 PrintingContext::Result last_status_; |
| 89 | 93 |
| 90 // Callback waiting to be run. | 94 // Callback waiting to be run. |
| 91 base::Closure callback_; | 95 base::Closure callback_; |
| 92 | 96 |
| 93 DISALLOW_COPY_AND_ASSIGN(PrinterQuery); | 97 DISALLOW_COPY_AND_ASSIGN(PrinterQuery); |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // namespace printing | 100 } // namespace printing |
| 97 | 101 |
| 98 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ | 102 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ |
| OLD | NEW |