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

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

Issue 488913002: Use scoped_ptr to pass settings in PrintJobWorker and PrinterQuery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue Aug 19 19:59:20 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
« no previous file with comments | « no previous file | chrome/browser/printing/print_job_worker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PRINT_JOB_WORKER_H_ 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_
6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Initializes the print settings. If |ask_user_for_settings| is true, a 46 // Initializes the print settings. If |ask_user_for_settings| is true, a
47 // Print... dialog box will be shown to ask the user his preference. 47 // Print... dialog box will be shown to ask the user his preference.
48 void GetSettings( 48 void GetSettings(
49 bool ask_user_for_settings, 49 bool ask_user_for_settings,
50 scoped_ptr<PrintingUIWebContentsObserver> web_contents_observer, 50 scoped_ptr<PrintingUIWebContentsObserver> web_contents_observer,
51 int document_page_count, 51 int document_page_count,
52 bool has_selection, 52 bool has_selection,
53 MarginType margin_type); 53 MarginType margin_type);
54 54
55 // Set the new print settings. This function takes ownership of 55 // Set the new print settings.
56 // |new_settings|. 56 void SetSettings(
57 void SetSettings(const base::DictionaryValue* const new_settings); 57 scoped_ptr<base::DictionaryValue> new_settings);
58 58
59 // Starts the printing loop. Every pages are printed as soon as the data is 59 // Starts the printing loop. Every pages are printed as soon as the data is
60 // available. Makes sure the new_document is the right one. 60 // available. Makes sure the new_document is the right one.
61 void StartPrinting(PrintedDocument* new_document); 61 void StartPrinting(PrintedDocument* new_document);
62 62
63 // Updates the printed document. 63 // Updates the printed document.
64 void OnDocumentChanged(PrintedDocument* new_document); 64 void OnDocumentChanged(PrintedDocument* new_document);
65 65
66 // Dequeues waiting pages. Called when PrintJob receives a 66 // Dequeues waiting pages. Called when PrintJob receives a
67 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if 67 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void GetSettingsWithUI( 115 void GetSettingsWithUI(
116 scoped_ptr<PrintingUIWebContentsObserver> web_contents_observer, 116 scoped_ptr<PrintingUIWebContentsObserver> web_contents_observer,
117 int document_page_count, 117 int document_page_count,
118 bool has_selection); 118 bool has_selection);
119 119
120 // The callback used by PrintingContext::GetSettingsWithUI() to notify this 120 // The callback used by PrintingContext::GetSettingsWithUI() to notify this
121 // object that the print settings are set. This is needed in order to bounce 121 // object that the print settings are set. This is needed in order to bounce
122 // back into the IO thread for GetSettingsDone(). 122 // back into the IO thread for GetSettingsDone().
123 void GetSettingsWithUIDone(PrintingContext::Result result); 123 void GetSettingsWithUIDone(PrintingContext::Result result);
124 124
125 // Called on the UI thread to update the print settings. This function takes 125 // Called on the UI thread to update the print settings.
126 // the ownership of |new_settings|. 126 void UpdatePrintSettings(scoped_ptr<base::DictionaryValue> new_settings);
127 void UpdatePrintSettings(const base::DictionaryValue* const new_settings);
128 127
129 // Reports settings back to owner_. 128 // Reports settings back to owner_.
130 void GetSettingsDone(PrintingContext::Result result); 129 void GetSettingsDone(PrintingContext::Result result);
131 130
132 // Use the default settings. When using GTK+ or Mac, this can still end up 131 // Use the default settings. When using GTK+ or Mac, this can still end up
133 // displaying a dialog. So this needs to happen from the UI thread on these 132 // displaying a dialog. So this needs to happen from the UI thread on these
134 // systems. 133 // systems.
135 void UseDefaultSettings(); 134 void UseDefaultSettings();
136 135
137 // Information about the printer setting. 136 // Information about the printer setting.
(...skipping 20 matching lines...) Expand all
158 157
159 // Used to generate a WeakPtr for callbacks. 158 // Used to generate a WeakPtr for callbacks.
160 base::WeakPtrFactory<PrintJobWorker> weak_factory_; 159 base::WeakPtrFactory<PrintJobWorker> weak_factory_;
161 160
162 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker); 161 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker);
163 }; 162 };
164 163
165 } // namespace printing 164 } // namespace printing
166 165
167 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ 166 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_job_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698