OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_RENDERER_PEPPER_PEPPER_FILE_CHOOSER_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_FILE_CHOOSER_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_CHOOSER_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_CHOOSER_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "ppapi/host/host_message_context.h" | 14 #include "ppapi/host/host_message_context.h" |
15 #include "ppapi/host/resource_host.h" | 15 #include "ppapi/host/resource_host.h" |
16 #include "ppapi/proxy/resource_message_params.h" | 16 #include "ppapi/proxy/resource_message_params.h" |
17 | 17 |
| 18 namespace ppapi { |
| 19 struct FileRefCreateInfo; |
| 20 } |
| 21 |
18 namespace content { | 22 namespace content { |
19 | 23 |
20 class RendererPpapiHost; | 24 class RendererPpapiHost; |
21 class RenderViewImpl; | 25 class RenderViewImpl; |
22 | 26 |
23 class CONTENT_EXPORT PepperFileChooserHost | 27 class CONTENT_EXPORT PepperFileChooserHost |
24 : public ppapi::host::ResourceHost, | 28 : public ppapi::host::ResourceHost, |
25 public base::SupportsWeakPtr<PepperFileChooserHost> { | 29 public base::SupportsWeakPtr<PepperFileChooserHost> { |
26 public: | 30 public: |
27 // Structure to store the information about chosen files. | 31 // Structure to store the information about chosen files. |
(...skipping 16 matching lines...) Expand all Loading... |
44 | 48 |
45 private: | 49 private: |
46 class CompletionHandler; | 50 class CompletionHandler; |
47 | 51 |
48 int32_t OnShow(ppapi::host::HostMessageContext* context, | 52 int32_t OnShow(ppapi::host::HostMessageContext* context, |
49 bool save_as, | 53 bool save_as, |
50 bool open_multiple, | 54 bool open_multiple, |
51 const std::string& suggested_file_name, | 55 const std::string& suggested_file_name, |
52 const std::vector<std::string>& accept_mime_types); | 56 const std::vector<std::string>& accept_mime_types); |
53 | 57 |
| 58 void DidCreateResourceHosts(const std::vector<base::FilePath>& file_paths, |
| 59 const std::vector<std::string>& display_names, |
| 60 const std::vector<int>& browser_ids); |
| 61 |
54 // Non-owning pointer. | 62 // Non-owning pointer. |
55 RendererPpapiHost* renderer_ppapi_host_; | 63 RendererPpapiHost* renderer_ppapi_host_; |
56 | 64 |
57 ppapi::host::ReplyMessageContext reply_context_; | 65 ppapi::host::ReplyMessageContext reply_context_; |
58 CompletionHandler* handler_; | 66 CompletionHandler* handler_; |
59 | 67 |
| 68 base::WeakPtrFactory<PepperFileChooserHost> weak_factory_; |
| 69 |
60 DISALLOW_COPY_AND_ASSIGN(PepperFileChooserHost); | 70 DISALLOW_COPY_AND_ASSIGN(PepperFileChooserHost); |
61 }; | 71 }; |
62 | 72 |
63 } // namespace content | 73 } // namespace content |
64 | 74 |
65 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_CHOOSER_HOST_H_ | 75 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_CHOOSER_HOST_H_ |
OLD | NEW |