summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 18:16:42 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 18:16:42 +0000
commitdcc0b01c43ee6a7718a405f21e6bebaa283f5967 (patch)
tree10fc667ba4b9d54c34eebdf1fa1eeae0087c71fb /chrome/browser/tab_contents
parentcb17f7f681804aeac05df6c6e5e0c644df5694d9 (diff)
downloadchromium_src-dcc0b01c43ee6a7718a405f21e6bebaa283f5967.zip
chromium_src-dcc0b01c43ee6a7718a405f21e6bebaa283f5967.tar.gz
chromium_src-dcc0b01c43ee6a7718a405f21e6bebaa283f5967.tar.bz2
Stub out web_contents_view_gtk.
Also start using the new render_widget_host_view_gtk Review URL: http://codereview.chromium.org/21119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/render_view_host_manager.cc4
-rw-r--r--chrome/browser/tab_contents/web_contents.cc8
-rw-r--r--chrome/browser/tab_contents/web_contents_view_gtk.cc151
-rw-r--r--chrome/browser/tab_contents/web_contents_view_gtk.h68
4 files changed, 227 insertions, 4 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_manager.cc b/chrome/browser/tab_contents/render_view_host_manager.cc
index c434b10..b7655a5 100644
--- a/chrome/browser/tab_contents/render_view_host_manager.cc
+++ b/chrome/browser/tab_contents/render_view_host_manager.cc
@@ -4,9 +4,9 @@
#include "chrome/browser/tab_contents/render_view_host_manager.h"
-#if defined(OS_POSIX)
+#if defined(OS_MACOSX)
#include "chrome/common/temp_scaffolding_stubs.h"
-#elif defined(OS_WIN)
+#else
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#endif
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index 17c9013..b152a28 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -47,16 +47,20 @@
#include "chrome/browser/plugin_installer.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/printing/print_job.h"
-#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/search_engines/template_url_fetcher.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
-#include "chrome/browser/tab_contents/web_contents_view.h"
#include "chrome/browser/views/hung_renderer_view.h" // TODO(brettw) delete me.
#include "chrome/common/resource_bundle.h"
#endif
#include "generated_resources.h"
+#if !defined(OS_MACOSX)
+// TODO(port): port this to mac.
+#include "chrome/browser/renderer_host/render_widget_host_view.h"
+#include "chrome/browser/tab_contents/web_contents_view.h"
+#endif
+
// Cross-Site Navigations
//
// If a WebContents is told to navigate to a different web site (as determined
diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.cc b/chrome/browser/tab_contents/web_contents_view_gtk.cc
new file mode 100644
index 0000000..c5ff575
--- /dev/null
+++ b/chrome/browser/tab_contents/web_contents_view_gtk.cc
@@ -0,0 +1,151 @@
+// Copyright (c) 2009 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.
+
+#include "chrome/browser/tab_contents/web_contents_view_gtk.h"
+
+#include "base/gfx/point.h"
+#include "base/gfx/rect.h"
+#include "chrome/browser/renderer_host/render_view_host.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
+#include "chrome/browser/tab_contents/web_contents.h"
+
+// static
+WebContentsView* WebContentsView::Create(WebContents* web_contents) {
+ return new WebContentsViewGtk(web_contents);
+}
+
+WebContentsViewGtk::WebContentsViewGtk(WebContents* web_contents)
+ : web_contents_(web_contents) {
+}
+
+WebContentsViewGtk::~WebContentsViewGtk() {
+}
+
+WebContents* WebContentsViewGtk::GetWebContents() {
+ return web_contents_;
+}
+
+void WebContentsViewGtk::CreateView() {
+ NOTIMPLEMENTED();
+}
+
+RenderWidgetHostView* WebContentsViewGtk::CreateViewForWidget(
+ RenderWidgetHost* render_widget_host) {
+ DCHECK(!render_widget_host->view());
+ RenderWidgetHostViewGtk* view =
+ new RenderWidgetHostViewGtk(render_widget_host);
+ // TODO(port): do we need to do any extra setup?
+ return view;
+}
+
+gfx::NativeView WebContentsViewGtk::GetNativeView() const {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+gfx::NativeView WebContentsViewGtk::GetContentNativeView() const {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+gfx::NativeView WebContentsViewGtk::GetTopLevelNativeView() const {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+void WebContentsViewGtk::GetContainerBounds(gfx::Rect* out) const {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::OnContentsDestroy() {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::SetPageTitle(const std::wstring& title) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::Invalidate() {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::SizeContents(const gfx::Size& size) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::FindInPage(const Browser& browser,
+ bool find_next, bool forward_direction) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::HideFindBar(bool end_session) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::ReparentFindWindow(Browser* new_browser) const {
+ NOTIMPLEMENTED();
+}
+
+bool WebContentsViewGtk::GetFindBarWindowInfo(gfx::Point* position,
+ bool* fully_visible) const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void WebContentsViewGtk::UpdateDragCursor(bool is_drop_target) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::TakeFocus(bool reverse) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::HandleKeyboardEvent(const WebKeyboardEvent& event) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::OnFindReply(int request_id,
+ int number_of_matches,
+ const gfx::Rect& selection_rect,
+ int active_match_ordinal,
+ bool final_update) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::StartDragging(const WebDropData& drop_data) {
+ NOTIMPLEMENTED();
+}
+
+WebContents* WebContentsViewGtk::CreateNewWindowInternal(
+ int route_id,
+ base::WaitableEvent* modal_dialog_event) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+RenderWidgetHostView* WebContentsViewGtk::CreateNewWidgetInternal(
+ int route_id,
+ bool activatable) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+void WebContentsViewGtk::ShowCreatedWindowInternal(
+ WebContents* new_web_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) {
+ NOTIMPLEMENTED();
+}
+
+void WebContentsViewGtk::ShowCreatedWidgetInternal(
+ RenderWidgetHostView* widget_host_view,
+ const gfx::Rect& initial_pos) {
+ NOTIMPLEMENTED();
+}
+
diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.h b/chrome/browser/tab_contents/web_contents_view_gtk.h
new file mode 100644
index 0000000..b00a520
--- /dev/null
+++ b/chrome/browser/tab_contents/web_contents_view_gtk.h
@@ -0,0 +1,68 @@
+// Copyright (c) 2009 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_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_
+#define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_
+
+#include "chrome/browser/tab_contents/web_contents_view.h"
+
+class WebContentsViewGtk : public WebContentsView {
+ public:
+ // The corresponding WebContents is passed in the constructor, and manages our
+ // lifetime. This doesn't need to be the case, but is this way currently
+ // because that's what was easiest when they were split.
+ explicit WebContentsViewGtk(WebContents* web_contents);
+ virtual ~WebContentsViewGtk();
+
+ // WebContentsView implementation --------------------------------------------
+
+ virtual WebContents* GetWebContents();
+ virtual void CreateView();
+ virtual RenderWidgetHostView* CreateViewForWidget(
+ RenderWidgetHost* render_widget_host);
+
+ virtual gfx::NativeView GetNativeView() const;
+ virtual gfx::NativeView GetContentNativeView() const;
+ virtual gfx::NativeView GetTopLevelNativeView() const;
+ virtual void GetContainerBounds(gfx::Rect* out) const;
+ virtual void OnContentsDestroy();
+ virtual void SetPageTitle(const std::wstring& title);
+ virtual void Invalidate();
+ virtual void SizeContents(const gfx::Size& size);
+ virtual void FindInPage(const Browser& browser,
+ bool find_next, bool forward_direction);
+ virtual void HideFindBar(bool end_session);
+ virtual void ReparentFindWindow(Browser* new_browser) const;
+ virtual bool GetFindBarWindowInfo(gfx::Point* position,
+ bool* fully_visible) const;
+
+ // Backend implementation of RenderViewHostDelegate::View.
+ virtual WebContents* CreateNewWindowInternal(
+ int route_id, base::WaitableEvent* modal_dialog_event);
+ virtual RenderWidgetHostView* CreateNewWidgetInternal(int route_id,
+ bool activatable);
+ virtual void ShowCreatedWindowInternal(WebContents* new_web_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture);
+ virtual void ShowCreatedWidgetInternal(RenderWidgetHostView* widget_host_view,
+ const gfx::Rect& initial_pos);
+ virtual void ShowContextMenu(const ContextMenuParams& params);
+ virtual void StartDragging(const WebDropData& drop_data);
+ virtual void UpdateDragCursor(bool is_drop_target);
+ virtual void TakeFocus(bool reverse);
+ virtual void HandleKeyboardEvent(const WebKeyboardEvent& event);
+ virtual void OnFindReply(int request_id,
+ int number_of_matches,
+ const gfx::Rect& selection_rect,
+ int active_match_ordinal,
+ bool final_update);
+ private:
+ WebContents* web_contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebContentsViewGtk);
+};
+
+#endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_
+