| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // pure virtual methods that only have a single implementation in the | 95 // pure virtual methods that only have a single implementation in the |
| 96 // hierarchy above this class, and is safe to ignore in this case. | 96 // hierarchy above this class, and is safe to ignore in this case. |
| 97 #pragma warning(push) | 97 #pragma warning(push) |
| 98 #pragma warning(disable: 4250) | 98 #pragma warning(disable: 4250) |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 // This implements the RenderViewHost interface that is exposed to | 101 // This implements the RenderViewHost interface that is exposed to |
| 102 // embedders of content, and adds things only visible to content. | 102 // embedders of content, and adds things only visible to content. |
| 103 // | 103 // |
| 104 // The exact API of this object needs to be more thoroughly designed. Right | 104 // The exact API of this object needs to be more thoroughly designed. Right |
| 105 // now it mimics what TabContents exposed, which is a fairly large API and may | 105 // now it mimics what WebContentsImpl exposed, which is a fairly large API and |
| 106 // contain things that are not relevant to a common subset of views. See also | 106 // may contain things that are not relevant to a common subset of views. See |
| 107 // the comment in render_view_host_delegate.h about the size and scope of the | 107 // also the comment in render_view_host_delegate.h about the size and scope of |
| 108 // delegate API. | 108 // the delegate API. |
| 109 // | 109 // |
| 110 // Right now, the concept of page navigation (both top level and frame) exists | 110 // Right now, the concept of page navigation (both top level and frame) exists |
| 111 // in the TabContents still, so if you instantiate one of these elsewhere, you | 111 // in the WebContentsImpl still, so if you instantiate one of these elsewhere, |
| 112 // will not be able to traverse pages back and forward. We need to determine | 112 // you will not be able to traverse pages back and forward. We need to determine |
| 113 // if we want to bring that and other functionality down into this object so | 113 // if we want to bring that and other functionality down into this object so it |
| 114 // it can be shared by others. | 114 // can be shared by others. |
| 115 class CONTENT_EXPORT RenderViewHostImpl | 115 class CONTENT_EXPORT RenderViewHostImpl |
| 116 : public RenderViewHost, | 116 : public RenderViewHost, |
| 117 public RenderWidgetHostImpl { | 117 public RenderWidgetHostImpl { |
| 118 public: | 118 public: |
| 119 // Convenience function, just like RenderViewHost::FromID. | 119 // Convenience function, just like RenderViewHost::FromID. |
| 120 static RenderViewHostImpl* FromID(int render_process_id, int render_view_id); | 120 static RenderViewHostImpl* FromID(int render_process_id, int render_view_id); |
| 121 | 121 |
| 122 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in | 122 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in |
| 123 // which case RenderWidgetHost will create a new one. | 123 // which case RenderWidgetHost will create a new one. |
| 124 // | 124 // |
| 125 // The session storage namespace parameter allows multiple render views and | 125 // The session storage namespace parameter allows multiple render views and |
| 126 // tab contentses to share the same session storage (part of the WebStorage | 126 // WebContentses to share the same session storage (part of the WebStorage |
| 127 // spec) space. This is useful when restoring tabs, but most callers should | 127 // spec) space. This is useful when restoring contentses, but most callers |
| 128 // pass in NULL which will cause a new SessionStorageNamespace to be created. | 128 // should pass in NULL which will cause a new SessionStorageNamespace to be |
| 129 // created. |
| 129 RenderViewHostImpl( | 130 RenderViewHostImpl( |
| 130 SiteInstance* instance, | 131 SiteInstance* instance, |
| 131 RenderViewHostDelegate* delegate, | 132 RenderViewHostDelegate* delegate, |
| 132 int routing_id, | 133 int routing_id, |
| 133 SessionStorageNamespace* session_storage_namespace); | 134 SessionStorageNamespace* session_storage_namespace); |
| 134 virtual ~RenderViewHostImpl(); | 135 virtual ~RenderViewHostImpl(); |
| 135 | 136 |
| 136 // RenderViewHost implementation. | 137 // RenderViewHost implementation. |
| 137 virtual void AllowBindings(int binding_flags) OVERRIDE; | 138 virtual void AllowBindings(int binding_flags) OVERRIDE; |
| 138 virtual void ClearFocusedNode() OVERRIDE; | 139 virtual void ClearFocusedNode() OVERRIDE; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 // and thus started the unload process. | 552 // and thus started the unload process. |
| 552 int pending_request_id_; | 553 int pending_request_id_; |
| 553 | 554 |
| 554 // Whether we should buffer outgoing Navigate messages rather than sending | 555 // Whether we should buffer outgoing Navigate messages rather than sending |
| 555 // them. This will be true when a RenderViewHost is created for a cross-site | 556 // them. This will be true when a RenderViewHost is created for a cross-site |
| 556 // request, until we hear back from the onbeforeunload handler of the old | 557 // request, until we hear back from the onbeforeunload handler of the old |
| 557 // RenderViewHost. | 558 // RenderViewHost. |
| 558 bool navigations_suspended_; | 559 bool navigations_suspended_; |
| 559 | 560 |
| 560 // We only buffer a suspended navigation message while we a pending RVH for a | 561 // We only buffer a suspended navigation message while we a pending RVH for a |
| 561 // TabContents. There will only ever be one suspended navigation, because | 562 // WebContentsImpl. There will only ever be one suspended navigation, because |
| 562 // TabContents will destroy the pending RVH and create a new one if a second | 563 // WebContentsImpl will destroy the pending RVH and create a new one if a |
| 563 // navigation occurs. | 564 // second navigation occurs. |
| 564 scoped_ptr<ViewMsg_Navigate> suspended_nav_message_; | 565 scoped_ptr<ViewMsg_Navigate> suspended_nav_message_; |
| 565 | 566 |
| 566 // Whether this RenderViewHost is currently swapped out, such that the view is | 567 // Whether this RenderViewHost is currently swapped out, such that the view is |
| 567 // being rendered by another process. | 568 // being rendered by another process. |
| 568 bool is_swapped_out_; | 569 bool is_swapped_out_; |
| 569 | 570 |
| 570 // If we were asked to RunModal, then this will hold the reply_msg that we | 571 // If we were asked to RunModal, then this will hold the reply_msg that we |
| 571 // must return to the renderer to unblock it. | 572 // must return to the renderer to unblock it. |
| 572 IPC::Message* run_modal_reply_msg_; | 573 IPC::Message* run_modal_reply_msg_; |
| 573 | 574 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 624 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
| 624 }; | 625 }; |
| 625 | 626 |
| 626 #if defined(COMPILER_MSVC) | 627 #if defined(COMPILER_MSVC) |
| 627 #pragma warning(pop) | 628 #pragma warning(pop) |
| 628 #endif | 629 #endif |
| 629 | 630 |
| 630 } // namespace content | 631 } // namespace content |
| 631 | 632 |
| 632 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 633 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| OLD | NEW |