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.
5 #include "ppapi/cpp/private/flash_menu.h"
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/cpp/completion_callback.h"
9 #include "ppapi/cpp/instance_handle.h"
10 #include "ppapi/cpp/module.h"
11 #include "ppapi/cpp/module_impl.h"
12 #include "ppapi/cpp/point.h"
18 template <> const char* interface_name
<PPB_Flash_Menu
>() {
19 return PPB_FLASH_MENU_INTERFACE
;
26 Menu::Menu(const InstanceHandle
& instance
,
27 const struct PP_Flash_Menu
* menu_data
) {
28 if (has_interface
<PPB_Flash_Menu
>()) {
29 PassRefFromConstructor(get_interface
<PPB_Flash_Menu
>()->Create(
30 instance
.pp_instance(), menu_data
));
34 int32_t Menu::Show(const Point
& location
,
36 const CompletionCallback
& cc
) {
37 if (!has_interface
<PPB_Flash_Menu
>())
38 return cc
.MayForce(PP_ERROR_NOINTERFACE
);
39 return get_interface
<PPB_Flash_Menu
>()->Show(
43 cc
.pp_completion_callback());