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

Side by Side Diff: chrome/browser/printing/printer_query.h

Issue 478183005: Added PrintingContext::Delegate to get parent view handle and application locale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wed Aug 20 16:46:22 PDT 2014 Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "chrome/browser/printing/print_job_worker_owner.h" 11 #include "chrome/browser/printing/print_job_worker_owner.h"
12 #include "printing/print_job_constants.h" 12 #include "printing/print_job_constants.h"
13 13
14 namespace base { 14 namespace base {
15 class DictionaryValue; 15 class DictionaryValue;
16 } 16 }
17 17
18 namespace printing { 18 namespace printing {
19 19
20 class PrintDestinationInterface; 20 class PrintDestinationInterface;
21 class PrintJobWorker; 21 class PrintJobWorker;
22 class PrintingUIWebContentsObserver;
23 22
24 // Query the printer for settings. 23 // Query the printer for settings.
25 class PrinterQuery : public PrintJobWorkerOwner { 24 class PrinterQuery : public PrintJobWorkerOwner {
26 public: 25 public:
27 // GetSettings() UI parameter. 26 // GetSettings() UI parameter.
28 enum GetSettingsAskParam { 27 enum GetSettingsAskParam {
29 DEFAULTS, 28 DEFAULTS,
30 ASK_USER, 29 ASK_USER,
31 }; 30 };
32 31
33 PrinterQuery(); 32 PrinterQuery(int render_process_id, int render_view_id);
34 33
35 // PrintJobWorkerOwner implementation. 34 // PrintJobWorkerOwner implementation.
36 virtual void GetSettingsDone(const PrintSettings& new_settings, 35 virtual void GetSettingsDone(const PrintSettings& new_settings,
37 PrintingContext::Result result) OVERRIDE; 36 PrintingContext::Result result) OVERRIDE;
38 virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE; 37 virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE;
39 virtual const PrintSettings& settings() const OVERRIDE; 38 virtual const PrintSettings& settings() const OVERRIDE;
40 virtual int cookie() const OVERRIDE; 39 virtual int cookie() const OVERRIDE;
41 40
42 // Initializes the printing context. It is fine to call this function multiple 41 // Initializes the printing context. It is fine to call this function multiple
43 // times to reinitialize the settings. |web_contents_observer| can be queried 42 // times to reinitialize the settings. |web_contents_observer| can be queried
44 // to find the owner of the print setting dialog box. It is unused when 43 // to find the owner of the print setting dialog box. It is unused when
45 // |ask_for_user_settings| is DEFAULTS. 44 // |ask_for_user_settings| is DEFAULTS.
46 void GetSettings( 45 void GetSettings(
47 GetSettingsAskParam ask_user_for_settings, 46 GetSettingsAskParam ask_user_for_settings,
48 scoped_ptr<PrintingUIWebContentsObserver> web_contents_observer,
49 int expected_page_count, 47 int expected_page_count,
50 bool has_selection, 48 bool has_selection,
51 MarginType margin_type, 49 MarginType margin_type,
52 const base::Closure& callback); 50 const base::Closure& callback);
53 51
54 // Updates the current settings with |new_settings| dictionary values. 52 // Updates the current settings with |new_settings| dictionary values.
55 void SetSettings(scoped_ptr<base::DictionaryValue> new_settings, 53 void SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
56 const base::Closure& callback); 54 const base::Closure& callback);
57 55
58 // Set a destination for the worker. 56 // Set a destination for the worker.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 92
95 // Callback waiting to be run. 93 // Callback waiting to be run.
96 base::Closure callback_; 94 base::Closure callback_;
97 95
98 DISALLOW_COPY_AND_ASSIGN(PrinterQuery); 96 DISALLOW_COPY_AND_ASSIGN(PrinterQuery);
99 }; 97 };
100 98
101 } // namespace printing 99 } // namespace printing
102 100
103 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_ 101 #endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698