- add sources.
[platform/framework/web/crosswalk.git] / src / content / common / webplugin_geometry.h
1 // Copyright (c) 2013 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.
4
5 #ifndef CONTENT_COMMON_WEBPLUGIN_GEOMETRY_H_
6 #define CONTENT_COMMON_WEBPLUGIN_GEOMETRY_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/gfx/rect.h"
13
14 namespace content {
15
16 // Describes the new location for a plugin window.
17 struct WebPluginGeometry {
18   WebPluginGeometry();
19   ~WebPluginGeometry();
20
21   bool Equals(const WebPluginGeometry& rhs) const;
22
23   // On Windows, this is the plugin window in the plugin process.
24   // On X11, this is the XID of the plugin-side GtkPlug containing the
25   // GtkSocket hosting the actual plugin window.
26   //
27   // On Mac OS X, all of the plugin types are currently "windowless"
28   // (window == 0) except for the special case of the GPU plugin,
29   // which currently performs rendering on behalf of the Pepper 3D API
30   // and WebGL. The GPU plugin uses a simple integer for the
31   // PluginWindowHandle which is used to map to a side data structure
32   // containing information about the plugin. Soon this plugin will be
33   // generalized, at which point this mechanism will be rethought or
34   // removed.
35   gfx::PluginWindowHandle window;
36   gfx::Rect window_rect;
37   // Clip rect (include) and cutouts (excludes), relative to
38   // window_rect origin.
39   gfx::Rect clip_rect;
40   std::vector<gfx::Rect> cutout_rects;
41   bool rects_valid;
42   bool visible;
43 };
44
45 }  // namespace content
46
47 #endif  // CONTENT_COMMON_WEBPLUGIN_GEOMETRY_H_