1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_PROXY_PPB_FLASH_PROXY_H_
#define PPAPI_PROXY_PPB_FLASH_PROXY_H_
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "ipc/ipc_platform_file.h"
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/pp_time.h"
#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/proxy/interface_proxy.h"
#include "ppapi/proxy/serialized_var.h"
#include "ppapi/shared_impl/host_resource.h"
#include "ppapi/shared_impl/ppb_flash_shared.h"
struct PPB_Flash_Print_1_0;
namespace ppapi {
struct URLRequestInfoData;
namespace proxy {
struct PPBFlash_DrawGlyphs_Params;
struct SerializedDirEntry;
class SerializedVarReturnValue;
/////////////////////////// WARNING:DEPRECTATED ////////////////////////////////
// Please do not add any new functions to this proxy. They should be
// implemented in the new-style resource proxy (see flash_resource.h).
// TODO(raymes): All of these functions should be moved to the new-style proxy.
////////////////////////////////////////////////////////////////////////////////
class PPB_Flash_Proxy : public InterfaceProxy, public PPB_Flash_Shared {
public:
explicit PPB_Flash_Proxy(Dispatcher* dispatcher);
virtual ~PPB_Flash_Proxy();
// This flash proxy also proxies the PPB_Flash_Print interface. This one
// doesn't use the regular thunk system because the _impl side is actually in
// Chrome rather than with the rest of the interface implementations.
static const PPB_Flash_Print_1_0* GetFlashPrintInterface();
// InterfaceProxy implementation.
virtual bool OnMessageReceived(const IPC::Message& msg);
// PPB_Flash_API implementation.
virtual void SetInstanceAlwaysOnTop(PP_Instance instance,
PP_Bool on_top) OVERRIDE;
virtual PP_Bool DrawGlyphs(PP_Instance instance,
PP_Resource pp_image_data,
const PP_FontDescription_Dev* font_desc,
uint32_t color,
const PP_Point* position,
const PP_Rect* clip,
const float transformation[3][3],
PP_Bool allow_subpixel_aa,
uint32_t glyph_count,
const uint16_t glyph_indices[],
const PP_Point glyph_advances[]) OVERRIDE;
virtual int32_t Navigate(PP_Instance instance,
PP_Resource request_info,
const char* target,
PP_Bool from_user_action) OVERRIDE;
virtual int32_t Navigate(PP_Instance instance,
const URLRequestInfoData& data,
const char* target,
PP_Bool from_user_action) OVERRIDE;
virtual double GetLocalTimeZoneOffset(PP_Instance instance,
PP_Time t) OVERRIDE;
virtual PP_Bool IsRectTopmost(PP_Instance instance,
const PP_Rect* rect) OVERRIDE;
virtual PP_Var GetSetting(PP_Instance instance,
PP_FlashSetting setting) OVERRIDE;
virtual bool CreateThreadAdapterForInstance(PP_Instance instance) OVERRIDE;
virtual void ClearThreadAdapterForInstance(PP_Instance instance) OVERRIDE;
virtual int32_t OpenFile(PP_Instance instance,
const char* path,
int32_t mode,
PP_FileHandle* file) OVERRIDE;
virtual int32_t RenameFile(PP_Instance instance,
const char* path_from,
const char* path_to) OVERRIDE;
virtual int32_t DeleteFileOrDir(PP_Instance instance,
const char* path,
PP_Bool recursive) OVERRIDE;
virtual int32_t CreateDir(PP_Instance instance, const char* path) OVERRIDE;
virtual int32_t QueryFile(PP_Instance instance,
const char* path,
PP_FileInfo* info) OVERRIDE;
virtual int32_t GetDirContents(PP_Instance instance,
const char* path,
PP_DirContents_Dev** contents) OVERRIDE;
virtual int32_t CreateTemporaryFile(PP_Instance instance,
PP_FileHandle* file) OVERRIDE;
virtual int32_t OpenFileRef(PP_Instance instance,
PP_Resource file_ref,
int32_t mode,
PP_FileHandle* file) OVERRIDE;
virtual int32_t QueryFileRef(PP_Instance instance,
PP_Resource file_ref,
PP_FileInfo* info) OVERRIDE;
static const ApiID kApiID = API_ID_PPB_FLASH;
private:
// Message handlers.
void OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance,
PP_Bool on_top);
void OnHostMsgDrawGlyphs(PP_Instance instance,
const PPBFlash_DrawGlyphs_Params& params,
PP_Bool* result);
void OnHostMsgNavigate(PP_Instance instance,
const URLRequestInfoData& data,
const std::string& target,
PP_Bool from_user_action,
int32_t* result);
void OnHostMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t,
double* result);
void OnHostMsgIsRectTopmost(PP_Instance instance,
PP_Rect rect,
PP_Bool* result);
void OnHostMsgOpenFileRef(PP_Instance instance,
const ppapi::HostResource& host_resource,
int32_t mode,
IPC::PlatformFileForTransit* file_handle,
int32_t* result);
void OnHostMsgQueryFileRef(PP_Instance instance,
const ppapi::HostResource& host_resource,
PP_FileInfo* info,
int32_t* result);
void OnHostMsgGetSetting(PP_Instance instance,
PP_FlashSetting setting,
SerializedVarReturnValue result);
void OnHostMsgInvokePrinting(PP_Instance instance);
DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Proxy);
};
} // namespace proxy
} // namespace ppapi
#endif // PPAPI_PROXY_PPB_FLASH_PROXY_H_
|