blob: af0fe86fe9111a7e331dd5057cf7efb253160d73 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdint.h>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/ppb_flash_menu_api.h"
struct PP_Flash_Menu;
namespace ppapi {
namespace proxy {
class FlashMenuResource
: public PluginResource,
public thunk::PPB_Flash_Menu_API {
// You must call Initialize after construction.
FlashMenuResource(Connection connection, PP_Instance instance);
~FlashMenuResource() override;
// Returns true on success. False means that this object can not be used.
// This has to be separate from the constructor because the menu data could
// be invalid.
bool Initialize(const PP_Flash_Menu* menu_data);
// Resource overrides.
thunk::PPB_Flash_Menu_API* AsPPB_Flash_Menu_API() override;
// PPB_Flash_Menu_API.
int32_t Show(const PP_Point* location,
int32_t* selected_id,
scoped_refptr<TrackedCallback> callback) override;
void OnReplyReceived(const proxy::ResourceMessageReplyParams& params,
const IPC::Message& msg) override;
void OnShowReply(
const proxy::ResourceMessageReplyParams& params,
int32_t selected_id);
int* selected_id_dest_;
scoped_refptr<TrackedCallback> callback_;
} // namespace proxy
} // namespace ppapi