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 CHROME_RENDERER_PEPPER_PEPPER_FLASH_RENDERER_HOST_H_
6 #define CHROME_RENDERER_PEPPER_PEPPER_FLASH_RENDERER_HOST_H_
11 #include "base/basictypes.h"
12 #include "base/memory/weak_ptr.h"
13 #include "ppapi/host/host_message_context.h"
14 #include "ppapi/host/resource_host.h"
19 struct URLRequestInfoData
;
24 struct PPBFlash_DrawGlyphs_Params
;
29 class RendererPpapiHost
;
32 class PepperFlashRendererHost
: public ppapi::host::ResourceHost
{
34 PepperFlashRendererHost(content::RendererPpapiHost
* host
,
36 PP_Resource resource
);
37 ~PepperFlashRendererHost() override
;
39 // ppapi::host::ResourceHost override.
40 int32_t OnResourceMessageReceived(
41 const IPC::Message
& msg
,
42 ppapi::host::HostMessageContext
* context
) override
;
45 int32_t OnGetProxyForURL(ppapi::host::HostMessageContext
* host_context
,
46 const std::string
& url
);
47 int32_t OnSetInstanceAlwaysOnTop(
48 ppapi::host::HostMessageContext
* host_context
,
50 int32_t OnDrawGlyphs(ppapi::host::HostMessageContext
* host_context
,
51 ppapi::proxy::PPBFlash_DrawGlyphs_Params params
);
52 int32_t OnNavigate(ppapi::host::HostMessageContext
* host_context
,
53 const ppapi::URLRequestInfoData
& data
,
54 const std::string
& target
,
55 bool from_user_action
);
56 int32_t OnIsRectTopmost(ppapi::host::HostMessageContext
* host_context
,
58 int32_t OnInvokePrinting(ppapi::host::HostMessageContext
* host_context
);
60 // A stack of ReplyMessageContexts to track Navigate() calls which have not
61 // yet been replied to.
62 std::vector
<ppapi::host::ReplyMessageContext
> navigate_replies_
;
64 content::RendererPpapiHost
* host_
;
65 base::WeakPtrFactory
<PepperFlashRendererHost
> weak_factory_
;
67 DISALLOW_COPY_AND_ASSIGN(PepperFlashRendererHost
);
70 #endif // CHROME_RENDERER_PEPPER_PEPPER_FLASH_RENDERER_HOST_H_