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