| 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 #include "ppapi/cpp/private/flash_menu.h" | 5 #include "ppapi/cpp/private/flash_menu.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/cpp/completion_callback.h" | 8 #include "ppapi/cpp/completion_callback.h" |
| 9 #include "ppapi/cpp/instance.h" | 9 #include "ppapi/cpp/instance_handle.h" |
| 10 #include "ppapi/cpp/module.h" | 10 #include "ppapi/cpp/module.h" |
| 11 #include "ppapi/cpp/module_impl.h" | 11 #include "ppapi/cpp/module_impl.h" |
| 12 #include "ppapi/cpp/point.h" | 12 #include "ppapi/cpp/point.h" |
| 13 | 13 |
| 14 namespace pp { | 14 namespace pp { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 template <> const char* interface_name<PPB_Flash_Menu>() { | 18 template <> const char* interface_name<PPB_Flash_Menu>() { |
| 19 return PPB_FLASH_MENU_INTERFACE; | 19 return PPB_FLASH_MENU_INTERFACE; |
| 20 } | 20 } |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 namespace flash { | 24 namespace flash { |
| 25 | 25 |
| 26 Menu::Menu(const Instance& instance, const struct PP_Flash_Menu* menu_data) { | 26 Menu::Menu(const InstanceHandle& instance, |
| 27 const struct PP_Flash_Menu* menu_data) { |
| 27 if (has_interface<PPB_Flash_Menu>()) { | 28 if (has_interface<PPB_Flash_Menu>()) { |
| 28 PassRefFromConstructor(get_interface<PPB_Flash_Menu>()->Create( | 29 PassRefFromConstructor(get_interface<PPB_Flash_Menu>()->Create( |
| 29 instance.pp_instance(), menu_data)); | 30 instance.pp_instance(), menu_data)); |
| 30 } | 31 } |
| 31 } | 32 } |
| 32 | 33 |
| 33 int32_t Menu::Show(const Point& location, | 34 int32_t Menu::Show(const Point& location, |
| 34 int32_t* selected_id, | 35 int32_t* selected_id, |
| 35 const CompletionCallback& cc) { | 36 const CompletionCallback& cc) { |
| 36 if (!has_interface<PPB_Flash_Menu>()) | 37 if (!has_interface<PPB_Flash_Menu>()) |
| 37 return cc.MayForce(PP_ERROR_NOINTERFACE); | 38 return cc.MayForce(PP_ERROR_NOINTERFACE); |
| 38 return get_interface<PPB_Flash_Menu>()->Show( | 39 return get_interface<PPB_Flash_Menu>()->Show( |
| 39 pp_resource(), | 40 pp_resource(), |
| 40 &location.pp_point(), | 41 &location.pp_point(), |
| 41 selected_id, | 42 selected_id, |
| 42 cc.pp_completion_callback()); | 43 cc.pp_completion_callback()); |
| 43 } | 44 } |
| 44 | 45 |
| 45 } // namespace flash | 46 } // namespace flash |
| 46 } // namespace pp | 47 } // namespace pp |
| OLD | NEW |