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

Side by Side Diff: android_webview/browser/renderer_host/print_manager.h

Issue 882883007: Update {virtual,override,final} to follow C++11 style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ANDROID_WEBVIEW_BROWSER_RENDER_HOST_PRINT_MANAGER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_RENDER_HOST_PRINT_MANAGER_H_
6 #define ANDROID_WEBVIEW_BROWSER_RENDER_HOST_PRINT_MANAGER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_RENDER_HOST_PRINT_MANAGER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/threading/non_thread_safe.h" 9 #include "base/threading/non_thread_safe.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
(...skipping 29 matching lines...) Expand all
40 public base::NonThreadSafe { 40 public base::NonThreadSafe {
41 public: 41 public:
42 // Creates a PrintManager for the provided webcontents. If the printmanager 42 // Creates a PrintManager for the provided webcontents. If the printmanager
43 // already exists, it is destroyed and a new one is created. 43 // already exists, it is destroyed and a new one is created.
44 static PrintManager* CreateForWebContents( 44 static PrintManager* CreateForWebContents(
45 content::WebContents* contents, 45 content::WebContents* contents,
46 printing::PrintSettings* settings, 46 printing::PrintSettings* settings,
47 int fd, 47 int fd,
48 PrintManagerDelegate* delegate); 48 PrintManagerDelegate* delegate);
49 49
50 virtual ~PrintManager(); 50 ~PrintManager() override;
51 51
52 // Prints the current document immediately. Since the rendering is 52 // Prints the current document immediately. Since the rendering is
53 // asynchronous, the actual printing will not be completed on the return of 53 // asynchronous, the actual printing will not be completed on the return of
54 // this function. Returns false if printing is impossible at the moment. 54 // this function. Returns false if printing is impossible at the moment.
55 // 55 //
56 // Note for webview: Returns false immediately if this print manager is 56 // Note for webview: Returns false immediately if this print manager is
57 // already busy printing. 57 // already busy printing.
58 bool PrintNow(); 58 bool PrintNow();
59 59
60 void OnAllocateTempFileForPrinting(base::FileDescriptor* temp_file_fd, 60 void OnAllocateTempFileForPrinting(base::FileDescriptor* temp_file_fd,
61 int* sequence_number); 61 int* sequence_number);
62 void OnTempFileForPrintingWritten(int sequence_number); 62 void OnTempFileForPrintingWritten(int sequence_number);
63 private: 63 private:
64 // To send receive messages to a RenderView we take the WebContents instance, 64 // To send receive messages to a RenderView we take the WebContents instance,
65 // as it internally handles RenderViewHost instances changing underneath us. 65 // as it internally handles RenderViewHost instances changing underneath us.
66 PrintManager(content::WebContents* contents, 66 PrintManager(content::WebContents* contents,
67 printing::PrintSettings* settings, 67 printing::PrintSettings* settings,
68 int fd, 68 int fd,
69 PrintManagerDelegate* delegate); 69 PrintManagerDelegate* delegate);
70 friend class content::WebContentsUserData<PrintManager>; 70 friend class content::WebContentsUserData<PrintManager>;
71 71
72 virtual bool OnMessageReceived(const IPC::Message& message) override; 72 bool OnMessageReceived(const IPC::Message& message) override;
73 void OnDidGetPrintedPagesCount(int cookie, int number_pages); 73 void OnDidGetPrintedPagesCount(int cookie, int number_pages);
74 void OnDidGetDocumentCookie(int cookie); 74 void OnDidGetDocumentCookie(int cookie);
75 void OnPrintingFailed(int cookie); 75 void OnPrintingFailed(int cookie);
76 void OnGetDefaultPrintSettingsReply(IPC::Message* reply_msg); 76 void OnGetDefaultPrintSettingsReply(IPC::Message* reply_msg);
77 void OnGetDefaultPrintSettings(IPC::Message* reply_msg); 77 void OnGetDefaultPrintSettings(IPC::Message* reply_msg);
78 78
79 // Print Settings. 79 // Print Settings.
80 printing::PrintSettings* settings_; 80 printing::PrintSettings* settings_;
81 81
82 // File descriptor to export to. 82 // File descriptor to export to.
83 int fd_; 83 int fd_;
84 // Print manager delegate 84 // Print manager delegate
85 PrintManagerDelegate* delegate_; 85 PrintManagerDelegate* delegate_;
86 // Number of pages to print in the print job. 86 // Number of pages to print in the print job.
87 int number_pages_; 87 int number_pages_;
88 // The document cookie of the current PrinterQuery. 88 // The document cookie of the current PrinterQuery.
89 int cookie_; 89 int cookie_;
90 // Whether a print task is pending. 90 // Whether a print task is pending.
91 int printing_; 91 int printing_;
92 92
93 DISALLOW_COPY_AND_ASSIGN(PrintManager); 93 DISALLOW_COPY_AND_ASSIGN(PrintManager);
94 }; 94 };
95 95
96 } // namespace android_webview 96 } // namespace android_webview
97 97
98 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_PRINT_MANAGER_H_ 98 #endif // ANDROID_WEBVIEW_BROWSER_RENDER_HOST_PRINT_MANAGER_H_
OLDNEW
« no previous file with comments | « android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698