| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "ppapi/c/pp_point.h" | 13 #include "ppapi/c/pp_point.h" |
| 14 #include "ppapi/c/private/ppb_flash_menu.h" | 14 #include "ppapi/c/private/ppb_flash_menu.h" |
| 15 #include "ppapi/shared_impl/tracked_callback.h" |
| 15 #include "ppapi/shared_impl/resource.h" | 16 #include "ppapi/shared_impl/resource.h" |
| 16 #include "ppapi/thunk/ppb_flash_menu_api.h" | 17 #include "ppapi/thunk/ppb_flash_menu_api.h" |
| 17 #include "webkit/plugins/ppapi/callbacks.h" | |
| 18 #include "webkit/plugins/webkit_plugins_export.h" | 18 #include "webkit/plugins/webkit_plugins_export.h" |
| 19 | 19 |
| 20 struct WebMenuItem; | 20 struct WebMenuItem; |
| 21 | 21 |
| 22 namespace webkit { | 22 namespace webkit { |
| 23 namespace ppapi { | 23 namespace ppapi { |
| 24 | 24 |
| 25 class PPB_Flash_Menu_Impl : public ::ppapi::Resource, | 25 class PPB_Flash_Menu_Impl : public ::ppapi::Resource, |
| 26 public ::ppapi::thunk::PPB_Flash_Menu_API { | 26 public ::ppapi::thunk::PPB_Flash_Menu_API { |
| 27 public: | 27 public: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 50 bool Init(const PP_Flash_Menu* menu_data); | 50 bool Init(const PP_Flash_Menu* menu_data); |
| 51 | 51 |
| 52 MenuData menu_data_; | 52 MenuData menu_data_; |
| 53 | 53 |
| 54 // We send |WebMenuItem|s, which have an |unsigned| "action" field instead of | 54 // We send |WebMenuItem|s, which have an |unsigned| "action" field instead of |
| 55 // an |int32_t| ID. (Chrome also limits the range of valid values for | 55 // an |int32_t| ID. (Chrome also limits the range of valid values for |
| 56 // actions.) This maps actions to IDs. | 56 // actions.) This maps actions to IDs. |
| 57 std::vector<int32_t> menu_id_map_; | 57 std::vector<int32_t> menu_id_map_; |
| 58 | 58 |
| 59 // Any pending callback (for |Show()|). | 59 // Any pending callback (for |Show()|). |
| 60 scoped_refptr<TrackedCompletionCallback> callback_; | 60 scoped_refptr< ::ppapi::TrackedCallback> callback_; |
| 61 | 61 |
| 62 // Output buffers to be filled in when the callback is completed successfully. | 62 // Output buffers to be filled in when the callback is completed successfully. |
| 63 int32_t* selected_id_out_; | 63 int32_t* selected_id_out_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Menu_Impl); | 65 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Menu_Impl); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace ppapi | 68 } // namespace ppapi |
| 69 } // namespace webkit | 69 } // namespace webkit |
| 70 | 70 |
| 71 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_ | 71 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_ |
| OLD | NEW |