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