Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ppapi / cpp / private / flash_menu.cc
blobe77021b1a5b276cc2441c84523330ce1e7f44911
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"
14 namespace pp {
16 namespace {
18 template <> const char* interface_name<PPB_Flash_Menu>() {
19 return PPB_FLASH_MENU_INTERFACE;
22 } // namespace
24 namespace flash {
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,
35 int32_t* selected_id,
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(
40 pp_resource(),
41 &location.pp_point(),
42 selected_id,
43 cc.pp_completion_callback());
46 } // namespace flash
47 } // namespace pp