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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 9085027: Pepper gamepad support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix example Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
13 #include "base/utf_offset_string_conversions.h" 13 #include "base/utf_offset_string_conversions.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "ppapi/c/dev/ppb_console_dev.h" 15 #include "ppapi/c/dev/ppb_console_dev.h"
16 #include "ppapi/c/dev/ppb_find_dev.h" 16 #include "ppapi/c/dev/ppb_find_dev.h"
17 #include "ppapi/c/dev/ppb_gamepad_dev.h"
17 #include "ppapi/c/dev/ppb_zoom_dev.h" 18 #include "ppapi/c/dev/ppb_zoom_dev.h"
18 #include "ppapi/c/dev/ppp_find_dev.h" 19 #include "ppapi/c/dev/ppp_find_dev.h"
19 #include "ppapi/c/dev/ppp_selection_dev.h" 20 #include "ppapi/c/dev/ppp_selection_dev.h"
20 #include "ppapi/c/dev/ppp_zoom_dev.h" 21 #include "ppapi/c/dev/ppp_zoom_dev.h"
21 #include "ppapi/c/pp_rect.h" 22 #include "ppapi/c/pp_rect.h"
22 #include "ppapi/c/ppb_core.h" 23 #include "ppapi/c/ppb_core.h"
23 #include "ppapi/c/ppp_input_event.h" 24 #include "ppapi/c/ppp_input_event.h"
24 #include "ppapi/c/ppp_instance.h" 25 #include "ppapi/c/ppp_instance.h"
25 #include "ppapi/c/ppp_messaging.h" 26 #include "ppapi/c/ppp_messaging.h"
26 #include "ppapi/c/ppp_mouse_lock.h" 27 #include "ppapi/c/ppp_mouse_lock.h"
(...skipping 11 matching lines...) Expand all
38 #include "printing/units.h" 39 #include "printing/units.h"
39 #include "third_party/skia/include/core/SkCanvas.h" 40 #include "third_party/skia/include/core/SkCanvas.h"
40 #include "third_party/skia/include/core/SkRect.h" 41 #include "third_party/skia/include/core/SkRect.h"
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
49 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads. h"
48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 50 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
49 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" 51 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
50 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" 52 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
51 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 53 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
52 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 54 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
53 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h" 55 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h"
54 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
55 #include "webkit/plugins/ppapi/common.h" 57 #include "webkit/plugins/ppapi/common.h"
56 #include "webkit/plugins/ppapi/event_conversion.h" 58 #include "webkit/plugins/ppapi/event_conversion.h"
57 #include "webkit/plugins/ppapi/fullscreen_container.h" 59 #include "webkit/plugins/ppapi/fullscreen_container.h"
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 // Only GETs and POSTs are supported. 1295 // Only GETs and POSTs are supported.
1294 if (web_request.httpMethod() != "GET" && 1296 if (web_request.httpMethod() != "GET" &&
1295 web_request.httpMethod() != "POST") 1297 web_request.httpMethod() != "POST")
1296 return PP_ERROR_BADARGUMENT; 1298 return PP_ERROR_BADARGUMENT;
1297 1299
1298 WebString target_str = WebString::fromUTF8(target); 1300 WebString target_str = WebString::fromUTF8(target);
1299 container_->loadFrameRequest(web_request, target_str, false, NULL); 1301 container_->loadFrameRequest(web_request, target_str, false, NULL);
1300 return PP_OK; 1302 return PP_OK;
1301 } 1303 }
1302 1304
1305 void PluginInstance::SampleGamepads(PP_Instance instance,
1306 PP_GamepadsData_Dev* data) {
1307 delegate()->SampleGamepads(reinterpret_cast<WebKit::WebGamepads*>(data));
brettw 2012/01/05 22:50:04 We should have some compiler asserts about the siz
scottmg 2012/01/06 00:54:21 Done. Had to be DCHECK per comments & irc.
1308 }
1309
1303 bool PluginInstance::IsViewAccelerated() { 1310 bool PluginInstance::IsViewAccelerated() {
1304 if (!container_) 1311 if (!container_)
1305 return false; 1312 return false;
1306 1313
1307 WebDocument document = container_->element().document(); 1314 WebDocument document = container_->element().document();
1308 WebFrame* frame = document.frame(); 1315 WebFrame* frame = document.frame();
1309 if (!frame) 1316 if (!frame)
1310 return false; 1317 return false;
1311 WebView* view = frame->view(); 1318 WebView* view = frame->view();
1312 if (!view) 1319 if (!view)
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 screen_size_for_fullscreen_ = gfx::Size(); 2051 screen_size_for_fullscreen_ = gfx::Size();
2045 WebElement element = container_->element(); 2052 WebElement element = container_->element();
2046 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2053 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2047 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2054 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2048 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2055 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2049 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2056 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2050 } 2057 }
2051 2058
2052 } // namespace ppapi 2059 } // namespace ppapi
2053 } // namespace webkit 2060 } // namespace webkit
OLDNEW
« ppapi/cpp/dev/gamepad_dev.h ('K') | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698