| 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
| 17 #include "content/browser/renderer_host/render_frame_host_impl.h" |
| 17 #include "content/browser/renderer_host/render_widget_host_impl.h" | 18 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 18 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
| 19 #include "content/common/accessibility_node_data.h" | 20 #include "content/common/accessibility_node_data.h" |
| 20 #include "content/common/drag_event_source_info.h" | 21 #include "content/common/drag_event_source_info.h" |
| 21 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/common/javascript_message_type.h" | 24 #include "content/public/common/javascript_message_type.h" |
| 24 #include "content/public/common/window_container_type.h" | 25 #include "content/public/common/window_container_type.h" |
| 25 #include "net/base/load_states.h" | 26 #include "net/base/load_states.h" |
| 26 #include "third_party/skia/include/core/SkColor.h" | 27 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 55 namespace media { | 56 namespace media { |
| 56 class MediaPlayerManager; | 57 class MediaPlayerManager; |
| 57 } | 58 } |
| 58 #endif | 59 #endif |
| 59 | 60 |
| 60 namespace content { | 61 namespace content { |
| 61 | 62 |
| 62 class ChildProcessSecurityPolicyImpl; | 63 class ChildProcessSecurityPolicyImpl; |
| 63 class PageState; | 64 class PageState; |
| 64 class PowerSaveBlocker; | 65 class PowerSaveBlocker; |
| 66 class RenderFrameHostImpl; |
| 65 class RenderViewHostObserver; | 67 class RenderViewHostObserver; |
| 66 class RenderWidgetHostDelegate; | 68 class RenderWidgetHostDelegate; |
| 67 class SessionStorageNamespace; | 69 class SessionStorageNamespace; |
| 68 class SessionStorageNamespaceImpl; | 70 class SessionStorageNamespaceImpl; |
| 69 class TestRenderViewHost; | 71 class TestRenderViewHost; |
| 70 struct ContextMenuParams; | 72 struct ContextMenuParams; |
| 71 struct FileChooserParams; | 73 struct FileChooserParams; |
| 72 struct Referrer; | 74 struct Referrer; |
| 73 struct ShowDesktopNotificationHostMsgParams; | 75 struct ShowDesktopNotificationHostMsgParams; |
| 74 | 76 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // The |session_storage_namespace| parameter allows multiple render views and | 115 // The |session_storage_namespace| parameter allows multiple render views and |
| 114 // WebContentses to share the same session storage (part of the WebStorage | 116 // WebContentses to share the same session storage (part of the WebStorage |
| 115 // spec) space. This is useful when restoring contentses, but most callers | 117 // spec) space. This is useful when restoring contentses, but most callers |
| 116 // should pass in NULL which will cause a new SessionStorageNamespace to be | 118 // should pass in NULL which will cause a new SessionStorageNamespace to be |
| 117 // created. | 119 // created. |
| 118 RenderViewHostImpl( | 120 RenderViewHostImpl( |
| 119 SiteInstance* instance, | 121 SiteInstance* instance, |
| 120 RenderViewHostDelegate* delegate, | 122 RenderViewHostDelegate* delegate, |
| 121 RenderWidgetHostDelegate* widget_delegate, | 123 RenderWidgetHostDelegate* widget_delegate, |
| 122 int routing_id, | 124 int routing_id, |
| 125 int main_frame_routing_id, |
| 123 bool swapped_out, | 126 bool swapped_out, |
| 124 SessionStorageNamespace* session_storage_namespace); | 127 SessionStorageNamespace* session_storage_namespace); |
| 125 virtual ~RenderViewHostImpl(); | 128 virtual ~RenderViewHostImpl(); |
| 126 | 129 |
| 127 // RenderViewHost implementation. | 130 // RenderViewHost implementation. |
| 128 virtual void AllowBindings(int binding_flags) OVERRIDE; | 131 virtual void AllowBindings(int binding_flags) OVERRIDE; |
| 129 virtual void ClearFocusedNode() OVERRIDE; | 132 virtual void ClearFocusedNode() OVERRIDE; |
| 130 virtual void ClosePage() OVERRIDE; | 133 virtual void ClosePage() OVERRIDE; |
| 131 virtual void CopyImageAt(int x, int y) OVERRIDE; | 134 virtual void CopyImageAt(int x, int y) OVERRIDE; |
| 132 virtual void DisassociateFromPopupCount() OVERRIDE; | 135 virtual void DisassociateFromPopupCount() OVERRIDE; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 virtual void ForwardMouseEvent( | 360 virtual void ForwardMouseEvent( |
| 358 const WebKit::WebMouseEvent& mouse_event) OVERRIDE; | 361 const WebKit::WebMouseEvent& mouse_event) OVERRIDE; |
| 359 virtual void OnPointerEventActivate() OVERRIDE; | 362 virtual void OnPointerEventActivate() OVERRIDE; |
| 360 virtual void ForwardKeyboardEvent( | 363 virtual void ForwardKeyboardEvent( |
| 361 const NativeWebKeyboardEvent& key_event) OVERRIDE; | 364 const NativeWebKeyboardEvent& key_event) OVERRIDE; |
| 362 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; | 365 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; |
| 363 | 366 |
| 364 // Creates a new RenderView with the given route id. | 367 // Creates a new RenderView with the given route id. |
| 365 void CreateNewWindow( | 368 void CreateNewWindow( |
| 366 int route_id, | 369 int route_id, |
| 370 int main_frame_route_id, |
| 367 const ViewHostMsg_CreateWindow_Params& params, | 371 const ViewHostMsg_CreateWindow_Params& params, |
| 368 SessionStorageNamespace* session_storage_namespace); | 372 SessionStorageNamespace* session_storage_namespace); |
| 369 | 373 |
| 370 // Creates a new RenderWidget with the given route id. |popup_type| indicates | 374 // Creates a new RenderWidget with the given route id. |popup_type| indicates |
| 371 // if this widget is a popup and what kind of popup it is (select, autofill). | 375 // if this widget is a popup and what kind of popup it is (select, autofill). |
| 372 void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type); | 376 void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type); |
| 373 | 377 |
| 374 // Creates a full screen RenderWidget. | 378 // Creates a full screen RenderWidget. |
| 375 void CreateNewFullscreenWidget(int route_id); | 379 void CreateNewFullscreenWidget(int route_id); |
| 376 | 380 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 void OnDomOperationResponse(const std::string& json_string, | 564 void OnDomOperationResponse(const std::string& json_string, |
| 561 int automation_id); | 565 int automation_id); |
| 562 void OnGetWindowSnapshot(const int snapshot_id); | 566 void OnGetWindowSnapshot(const int snapshot_id); |
| 563 | 567 |
| 564 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 568 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 565 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 569 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
| 566 #endif | 570 #endif |
| 567 | 571 |
| 568 private: | 572 private: |
| 569 friend class TestRenderViewHost; | 573 friend class TestRenderViewHost; |
| 574 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost); |
| 570 | 575 |
| 571 // Sets whether this RenderViewHost is swapped out in favor of another, | 576 // Sets whether this RenderViewHost is swapped out in favor of another, |
| 572 // and clears any waiting state that is no longer relevant. | 577 // and clears any waiting state that is no longer relevant. |
| 573 void SetSwappedOut(bool is_swapped_out); | 578 void SetSwappedOut(bool is_swapped_out); |
| 574 | 579 |
| 575 void ClearPowerSaveBlockers(); | 580 void ClearPowerSaveBlockers(); |
| 576 | 581 |
| 577 bool CanAccessFilesOfPageState(const PageState& state) const; | 582 bool CanAccessFilesOfPageState(const PageState& state) const; |
| 578 | 583 |
| 584 // This is an RenderFrameHost object associated with the top-level frame in |
| 585 // the page rendered by this RenderViewHost. |
| 586 // TODO(nasko): Remove this pointer once we have enough infrastructure to |
| 587 // move this to the top-level FrameTreeNode. |
| 588 scoped_ptr<RenderFrameHostImpl> main_render_frame_host_; |
| 589 |
| 579 // Our delegate, which wants to know about changes in the RenderView. | 590 // Our delegate, which wants to know about changes in the RenderView. |
| 580 RenderViewHostDelegate* delegate_; | 591 RenderViewHostDelegate* delegate_; |
| 581 | 592 |
| 582 // The SiteInstance associated with this RenderViewHost. All pages drawn | 593 // The SiteInstance associated with this RenderViewHost. All pages drawn |
| 583 // in this RenderViewHost are part of this SiteInstance. Should not change | 594 // in this RenderViewHost are part of this SiteInstance. Should not change |
| 584 // over time. | 595 // over time. |
| 585 scoped_refptr<SiteInstanceImpl> instance_; | 596 scoped_refptr<SiteInstanceImpl> instance_; |
| 586 | 597 |
| 587 // true if we are currently waiting for a response for drag context | 598 // true if we are currently waiting for a response for drag context |
| 588 // information. | 599 // information. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 708 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
| 698 }; | 709 }; |
| 699 | 710 |
| 700 #if defined(COMPILER_MSVC) | 711 #if defined(COMPILER_MSVC) |
| 701 #pragma warning(pop) | 712 #pragma warning(pop) |
| 702 #endif | 713 #endif |
| 703 | 714 |
| 704 } // namespace content | 715 } // namespace content |
| 705 | 716 |
| 706 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 717 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
| OLD | NEW |