Updates version of android sdk and api installed and creates ARM and x86 AVD's.
[chromium-blink-merge.git] / ppapi / proxy / ppb_file_chooser_proxy.h
blob825d7c99d3e593fc36386a9119798a012d774cfe
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 PPAPI_PROXY_PPB_FILE_CHOOSER_PROXY_H_
6 #define PPAPI_PROXY_PPB_FILE_CHOOSER_PROXY_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/proxy/interface_proxy.h"
14 #include "ppapi/proxy/proxy_array_output.h"
15 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
16 #include "ppapi/proxy/serialized_var.h"
17 #include "ppapi/thunk/ppb_file_chooser_api.h"
18 #include "ppapi/cpp/output_traits.h"
19 #include "ppapi/utility/completion_callback_factory.h"
21 namespace ppapi {
23 class HostResource;
24 struct PPB_FileRef_CreateInfo;
26 namespace proxy {
28 class PPB_FileChooser_Proxy : public InterfaceProxy {
29 public:
30 explicit PPB_FileChooser_Proxy(Dispatcher* dispatcher);
31 virtual ~PPB_FileChooser_Proxy();
33 static PP_Resource CreateProxyResource(
34 PP_Instance instance,
35 PP_FileChooserMode_Dev mode,
36 const char* accept_types);
38 // InterfaceProxy implementation.
39 virtual bool OnMessageReceived(const IPC::Message& msg);
41 static const ApiID kApiID = API_ID_PPB_FILE_CHOOSER;
43 private:
44 // Plugin -> host message handlers.
45 void OnMsgCreate(PP_Instance instance,
46 int mode,
47 std::string accept_types,
48 ppapi::HostResource* result);
49 void OnMsgShow(const ppapi::HostResource& chooser,
50 PP_Bool save_as,
51 SerializedVarReceiveInput suggested_file_name,
52 bool require_user_gesture);
54 // Host -> plugin message handlers.
55 void OnMsgChooseComplete(
56 const ppapi::HostResource& chooser,
57 int32_t result_code,
58 const std::vector<PPB_FileRef_CreateInfo>& chosen_files);
60 // Called when the show is complete in the host. This will notify the plugin
61 // via IPC and OnMsgChooseComplete will be called there.
62 void OnShowCallback(
63 int32_t result,
64 scoped_refptr<RefCountedArrayOutputAdapter<PP_Resource> > output,
65 HostResource chooser);
67 pp::CompletionCallbackFactory<PPB_FileChooser_Proxy,
68 ProxyNonThreadSafeRefCount> callback_factory_;
70 DISALLOW_COPY_AND_ASSIGN(PPB_FileChooser_Proxy);
73 } // namespace proxy
74 } // namespace ppapi
76 #endif // PPAPI_PROXY_PPB_FILE_CHOOSER_PROXY_H_