| 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_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
| 14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 16 | 16 |
| 17 namespace blink { |
| 18 struct WebScreenInfo; |
| 19 } |
| 20 |
| 17 namespace content { | 21 namespace content { |
| 18 class RenderViewHost; | 22 class RenderViewHost; |
| 19 class RenderWidgetHost; | 23 class RenderWidgetHost; |
| 20 class RenderWidgetHostViewBase; | 24 class RenderWidgetHostViewBase; |
| 21 struct DropData; | 25 struct DropData; |
| 22 | 26 |
| 23 // The WebContentsView is an interface that is implemented by the platform- | 27 // The WebContentsView is an interface that is implemented by the platform- |
| 24 // dependent web contents views. The WebContents uses this interface to talk to | 28 // dependent web contents views. The WebContents uses this interface to talk to |
| 25 // them. | 29 // them. |
| 26 class WebContentsView { | 30 class WebContentsView { |
| 27 public: | 31 public: |
| 28 virtual ~WebContentsView() {} | 32 virtual ~WebContentsView() {} |
| 29 | 33 |
| 30 // Returns the native widget that contains the contents of the tab. | 34 // Returns the native widget that contains the contents of the tab. |
| 31 virtual gfx::NativeView GetNativeView() const = 0; | 35 virtual gfx::NativeView GetNativeView() const = 0; |
| 32 | 36 |
| 33 // Returns the native widget with the main content of the tab (i.e. the main | 37 // Returns the native widget with the main content of the tab (i.e. the main |
| 34 // render view host, though there may be many popups in the tab as children of | 38 // render view host, though there may be many popups in the tab as children of |
| 35 // the container). | 39 // the container). |
| 36 virtual gfx::NativeView GetContentNativeView() const = 0; | 40 virtual gfx::NativeView GetContentNativeView() const = 0; |
| 37 | 41 |
| 38 // Returns the outermost native view. This will be used as the parent for | 42 // Returns the outermost native view. This will be used as the parent for |
| 39 // dialog boxes. | 43 // dialog boxes. |
| 40 virtual gfx::NativeWindow GetTopLevelNativeWindow() const = 0; | 44 virtual gfx::NativeWindow GetTopLevelNativeWindow() const = 0; |
| 41 | 45 |
| 46 // The following static method is implemented by each platform. |
| 47 static void GetDefaultScreenInfo(blink::WebScreenInfo* results); |
| 48 |
| 49 // Gets screen information for the window associated with this view. |
| 50 virtual void GetScreenInfo(blink::WebScreenInfo* web_screen_info) const = 0; |
| 51 |
| 42 // Computes the rectangle for the native widget that contains the contents of | 52 // Computes the rectangle for the native widget that contains the contents of |
| 43 // the tab in the screen coordinate system. | 53 // the tab in the screen coordinate system. |
| 44 virtual void GetContainerBounds(gfx::Rect* out) const = 0; | 54 virtual void GetContainerBounds(gfx::Rect* out) const = 0; |
| 45 | 55 |
| 46 // TODO(brettw) this is a hack. It's used in two places at the time of this | 56 // TODO(brettw) this is a hack. It's used in two places at the time of this |
| 47 // writing: (1) when render view hosts switch, we need to size the replaced | 57 // writing: (1) when render view hosts switch, we need to size the replaced |
| 48 // one to be correct, since it wouldn't have known about sizes that happened | 58 // one to be correct, since it wouldn't have known about sizes that happened |
| 49 // while it was hidden; (2) in constrained windows. | 59 // while it was hidden; (2) in constrained windows. |
| 50 // | 60 // |
| 51 // (1) will be fixed once interstitials are cleaned up. (2) seems like it | 61 // (1) will be fixed once interstitials are cleaned up. (2) seems like it |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // true CloseTabAfterEventTracking() is called and the close is not | 132 // true CloseTabAfterEventTracking() is called and the close is not |
| 123 // completed. | 133 // completed. |
| 124 virtual bool IsEventTracking() const = 0; | 134 virtual bool IsEventTracking() const = 0; |
| 125 virtual void CloseTabAfterEventTracking() = 0; | 135 virtual void CloseTabAfterEventTracking() = 0; |
| 126 #endif | 136 #endif |
| 127 }; | 137 }; |
| 128 | 138 |
| 129 } // namespace content | 139 } // namespace content |
| 130 | 140 |
| 131 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ | 141 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_H_ |
| OLD | NEW |