OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 | 16 |
17 struct WebDropData; | |
18 | |
19 namespace content { | 17 namespace content { |
| 18 struct DropData; |
20 | 19 |
21 // The WebContentsView is an interface that is implemented by the platform- | 20 // The WebContentsView is an interface that is implemented by the platform- |
22 // dependent web contents views. The WebContents uses this interface to talk to | 21 // dependent web contents views. The WebContents uses this interface to talk to |
23 // them. | 22 // them. |
24 class CONTENT_EXPORT WebContentsView { | 23 class CONTENT_EXPORT WebContentsView { |
25 public: | 24 public: |
26 virtual ~WebContentsView() {} | 25 virtual ~WebContentsView() {} |
27 | 26 |
28 // Returns the native widget that contains the contents of the tab. | 27 // Returns the native widget that contains the contents of the tab. |
29 virtual gfx::NativeView GetNativeView() const = 0; | 28 virtual gfx::NativeView GetNativeView() const = 0; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 virtual void SetInitialFocus() = 0; | 69 virtual void SetInitialFocus() = 0; |
71 | 70 |
72 // Stores the currently focused view. | 71 // Stores the currently focused view. |
73 virtual void StoreFocus() = 0; | 72 virtual void StoreFocus() = 0; |
74 | 73 |
75 // Restores focus to the last focus view. If StoreFocus has not yet been | 74 // Restores focus to the last focus view. If StoreFocus has not yet been |
76 // invoked, SetInitialFocus is invoked. | 75 // invoked, SetInitialFocus is invoked. |
77 virtual void RestoreFocus() = 0; | 76 virtual void RestoreFocus() = 0; |
78 | 77 |
79 // Returns the current drop data, if any. | 78 // Returns the current drop data, if any. |
80 virtual WebDropData* GetDropData() const = 0; | 79 virtual DropData* GetDropData() const = 0; |
81 | 80 |
82 // Get the bounds of the View, relative to the parent. | 81 // Get the bounds of the View, relative to the parent. |
83 virtual gfx::Rect GetViewBounds() const = 0; | 82 virtual gfx::Rect GetViewBounds() const = 0; |
84 | 83 |
85 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
86 // The web contents view assumes that its view will never be overlapped by | 85 // The web contents view assumes that its view will never be overlapped by |
87 // another view (either partially or fully). This allows it to perform | 86 // another view (either partially or fully). This allows it to perform |
88 // optimizations. If the view is in a view hierarchy where it might be | 87 // optimizations. If the view is in a view hierarchy where it might be |
89 // overlapped by another view, notify the view by calling this with |true|. | 88 // overlapped by another view, notify the view by calling this with |true|. |
90 virtual void SetAllowOverlappingViews(bool overlapping) = 0; | 89 virtual void SetAllowOverlappingViews(bool overlapping) = 0; |
91 | 90 |
92 // Returns true if overlapping views are allowed, false otherwise. | 91 // Returns true if overlapping views are allowed, false otherwise. |
93 virtual bool GetAllowOverlappingViews() const = 0; | 92 virtual bool GetAllowOverlappingViews() const = 0; |
94 #endif | 93 #endif |
95 }; | 94 }; |
96 | 95 |
97 } // namespace content | 96 } // namespace content |
98 | 97 |
99 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ | 98 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ |
OLD | NEW |