OLD | NEW |
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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 COMPILE_ASSERT_MATCHING_ENUM(TypeCell, PP_CURSORTYPE_CELL); | 138 COMPILE_ASSERT_MATCHING_ENUM(TypeCell, PP_CURSORTYPE_CELL); |
139 COMPILE_ASSERT_MATCHING_ENUM(TypeContextMenu, PP_CURSORTYPE_CONTEXTMENU); | 139 COMPILE_ASSERT_MATCHING_ENUM(TypeContextMenu, PP_CURSORTYPE_CONTEXTMENU); |
140 COMPILE_ASSERT_MATCHING_ENUM(TypeAlias, PP_CURSORTYPE_ALIAS); | 140 COMPILE_ASSERT_MATCHING_ENUM(TypeAlias, PP_CURSORTYPE_ALIAS); |
141 COMPILE_ASSERT_MATCHING_ENUM(TypeProgress, PP_CURSORTYPE_PROGRESS); | 141 COMPILE_ASSERT_MATCHING_ENUM(TypeProgress, PP_CURSORTYPE_PROGRESS); |
142 COMPILE_ASSERT_MATCHING_ENUM(TypeNoDrop, PP_CURSORTYPE_NODROP); | 142 COMPILE_ASSERT_MATCHING_ENUM(TypeNoDrop, PP_CURSORTYPE_NODROP); |
143 COMPILE_ASSERT_MATCHING_ENUM(TypeCopy, PP_CURSORTYPE_COPY); | 143 COMPILE_ASSERT_MATCHING_ENUM(TypeCopy, PP_CURSORTYPE_COPY); |
144 COMPILE_ASSERT_MATCHING_ENUM(TypeNone, PP_CURSORTYPE_NONE); | 144 COMPILE_ASSERT_MATCHING_ENUM(TypeNone, PP_CURSORTYPE_NONE); |
145 COMPILE_ASSERT_MATCHING_ENUM(TypeNotAllowed, PP_CURSORTYPE_NOTALLOWED); | 145 COMPILE_ASSERT_MATCHING_ENUM(TypeNotAllowed, PP_CURSORTYPE_NOTALLOWED); |
146 COMPILE_ASSERT_MATCHING_ENUM(TypeZoomIn, PP_CURSORTYPE_ZOOMIN); | 146 COMPILE_ASSERT_MATCHING_ENUM(TypeZoomIn, PP_CURSORTYPE_ZOOMIN); |
147 COMPILE_ASSERT_MATCHING_ENUM(TypeZoomOut, PP_CURSORTYPE_ZOOMOUT); | 147 COMPILE_ASSERT_MATCHING_ENUM(TypeZoomOut, PP_CURSORTYPE_ZOOMOUT); |
| 148 COMPILE_ASSERT_MATCHING_ENUM(TypeGrab, PP_CURSORTYPE_GRAB); |
| 149 COMPILE_ASSERT_MATCHING_ENUM(TypeGrabbing, PP_CURSORTYPE_GRABBING); |
148 // Do not assert WebCursorInfo::TypeCustom == PP_CURSORTYPE_CUSTOM; | 150 // Do not assert WebCursorInfo::TypeCustom == PP_CURSORTYPE_CUSTOM; |
149 // PP_CURSORTYPE_CUSTOM is pinned to allow new cursor types. | 151 // PP_CURSORTYPE_CUSTOM is pinned to allow new cursor types. |
150 | 152 |
151 void RectToPPRect(const gfx::Rect& input, PP_Rect* output) { | 153 void RectToPPRect(const gfx::Rect& input, PP_Rect* output) { |
152 *output = PP_MakeRectFromXYWH(input.x(), input.y(), | 154 *output = PP_MakeRectFromXYWH(input.x(), input.y(), |
153 input.width(), input.height()); | 155 input.width(), input.height()); |
154 } | 156 } |
155 | 157 |
156 PP_Var GetWindowObject(PP_Instance instance_id) { | 158 PP_Var GetWindowObject(PP_Instance instance_id) { |
157 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 159 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 return found->second; | 1289 return found->second; |
1288 } | 1290 } |
1289 | 1291 |
1290 bool PluginInstance::IsFullPagePlugin() const { | 1292 bool PluginInstance::IsFullPagePlugin() const { |
1291 WebFrame* frame = container()->element().document().frame(); | 1293 WebFrame* frame = container()->element().document().frame(); |
1292 return frame->view()->mainFrame()->document().isPluginDocument(); | 1294 return frame->view()->mainFrame()->document().isPluginDocument(); |
1293 } | 1295 } |
1294 | 1296 |
1295 } // namespace ppapi | 1297 } // namespace ppapi |
1296 } // namespace webkit | 1298 } // namespace webkit |
OLD | NEW |