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

Side by Side Diff: android_webview/browser/aw_print_manager.h

Issue 2426503002: Make printing work better with OOPIF. (Closed)
Patch Set: Fix build, fix some tests Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PRINT_MANAGER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_PRINT_MANAGER_H_
6 #define ANDROID_WEBVIEW_BROWSER_PRINT_MANAGER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_AW_PRINT_MANAGER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/printing/browser/print_manager.h" 9 #include "components/printing/browser/print_manager.h"
10 #include "content/public/browser/web_contents_user_data.h" 10 #include "content/public/browser/web_contents_user_data.h"
11 #include "printing/print_settings.h" 11 #include "printing/print_settings.h"
12 12
13 namespace android_webview { 13 namespace android_webview {
14 14
15 class AwPrintManager : public printing::PrintManager, 15 class AwPrintManager : public printing::PrintManager,
16 public content::WebContentsUserData<AwPrintManager> { 16 public content::WebContentsUserData<AwPrintManager> {
17 public: 17 public:
18 // Creates a AwPrintManager for the provided webcontents. If the 18 // Creates an AwPrintManager for the provided WebContents. If the
19 // AwPrintManager already exists, it is destroyed and a new one is created. 19 // AwPrintManager already exists, it is destroyed and a new one is created.
20 static AwPrintManager* CreateForWebContents( 20 static AwPrintManager* CreateForWebContents(
21 content::WebContents* contents, 21 content::WebContents* contents,
22 const printing::PrintSettings& settings, 22 const printing::PrintSettings& settings,
23 const base::FileDescriptor& file_descriptor, 23 const base::FileDescriptor& file_descriptor,
24 const PdfWritingDoneCallback& callback); 24 const PdfWritingDoneCallback& callback);
25 25
26 ~AwPrintManager() override; 26 ~AwPrintManager() override;
27 27
28 bool PrintNow(); 28 bool PrintNow();
29 29
30 private: 30 private:
31 friend class content::WebContentsUserData<AwPrintManager>; 31 friend class content::WebContentsUserData<AwPrintManager>;
32
32 AwPrintManager(content::WebContents* contents, 33 AwPrintManager(content::WebContents* contents,
33 const printing::PrintSettings& settings, 34 const printing::PrintSettings& settings,
34 const base::FileDescriptor& file_descriptor, 35 const base::FileDescriptor& file_descriptor,
35 const PdfWritingDoneCallback& callback); 36 const PdfWritingDoneCallback& callback);
36 37
37 bool OnMessageReceived(const IPC::Message& message) override; 38 // printing::PrintManager:
39 bool OnMessageReceived(const IPC::Message& message,
40 content::RenderFrameHost* render_frame_host) override;
41
42 // IPC Handlers
38 void OnGetDefaultPrintSettings(IPC::Message* reply_msg); 43 void OnGetDefaultPrintSettings(IPC::Message* reply_msg);
39 44
40 printing::PrintSettings settings_; 45 printing::PrintSettings settings_;
41 46
42 DISALLOW_COPY_AND_ASSIGN(AwPrintManager); 47 DISALLOW_COPY_AND_ASSIGN(AwPrintManager);
43 }; 48 };
44 49
45 } // namespace android_webview 50 } // namespace android_webview
46 51
47 #endif // ANDROID_WEBVIEW_BROWSER_PRINT_MANAGER_H_ 52 #endif // ANDROID_WEBVIEW_BROWSER_AW_PRINT_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/aw_print_manager.cc » ('j') | components/printing/common/print_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698