Allow only one bookmark to be added for multiple fast starring
[chromium-blink-merge.git] / ppapi / examples / stub / stub.cc
blob41628a30ecb21cc1dfb75dab21b4a910a84fbf4e
1 // Copyright (c) 2010 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/instance.h"
6 #include "ppapi/cpp/module.h"
8 // This is the simplest possible C++ Pepper plugin that does nothing.
10 // This object represents one time the page says <embed>.
11 class MyInstance : public pp::Instance {
12 public:
13 explicit MyInstance(PP_Instance instance) : pp::Instance(instance) {}
14 virtual ~MyInstance() {}
16 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) {
17 return true;
21 // This object is the global object representing this plugin library as long
22 // as it is loaded.
23 class MyModule : public pp::Module {
24 public:
25 MyModule() : pp::Module() {}
26 virtual ~MyModule() {}
28 // Override CreateInstance to create your customized Instance object.
29 virtual pp::Instance* CreateInstance(PP_Instance instance) {
30 return new MyInstance(instance);
34 namespace pp {
36 // Factory function for your specialization of the Module object.
37 Module* CreateModule() {
38 return new MyModule();
41 } // namespace pp