Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: ppapi/examples/2d/paint_manager_example.cc

Issue 10815073: Refactoring of new IPC-only pepper implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
raymes 2012/07/29 15:53:24 Were you going to hook this up? Seems like it's no
brettw 2012/07/30 05:46:37 Ignore this file, I was using it as a manual test.
+
pp::MouseInputEvent mouse_event(event);
// Update the square on a mouse down.
if (mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {

Powered by Google App Engine
This is Rietveld 408576698