| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/browser/render_view_host_delegate.h" | 13 #include "content/public/browser/render_view_host_delegate.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 16 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
| 17 | 17 |
| 18 struct WebDropData; | |
| 19 | |
| 20 namespace content { | 18 namespace content { |
| 21 | 19 |
| 22 class RenderViewHost; | 20 class RenderViewHost; |
| 23 class RenderWidgetHost; | 21 class RenderWidgetHost; |
| 24 class RenderWidgetHostView; | 22 class RenderWidgetHostView; |
| 25 | 23 |
| 26 // The WebContentsView is an interface that is implemented by the platform- | 24 // The WebContentsView is an interface that is implemented by the platform- |
| 27 // 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 |
| 28 // them. View-related messages will also get forwarded directly to this class | 26 // them. View-related messages will also get forwarded directly to this class |
| 29 // from RenderViewHost via RenderViewHostDelegate::View. | 27 // from RenderViewHost via RenderViewHostDelegate::View. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Restores focus to the last focus view. If StoreFocus has not yet been | 100 // Restores focus to the last focus view. If StoreFocus has not yet been |
| 103 // invoked, SetInitialFocus is invoked. | 101 // invoked, SetInitialFocus is invoked. |
| 104 virtual void RestoreFocus() = 0; | 102 virtual void RestoreFocus() = 0; |
| 105 | 103 |
| 106 // If we try to close the tab while a drag is in progress, we crash. These | 104 // If we try to close the tab while a drag is in progress, we crash. These |
| 107 // methods allow the WebContents to determine if a drag is in progress and | 105 // methods allow the WebContents to determine if a drag is in progress and |
| 108 // postpone the tab closing. | 106 // postpone the tab closing. |
| 109 virtual bool IsDoingDrag() const = 0; | 107 virtual bool IsDoingDrag() const = 0; |
| 110 virtual void CancelDragAndCloseTab() = 0; | 108 virtual void CancelDragAndCloseTab() = 0; |
| 111 | 109 |
| 112 // Returns the current drop data, if any. | |
| 113 virtual WebDropData* GetDropData() const = 0; | |
| 114 | |
| 115 // If we close the tab while a UI control is in an event-tracking | 110 // If we close the tab while a UI control is in an event-tracking |
| 116 // loop, the control may message freed objects and crash. | 111 // loop, the control may message freed objects and crash. |
| 117 // WebContents::Close() calls IsEventTracking(), and if it returns | 112 // WebContents::Close() calls IsEventTracking(), and if it returns |
| 118 // true CloseTabAfterEventTracking() is called and the close is not | 113 // true CloseTabAfterEventTracking() is called and the close is not |
| 119 // completed. | 114 // completed. |
| 120 virtual bool IsEventTracking() const = 0; | 115 virtual bool IsEventTracking() const = 0; |
| 121 virtual void CloseTabAfterEventTracking() = 0; | 116 virtual void CloseTabAfterEventTracking() = 0; |
| 122 | 117 |
| 123 // Get the bounds of the View, relative to the parent. | 118 // Get the bounds of the View, relative to the parent. |
| 124 // TODO(beng): Return a rect rather than using an out param. | 119 // TODO(beng): Return a rect rather than using an out param. |
| 125 virtual void GetViewBounds(gfx::Rect* out) const = 0; | 120 virtual void GetViewBounds(gfx::Rect* out) const = 0; |
| 126 }; | 121 }; |
| 127 | 122 |
| 128 } // namespace content | 123 } // namespace content |
| 129 | 124 |
| 130 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ | 125 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_VIEW_H_ |
| OLD | NEW |