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