summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_contents_view.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-10 20:34:35 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-10 20:34:35 +0000
commitc80c563f3f32e49ce0087d899accf6a77de09ba6 (patch)
tree17f56be64796b691c7d323e08120acdac0e43d9f /chrome/browser/web_contents_view.h
parentb5108d1892eeb184b2679ce0658f5fe708e22016 (diff)
downloadchromium_src-c80c563f3f32e49ce0087d899accf6a77de09ba6.zip
chromium_src-c80c563f3f32e49ce0087d899accf6a77de09ba6.tar.gz
chromium_src-c80c563f3f32e49ce0087d899accf6a77de09ba6.tar.bz2
Start splitting out view-related stuff from WebContents into a new class WebContentsViewWin, accessed through an abstract interface WebContentsView. This is incomplete but is a good start. There are still a bunch of pass-throughs required for the TabContents overrides. These won't be able to be cleaned up until we kill TabContents.
Review URL: http://codereview.chromium.org/7205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3243 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_contents_view.h')
-rw-r--r--chrome/browser/web_contents_view.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/chrome/browser/web_contents_view.h b/chrome/browser/web_contents_view.h
new file mode 100644
index 0000000..bb28438
--- /dev/null
+++ b/chrome/browser/web_contents_view.h
@@ -0,0 +1,84 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_WEB_CONTENTS_VIEW_H_
+#define CHROME_BROWSER_WEB_CONTENTS_VIEW_H_
+
+#include <windows.h>
+
+#include "base/basictypes.h"
+#include "base/gfx/rect.h"
+#include "base/gfx/size.h"
+
+class InfoBarView;
+class RenderViewHost;
+class RenderWidgetHostHWND;
+class WebContents;
+struct WebDropData;
+
+// The WebContentsView is an interface that is implemented by the platform-
+// dependent web contents views. The WebContents uses this interface to talk to
+// them.
+class WebContentsView {
+ public:
+ virtual ~WebContentsView() {}
+
+ virtual void CreateView(HWND parent_hwnd,
+ const gfx::Rect& initial_bounds) = 0;
+
+ // Sets up the View that holds the rendered web page, receives messages for
+ // it and contains page plugins.
+ virtual RenderWidgetHostHWND* CreatePageView(
+ RenderViewHost* render_view_host) = 0;
+
+ // Returns the HWND that contains the contents of the tab.
+ // TODO(brettw) this should not be necessary in this cross-platform interface.
+ virtual HWND GetContainerHWND() const = 0;
+
+ // Returns the HWND with the main content of the tab (i.e. the main render
+ // view host, though there may be many popups in the tab as children of the
+ // container HWND).
+ // TODO(brettw) this should not be necessary in this cross-platform interface.
+ virtual HWND GetContentHWND() const = 0;
+
+ // Computes the rectangle for the native widget that contains the contents of
+ // the tab relative to its parent.
+ virtual void GetContainerBounds(gfx::Rect *out) const = 0;
+
+ // Helper function for GetContainerBounds. Most callers just want to know the
+ // size, and this makes it more clear.
+ gfx::Size GetContainerSize() const {
+ gfx::Rect rc;
+ GetContainerBounds(&rc);
+ return gfx::Size(rc.width(), rc.height());
+ }
+
+ // The user started dragging content of the specified type within the tab.
+ // Contextual information about the dragged content is supplied by drop_data.
+ virtual void StartDragging(const WebDropData& drop_data) = 0;
+
+ // Enumerate and 'un-parent' any plugin windows that are children of us.
+ virtual void DetachPluginWindows() = 0;
+
+ // Set/get whether or not the info bar is visible. See also the ChromeFrame
+ // method InfoBarVisibilityChanged and TabContents::IsInfoBarVisible.
+ virtual void SetInfoBarVisible(bool visible) = 0;
+ virtual bool IsInfoBarVisible() const = 0;
+
+ // Create the InfoBarView and returns it if none has been created.
+ // Just returns existing InfoBarView if it is already created.
+ virtual InfoBarView* GetInfoBarView() = 0;
+
+ // The page wants to update the mouse cursor during a drag & drop operation.
+ // |is_drop_target| is true if the mouse is over a valid drop target.
+ virtual void UpdateDragCursor(bool is_drop_target) = 0;
+
+ protected:
+ WebContentsView() {} // Abstract interface.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebContentsView);
+};
+
+#endif // CHROME_BROWSER_WEB_CONTENTS_VIEW_H_