Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / content / test / test_web_contents_view.h
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.
4
5 #ifndef CONTENT_TEST_TEST_WEB_CONTENTS_VIEW_H_
6 #define CONTENT_TEST_TEST_WEB_CONTENTS_VIEW_H_
7
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"
11
12 namespace content {
13
14 class TestWebContentsView : public WebContentsViewPort,
15                             public RenderViewHostDelegateView {
16  public:
17   TestWebContentsView();
18   virtual ~TestWebContentsView();
19
20   // RenderViewHostDelegateView:
21   virtual void StartDragging(const DropData& drop_data,
22                              blink::WebDragOperationsMask allowed_ops,
23                              const gfx::ImageSkia& image,
24                              const gfx::Vector2d& image_offset,
25                              const DragEventSourceInfo& event_info) OVERRIDE;
26   virtual void UpdateDragCursor(blink::WebDragOperation operation) OVERRIDE;
27   virtual void GotFocus() OVERRIDE;
28   virtual void TakeFocus(bool reverse) OVERRIDE;
29
30   // WebContentsView:
31   virtual gfx::NativeView GetNativeView() const OVERRIDE;
32   virtual gfx::NativeView GetContentNativeView() const OVERRIDE;
33   virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE;
34   virtual void GetContainerBounds(gfx::Rect *out) const OVERRIDE;
35   virtual void OnTabCrashed(base::TerminationStatus status,
36                             int error_code) OVERRIDE;
37   virtual void SizeContents(const gfx::Size& size) OVERRIDE;
38   virtual void Focus() OVERRIDE;
39   virtual void SetInitialFocus() OVERRIDE;
40   virtual void StoreFocus() OVERRIDE;
41   virtual void RestoreFocus() OVERRIDE;
42   virtual DropData* GetDropData() const OVERRIDE;
43   virtual gfx::Rect GetViewBounds() const OVERRIDE;
44 #if defined(OS_MACOSX)
45   virtual void SetAllowOverlappingViews(bool overlapping) OVERRIDE;
46   virtual bool GetAllowOverlappingViews() const OVERRIDE;
47   virtual void SetOverlayView(WebContentsView* overlay,
48                               const gfx::Point& offset) OVERRIDE;
49   virtual void RemoveOverlayView() OVERRIDE;
50 #endif
51
52   // WebContentsViewPort:
53   virtual void CreateView(const gfx::Size& initial_size,
54                           gfx::NativeView context) OVERRIDE;
55   virtual RenderWidgetHostView* CreateViewForWidget(
56       RenderWidgetHost* render_widget_host) OVERRIDE;
57   virtual RenderWidgetHostView* CreateViewForPopupWidget(
58       RenderWidgetHost* render_widget_host) OVERRIDE;
59   virtual void SetPageTitle(const base::string16& title) OVERRIDE;
60   virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE;
61   virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE;
62   virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE;
63 #if defined(OS_MACOSX)
64   virtual bool IsEventTracking() const OVERRIDE;
65   virtual void CloseTabAfterEventTracking() OVERRIDE;
66 #endif
67
68  private:
69   DISALLOW_COPY_AND_ASSIGN(TestWebContentsView);
70 };
71
72 }  // namespace content
73
74 #endif  // CONTENT_TEST_TEST_WEB_CONTENTS_VIEW_H_