diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-26 23:19:03 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-26 23:19:03 +0000 |
commit | 1136a60c7d8e06859369f906e2581648e93e967e (patch) | |
tree | 6a029b3d4fc3b5ad095ba3d74d4c610fd3603d48 /chrome/browser/renderer_host | |
parent | fc331b1dce8781192f8c89cfc8629b6c5b82c47a (diff) | |
download | chromium_src-1136a60c7d8e06859369f906e2581648e93e967e.zip chromium_src-1136a60c7d8e06859369f906e2581648e93e967e.tar.gz chromium_src-1136a60c7d8e06859369f906e2581648e93e967e.tar.bz2 |
Make render_view_host compile on Mac & Linux, add to the build.
Review URL: http://codereview.chromium.org/18600
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
5 files changed, 37 insertions, 20 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index adfebaa..1c724e2 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -22,7 +22,6 @@ #include "chrome/browser/renderer_host/renderer_security_policy.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/site_instance.h" -#include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/thumbnail_score.h" #include "net/base/net_util.h" @@ -78,12 +77,13 @@ RenderViewHost::RenderViewHost(SiteInstance* instance, base::WaitableEvent* modal_dialog_event) : RenderWidgetHost(instance->GetProcess(), routing_id), instance_(instance), - enable_dom_ui_bindings_(false), - enable_external_host_bindings_(false), delegate_(delegate), renderer_initialized_(false), waiting_for_drag_context_response_(false), debugger_attached_(false), + enable_dom_ui_bindings_(false), + pending_request_id_(-1), + enable_external_host_bindings_(false), modal_dialog_count_(0), navigations_suspended_(false), suspended_nav_message_(NULL), @@ -129,6 +129,7 @@ bool RenderViewHost::CreateRenderView() { renderer_initialized_ = true; +#if defined(OS_WIN) HANDLE modal_dialog_event; HANDLE renderer_process_handle = process()->process().handle(); if (renderer_process_handle == NULL) @@ -148,6 +149,9 @@ bool RenderViewHost::CreateRenderView() { modal_dialog_event, delegate_->GetWebkitPrefs(), routing_id())); +#elif defined(OS_POSIX) + Send(new ViewMsg_New(delegate_->GetWebkitPrefs(), routing_id())); +#endif // Set the alternate error page, which is profile specific, in the renderer. GURL url = delegate_->GetAlternateErrorPageURL(); @@ -750,12 +754,21 @@ void RenderViewHost::Shutdown() { RenderWidgetHost::Shutdown(); } -void RenderViewHost::OnMsgCreateWindow(int route_id, - HANDLE modal_dialog_event) { +void RenderViewHost::OnMsgCreateWindow( + int route_id, + ModalDialogEvent modal_dialog_event) { RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); - if (view) + if (view) { +#if defined(OS_WIN) view->CreateNewWindow(route_id, new base::WaitableEvent(modal_dialog_event)); +#else + // TODO(port) this isn't correct, since we just make up an event won't ever + // be set by the renderer. + view->CreateNewWindow(route_id, + new base::WaitableEvent(true, false)); + } +#endif } void RenderViewHost::OnMsgCreateWidget(int route_id, bool activatable) { @@ -1070,7 +1083,6 @@ void RenderViewHost::OnMsgRunJavaScriptMessage( StopHangMonitorTimeout(); if (modal_dialog_count_++ == 0) modal_dialog_event_->Signal(); - bool did_suppress_message = false; delegate_->RunJavaScriptMessage(message, default_prompt, flags, reply_msg, &are_javascript_messages_suppressed_); } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index f4c40ed..36ec1d1 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -12,9 +12,11 @@ #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/browser/renderer_host/render_widget_host.h" #include "chrome/common/page_zoom.h" +#include "chrome/common/render_messages.h" #ifdef CHROME_PERSONALIZATION #include "chrome/personalization/personalization.h" #endif +#include "net/base/load_states.h" #include "webkit/glue/password_form_dom_manager.h" #include "webkit/glue/autofill_form.h" @@ -41,10 +43,6 @@ namespace gfx { class Point; } -namespace net { -enum LoadState; -} - namespace webkit_glue { struct WebApplicationInfo; } @@ -416,7 +414,7 @@ class RenderViewHost : public RenderWidgetHost { virtual void NotifyRendererResponsive(); // IPC message handlers. - void OnMsgCreateWindow(int route_id, HANDLE modal_dialog_event); + void OnMsgCreateWindow(int route_id, ModalDialogEvent modal_dialog_event); void OnMsgCreateWidget(int route_id, bool activatable); void OnMsgShowView(int route_id, WindowOpenDisposition disposition, diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 764e8ca..5a39b91 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -11,6 +11,7 @@ #include "base/basictypes.h" #include "chrome/browser/autofill_manager.h" #include "chrome/common/render_messages.h" +#include "net/base/load_states.h" #include "webkit/glue/webpreferences.h" class NavigationEntry; @@ -34,10 +35,6 @@ namespace gfx { class Rect; } -namespace net { -enum LoadState; -} - // // RenderViewHostDelegate // diff --git a/chrome/browser/renderer_host/render_widget_helper.cc b/chrome/browser/renderer_host/render_widget_helper.cc index d92ff301..274d25f 100644 --- a/chrome/browser/renderer_host/render_widget_helper.cc +++ b/chrome/browser/renderer_host/render_widget_helper.cc @@ -204,7 +204,8 @@ void RenderWidgetHelper::CreateNewWindow(int opener_id, *route_id = GetNextRoutingID(); #if defined(OS_WIN) - HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL); + ModalDialogEvent event; + event.event = CreateEvent(NULL, TRUE, FALSE, NULL); BOOL result = DuplicateHandle(GetCurrentProcess(), event, render_process, diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 70d6cf5..2e769ec 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -5,14 +5,19 @@ #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ -#include <windows.h> - #include <vector> #include "base/gfx/size.h" #include "base/timer.h" +#include "build/build_config.h" #include "chrome/common/ipc_channel.h" +#if defined(OS_WIN) +// TODO(port) when the bitmaps below use a cross-platform representation this +// can be removed. +#include <windows.h> +#endif + namespace gfx { class Rect; } @@ -255,6 +260,9 @@ class RenderWidgetHost : public IPC::Channel::Listener { void OnMsgImeUpdateStatus(ViewHostMsg_ImeControl control, const gfx::Rect& caret_rect); +#if defined(OS_WIN) + // TODO(port) use a cross-platform representation of the bitmap. + // Paints the given bitmap to the current backing store at the given location. void PaintBackingStoreRect(HANDLE bitmap, const gfx::Rect& bitmap_rect, @@ -268,7 +276,8 @@ class RenderWidgetHost : public IPC::Channel::Listener { int dx, int dy, const gfx::Rect& clip_rect, const gfx::Size& view_size); - +#endif + // The View associated with the RenderViewHost. The lifetime of this object // is associated with the lifetime of the Render process. If the Renderer // crashes, its View is destroyed and this pointer becomes NULL, even though |