| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_RENDER_VIEW_HOST_H__ | 5 #ifndef CHROME_BROWSER_RENDER_VIEW_HOST_H__ |
| 6 #define CHROME_BROWSER_RENDER_VIEW_HOST_H__ | 6 #define CHROME_BROWSER_RENDER_VIEW_HOST_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/scoped_handle.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/render_view_host_delegate.h" | 12 #include "chrome/browser/render_view_host_delegate.h" |
| 13 #include "chrome/browser/render_widget_host.h" | 13 #include "chrome/browser/render_widget_host.h" |
| 14 #include "chrome/common/page_zoom.h" | 14 #include "chrome/common/page_zoom.h" |
| 15 #ifdef CHROME_PERSONALIZATION | 15 #ifdef CHROME_PERSONALIZATION |
| 16 #include "chrome/personalization/personalization.h" | 16 #include "chrome/personalization/personalization.h" |
| 17 #endif | 17 #endif |
| 18 #include "webkit/glue/password_form_dom_manager.h" | 18 #include "webkit/glue/password_form_dom_manager.h" |
| 19 #include "webkit/glue/autofill_form.h" | 19 #include "webkit/glue/autofill_form.h" |
| 20 | 20 |
| 21 enum ConsoleMessageLevel; | 21 enum ConsoleMessageLevel; |
| 22 class NavigationEntry; | 22 class NavigationEntry; |
| 23 class RenderViewHostDelegate; | 23 class RenderViewHostDelegate; |
| 24 class SiteInstance; | 24 class SiteInstance; |
| 25 class SkBitmap; | 25 class SkBitmap; |
| 26 struct ViewHostMsg_ContextMenu_Params; | 26 struct ViewHostMsg_ContextMenu_Params; |
| 27 struct ViewHostMsg_DidPrintPage_Params; | 27 struct ViewHostMsg_DidPrintPage_Params; |
| 28 class ViewMsg_Navigate; | 28 class ViewMsg_Navigate; |
| 29 struct ViewMsg_Navigate_Params; | 29 struct ViewMsg_Navigate_Params; |
| 30 struct ViewMsg_Print_Params; | 30 struct ViewMsg_Print_Params; |
| 31 struct ViewMsg_PrintPages_Params; | 31 struct ViewMsg_PrintPages_Params; |
| 32 struct WebDropData; | 32 struct WebDropData; |
| 33 struct WebPreferences; | 33 struct WebPreferences; |
| 34 enum WindowOpenDisposition; | 34 enum WindowOpenDisposition; |
| 35 | 35 |
| 36 namespace base { |
| 37 class WaitableEvent; |
| 38 } |
| 39 |
| 36 namespace gfx { | 40 namespace gfx { |
| 37 class Point; | 41 class Point; |
| 38 } | 42 } |
| 39 | 43 |
| 40 namespace net { | 44 namespace net { |
| 41 enum LoadState; | 45 enum LoadState; |
| 42 } | 46 } |
| 43 | 47 |
| 44 namespace webkit_glue { | 48 namespace webkit_glue { |
| 45 struct WebApplicationInfo; | 49 struct WebApplicationInfo; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 83 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
| 80 | 84 |
| 81 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in | 85 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in |
| 82 // which case RenderWidgetHost will create a new one. modal_dialog_event is | 86 // which case RenderWidgetHost will create a new one. modal_dialog_event is |
| 83 // the event that's set when showing a modal dialog so that the renderer and | 87 // the event that's set when showing a modal dialog so that the renderer and |
| 84 // plugin processes know to pump messages. An existing event can be passed | 88 // plugin processes know to pump messages. An existing event can be passed |
| 85 // in, otherwise if it's NULL a new event will be created. | 89 // in, otherwise if it's NULL a new event will be created. |
| 86 explicit RenderViewHost(SiteInstance* instance, | 90 explicit RenderViewHost(SiteInstance* instance, |
| 87 RenderViewHostDelegate* delegate, | 91 RenderViewHostDelegate* delegate, |
| 88 int routing_id, | 92 int routing_id, |
| 89 HANDLE modal_dialog_event); | 93 base::WaitableEvent* modal_dialog_event); |
| 90 virtual ~RenderViewHost(); | 94 virtual ~RenderViewHost(); |
| 91 | 95 |
| 92 SiteInstance* site_instance() const { return instance_; } | 96 SiteInstance* site_instance() const { return instance_; } |
| 93 RenderViewHostDelegate* delegate() const { return delegate_; } | 97 RenderViewHostDelegate* delegate() const { return delegate_; } |
| 94 | 98 |
| 95 // Set up the RenderView child process. | 99 // Set up the RenderView child process. |
| 96 virtual bool CreateRenderView(); | 100 virtual bool CreateRenderView(); |
| 97 // Returns true if the RenderView is active and has not crashed. | 101 // Returns true if the RenderView is active and has not crashed. |
| 98 virtual bool IsRenderViewLive() const; | 102 virtual bool IsRenderViewLive() const; |
| 99 // Create a new RenderViewHost but recycle an existing RenderView child | 103 // Create a new RenderViewHost but recycle an existing RenderView child |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 // and thus started the unload process. | 575 // and thus started the unload process. |
| 572 int pending_request_id_; | 576 int pending_request_id_; |
| 573 | 577 |
| 574 // True if javascript access to the external host (through | 578 // True if javascript access to the external host (through |
| 575 // automation) is allowed. | 579 // automation) is allowed. |
| 576 bool enable_external_host_bindings_; | 580 bool enable_external_host_bindings_; |
| 577 | 581 |
| 578 // Handle to an event that's set when the page is showing a modal dialog box | 582 // Handle to an event that's set when the page is showing a modal dialog box |
| 579 // (or equivalent constrained window). The renderer and plugin processes | 583 // (or equivalent constrained window). The renderer and plugin processes |
| 580 // check this to know if they should pump messages/tasks then. | 584 // check this to know if they should pump messages/tasks then. |
| 581 ScopedHandle modal_dialog_event_; | 585 scoped_ptr<base::WaitableEvent> modal_dialog_event_; |
| 582 | 586 |
| 583 // Multiple dialog boxes can be shown before the first one is finished, | 587 // Multiple dialog boxes can be shown before the first one is finished, |
| 584 // so we keep a counter to know when we can reset the modal dialog event. | 588 // so we keep a counter to know when we can reset the modal dialog event. |
| 585 int modal_dialog_count_; | 589 int modal_dialog_count_; |
| 586 | 590 |
| 587 // Whether we should buffer outgoing Navigate messages rather than sending | 591 // Whether we should buffer outgoing Navigate messages rather than sending |
| 588 // them. This will be true when a RenderViewHost is created for a cross-site | 592 // them. This will be true when a RenderViewHost is created for a cross-site |
| 589 // request, until we hear back from the onbeforeunload handler of the old | 593 // request, until we hear back from the onbeforeunload handler of the old |
| 590 // RenderViewHost. | 594 // RenderViewHost. |
| 591 bool navigations_suspended_; | 595 bool navigations_suspended_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 611 | 615 |
| 612 // Factory for creating RenderViewHosts. Useful for unit tests. | 616 // Factory for creating RenderViewHosts. Useful for unit tests. |
| 613 class RenderViewHostFactory { | 617 class RenderViewHostFactory { |
| 614 public: | 618 public: |
| 615 virtual ~RenderViewHostFactory() {} | 619 virtual ~RenderViewHostFactory() {} |
| 616 | 620 |
| 617 virtual RenderViewHost* CreateRenderViewHost( | 621 virtual RenderViewHost* CreateRenderViewHost( |
| 618 SiteInstance* instance, | 622 SiteInstance* instance, |
| 619 RenderViewHostDelegate* delegate, | 623 RenderViewHostDelegate* delegate, |
| 620 int routing_id, | 624 int routing_id, |
| 621 HANDLE modal_dialog_event) = 0; | 625 base::WaitableEvent* modal_dialog_event) = 0; |
| 622 }; | 626 }; |
| 623 | 627 |
| 624 #endif // CHROME_BROWSER_RENDER_VIEW_HOST_H__ | 628 #endif // CHROME_BROWSER_RENDER_VIEW_HOST_H__ |
| OLD | NEW |