Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / renderer_host / pepper / pepper_printing_host.h
blobec956292b2dc4f93085f83cb1f365a4a5d814c88
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_PRINTING_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_PRINTING_HOST_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h"
12 #include "content/common/content_export.h"
13 #include "ppapi/host/host_message_context.h"
14 #include "ppapi/host/resource_host.h"
16 namespace content {
18 class CONTENT_EXPORT PepperPrintingHost : public ppapi::host::ResourceHost {
19 public:
20 PepperPrintingHost(
21 ppapi::host::PpapiHost* host,
22 PP_Instance instance,
23 PP_Resource resource,
24 scoped_ptr<PepperPrintSettingsManager> print_settings_manager);
25 virtual ~PepperPrintingHost();
27 // ppapi::host::ResourceHost implementation.
28 virtual int32_t OnResourceMessageReceived(
29 const IPC::Message& msg,
30 ppapi::host::HostMessageContext* context) OVERRIDE;
32 private:
33 int32_t OnGetDefaultPrintSettings(ppapi::host::HostMessageContext* context);
35 void PrintSettingsCallback(ppapi::host::ReplyMessageContext reply_context,
36 PepperPrintSettingsManager::Result result);
38 scoped_ptr<PepperPrintSettingsManager> print_settings_manager_;
40 base::WeakPtrFactory<PepperPrintingHost> weak_factory_;
42 DISALLOW_COPY_AND_ASSIGN(PepperPrintingHost);
45 } // namespace content
47 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_PRINTING_HOST_H_