| Index: ppapi/examples/2d/paint_manager_example.cc
|
| diff --git a/ppapi/examples/2d/paint_manager_example.cc b/ppapi/examples/2d/paint_manager_example.cc
|
| index 86bdbe79ed8f9f2a8e820cd682f24c57cbb413d7..229176da1a8e2e6f5448e7e0486134e85c912a1f 100644
|
| --- a/ppapi/examples/2d/paint_manager_example.cc
|
| +++ b/ppapi/examples/2d/paint_manager_example.cc
|
| @@ -12,6 +12,9 @@
|
| #include "ppapi/cpp/view.h"
|
| #include "ppapi/utility/graphics/paint_manager.h"
|
|
|
| +#include "ppapi/cpp/dev/file_chooser_dev.h"
|
| +#include "ppapi/utility/completion_callback_factory.h"
|
| +
|
| // Number of pixels to each side of the center of the square that we draw.
|
| static const int kSquareRadius = 2;
|
|
|
| @@ -44,11 +47,21 @@ class MyInstance : public pp::Instance, public pp::PaintManager::Client {
|
| last_y_(0) {
|
| paint_manager_.Initialize(this, this, false);
|
| RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
|
| + callback_factory_.Initialize(this);
|
| + }
|
| +
|
| + pp::FileChooser_Dev chooser_;
|
| + pp::CompletionCallbackFactory<MyInstance> callback_factory_;
|
| +
|
| + void GotFile(int32_t result, const std::vector<pp::FileRef>& files) {
|
| }
|
|
|
| virtual bool HandleInputEvent(const pp::InputEvent& event) {
|
| switch (event.GetType()) {
|
| case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
|
| + chooser_ = pp::FileChooser_Dev(this, PP_FILECHOOSERMODE_OPEN, "text/html");
|
| + chooser_.Show(callback_factory_.NewCallbackWithOutput(&MyInstance::GotFile));
|
| +
|
| pp::MouseInputEvent mouse_event(event);
|
| // Update the square on a mouse down.
|
| if (mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
|
|
|