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
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_TEST_WEB_CONTENTS_VIEW_H_
6 #define CONTENT_TEST_TEST_WEB_CONTENTS_VIEW_H_
8 #include "base/compiler_specific.h"
9 #include "content/port/browser/render_view_host_delegate_view.h"
10 #include "content/port/browser/web_contents_view_port.h"
14 class TestWebContentsView
: public WebContentsViewPort
,
15 public RenderViewHostDelegateView
{
17 TestWebContentsView();
18 virtual ~TestWebContentsView();
20 // RenderViewHostDelegateView:
21 virtual void ShowContextMenu(const ContextMenuParams
& params
,
22 ContextMenuSourceType type
) OVERRIDE
;
23 virtual void ShowPopupMenu(const gfx::Rect
& bounds
,
25 double item_font_size
,
27 const std::vector
<WebMenuItem
>& items
,
29 bool allow_multiple_selection
) OVERRIDE
;
30 virtual void StartDragging(const WebDropData
& drop_data
,
31 WebKit::WebDragOperationsMask allowed_ops
,
32 const gfx::ImageSkia
& image
,
33 const gfx::Vector2d
& image_offset
,
34 const DragEventSourceInfo
& event_info
) OVERRIDE
;
35 virtual void UpdateDragCursor(WebKit::WebDragOperation operation
) OVERRIDE
;
36 virtual void GotFocus() OVERRIDE
;
37 virtual void TakeFocus(bool reverse
) OVERRIDE
;
40 virtual gfx::NativeView
GetNativeView() const OVERRIDE
;
41 virtual gfx::NativeView
GetContentNativeView() const OVERRIDE
;
42 virtual gfx::NativeWindow
GetTopLevelNativeWindow() const OVERRIDE
;
43 virtual void GetContainerBounds(gfx::Rect
*out
) const OVERRIDE
;
44 virtual void OnTabCrashed(base::TerminationStatus status
,
45 int error_code
) OVERRIDE
;
46 virtual void SizeContents(const gfx::Size
& size
) OVERRIDE
;
47 virtual void Focus() OVERRIDE
;
48 virtual void SetInitialFocus() OVERRIDE
;
49 virtual void StoreFocus() OVERRIDE
;
50 virtual void RestoreFocus() OVERRIDE
;
51 virtual WebDropData
* GetDropData() const OVERRIDE
;
52 virtual gfx::Rect
GetViewBounds() const OVERRIDE
;
53 #if defined(OS_MACOSX)
54 virtual void SetAllowOverlappingViews(bool overlapping
) OVERRIDE
;
57 // WebContentsViewPort:
58 virtual void CreateView(const gfx::Size
& initial_size
,
59 gfx::NativeView context
) OVERRIDE
;
60 virtual RenderWidgetHostView
* CreateViewForWidget(
61 RenderWidgetHost
* render_widget_host
) OVERRIDE
;
62 virtual RenderWidgetHostView
* CreateViewForPopupWidget(
63 RenderWidgetHost
* render_widget_host
) OVERRIDE
;
64 virtual void SetPageTitle(const string16
& title
) OVERRIDE
;
65 virtual void RenderViewCreated(RenderViewHost
* host
) OVERRIDE
;
66 virtual void RenderViewSwappedIn(RenderViewHost
* host
) OVERRIDE
;
67 virtual void SetOverscrollControllerEnabled(bool enabled
) OVERRIDE
;
68 #if defined(OS_MACOSX)
69 virtual bool IsEventTracking() const OVERRIDE
;
70 virtual void CloseTabAfterEventTracking() OVERRIDE
;
74 DISALLOW_COPY_AND_ASSIGN(TestWebContentsView
);
77 } // namespace content
79 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_VIEW_H_