| 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_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 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 "base/values.h" | 17 #include "base/values.h" |
| 18 #include "content/browser/renderer_host/render_widget_host.h" | 18 #include "content/browser/renderer_host/render_widget_host.h" |
| 19 #include "content/browser/site_instance_impl.h" |
| 19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/common/stop_find_action.h" | 22 #include "content/public/common/stop_find_action.h" |
| 22 #include "content/public/common/window_container_type.h" | 23 #include "content/public/common/window_container_type.h" |
| 23 #include "net/base/load_states.h" | 24 #include "net/base/load_states.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 28 #include "ui/base/javascript_message_type.h" | 29 #include "ui/base/javascript_message_type.h" |
| 29 #include "webkit/glue/webaccessibility.h" | 30 #include "webkit/glue/webaccessibility.h" |
| 30 #include "webkit/glue/window_open_disposition.h" | 31 #include "webkit/glue/window_open_disposition.h" |
| 31 | 32 |
| 32 class ChildProcessSecurityPolicy; | 33 class ChildProcessSecurityPolicy; |
| 33 class FilePath; | 34 class FilePath; |
| 34 class GURL; | 35 class GURL; |
| 35 class PowerSaveBlocker; | 36 class PowerSaveBlocker; |
| 36 class SessionStorageNamespace; | 37 class SessionStorageNamespace; |
| 37 class SiteInstance; | |
| 38 class SkBitmap; | 38 class SkBitmap; |
| 39 class ViewMsg_Navigate; | 39 class ViewMsg_Navigate; |
| 40 struct ContextMenuParams; | 40 struct ContextMenuParams; |
| 41 struct MediaPlayerAction; | 41 struct MediaPlayerAction; |
| 42 struct ViewHostMsg_AccessibilityNotification_Params; | 42 struct ViewHostMsg_AccessibilityNotification_Params; |
| 43 struct ViewHostMsg_CreateWindow_Params; | 43 struct ViewHostMsg_CreateWindow_Params; |
| 44 struct ViewHostMsg_ShowPopup_Params; | 44 struct ViewHostMsg_ShowPopup_Params; |
| 45 struct ViewMsg_Navigate_Params; | 45 struct ViewMsg_Navigate_Params; |
| 46 struct ViewMsg_StopFinding_Params; | 46 struct ViewMsg_StopFinding_Params; |
| 47 struct WebDropData; | 47 struct WebDropData; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Returns NULL if the IDs do not correspond to a live RenderViewHost. | 132 // Returns NULL if the IDs do not correspond to a live RenderViewHost. |
| 133 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 133 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
| 134 | 134 |
| 135 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in | 135 // routing_id could be a valid route id, or it could be MSG_ROUTING_NONE, in |
| 136 // which case RenderWidgetHost will create a new one. | 136 // which case RenderWidgetHost will create a new one. |
| 137 // | 137 // |
| 138 // The session storage namespace parameter allows multiple render views and | 138 // The session storage namespace parameter allows multiple render views and |
| 139 // tab contentses to share the same session storage (part of the WebStorage | 139 // tab contentses to share the same session storage (part of the WebStorage |
| 140 // spec) space. This is useful when restoring tabs, but most callers should | 140 // spec) space. This is useful when restoring tabs, but most callers should |
| 141 // pass in NULL which will cause a new SessionStorageNamespace to be created. | 141 // pass in NULL which will cause a new SessionStorageNamespace to be created. |
| 142 RenderViewHost(SiteInstance* instance, | 142 RenderViewHost(content::SiteInstance* instance, |
| 143 content::RenderViewHostDelegate* delegate, | 143 content::RenderViewHostDelegate* delegate, |
| 144 int routing_id, | 144 int routing_id, |
| 145 SessionStorageNamespace* session_storage_namespace); | 145 SessionStorageNamespace* session_storage_namespace); |
| 146 virtual ~RenderViewHost(); | 146 virtual ~RenderViewHost(); |
| 147 | 147 |
| 148 SiteInstance* site_instance() const { return instance_; } | 148 content::SiteInstance* site_instance() const { return instance_; } |
| 149 content::RenderViewHostDelegate* delegate() const { return delegate_; } | 149 content::RenderViewHostDelegate* delegate() const { return delegate_; } |
| 150 void set_delegate(content::RenderViewHostDelegate* d) { | 150 void set_delegate(content::RenderViewHostDelegate* d) { |
| 151 CHECK(d); // http://crbug.com/82827 | 151 CHECK(d); // http://crbug.com/82827 |
| 152 delegate_ = d; | 152 delegate_ = d; |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Set up the RenderView child process. Virtual because it is overridden by | 155 // Set up the RenderView child process. Virtual because it is overridden by |
| 156 // TestRenderViewHost. If the |frame_name| parameter is non-empty, it is used | 156 // TestRenderViewHost. If the |frame_name| parameter is non-empty, it is used |
| 157 // as the name of the new top-level frame. If |max_page_id| is larger than | 157 // as the name of the new top-level frame. If |max_page_id| is larger than |
| 158 // -1, the RenderView is told to start issuing page IDs at |max_page_id| + 1. | 158 // -1, the RenderView is told to start issuing page IDs at |max_page_id| + 1. |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 #endif | 605 #endif |
| 606 | 606 |
| 607 private: | 607 private: |
| 608 friend class TestRenderViewHost; | 608 friend class TestRenderViewHost; |
| 609 | 609 |
| 610 void ClearPowerSaveBlockers(); | 610 void ClearPowerSaveBlockers(); |
| 611 | 611 |
| 612 // The SiteInstance associated with this RenderViewHost. All pages drawn | 612 // The SiteInstance associated with this RenderViewHost. All pages drawn |
| 613 // in this RenderViewHost are part of this SiteInstance. Should not change | 613 // in this RenderViewHost are part of this SiteInstance. Should not change |
| 614 // over time. | 614 // over time. |
| 615 scoped_refptr<SiteInstance> instance_; | 615 scoped_refptr<SiteInstanceImpl> instance_; |
| 616 | 616 |
| 617 // Our delegate, which wants to know about changes in the RenderView. | 617 // Our delegate, which wants to know about changes in the RenderView. |
| 618 content::RenderViewHostDelegate* delegate_; | 618 content::RenderViewHostDelegate* delegate_; |
| 619 | 619 |
| 620 // true if we are currently waiting for a response for drag context | 620 // true if we are currently waiting for a response for drag context |
| 621 // information. | 621 // information. |
| 622 bool waiting_for_drag_context_response_; | 622 bool waiting_for_drag_context_response_; |
| 623 | 623 |
| 624 // A bitwise OR of bindings types that have been enabled for this RenderView. | 624 // A bitwise OR of bindings types that have been enabled for this RenderView. |
| 625 // See BindingsPolicy for details. | 625 // See BindingsPolicy for details. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 typedef std::map<int64, PowerSaveBlocker*> PowerSaveBlockerMap; | 691 typedef std::map<int64, PowerSaveBlocker*> PowerSaveBlockerMap; |
| 692 PowerSaveBlockerMap power_save_blockers_; | 692 PowerSaveBlockerMap power_save_blockers_; |
| 693 | 693 |
| 694 // A list of observers that filter messages. Weak references. | 694 // A list of observers that filter messages. Weak references. |
| 695 ObserverList<content::RenderViewHostObserver> observers_; | 695 ObserverList<content::RenderViewHostObserver> observers_; |
| 696 | 696 |
| 697 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 697 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
| 698 }; | 698 }; |
| 699 | 699 |
| 700 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 700 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |