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> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // should pass in NULL which will cause a new SessionStorageNamespace to be | 103 // should pass in NULL which will cause a new SessionStorageNamespace to be |
104 // created. | 104 // created. |
105 RenderViewHostImpl(SiteInstance* instance, | 105 RenderViewHostImpl(SiteInstance* instance, |
106 RenderViewHostDelegate* delegate, | 106 RenderViewHostDelegate* delegate, |
107 RenderWidgetHostDelegate* widget_delegate, | 107 RenderWidgetHostDelegate* widget_delegate, |
108 int routing_id, | 108 int routing_id, |
109 int main_frame_routing_id, | 109 int main_frame_routing_id, |
110 bool swapped_out, | 110 bool swapped_out, |
111 bool hidden, | 111 bool hidden, |
112 bool has_initialized_audio_host); | 112 bool has_initialized_audio_host); |
113 virtual ~RenderViewHostImpl(); | 113 ~RenderViewHostImpl() override; |
114 | 114 |
115 // RenderViewHost implementation. | 115 // RenderViewHost implementation. |
116 virtual RenderFrameHost* GetMainFrame() override; | 116 RenderFrameHost* GetMainFrame() override; |
117 virtual void AllowBindings(int binding_flags) override; | 117 void AllowBindings(int binding_flags) override; |
118 virtual void ClearFocusedElement() override; | 118 void ClearFocusedElement() override; |
119 virtual bool IsFocusedElementEditable() override; | 119 bool IsFocusedElementEditable() override; |
120 virtual void ClosePage() override; | 120 void ClosePage() override; |
121 virtual void CopyImageAt(int x, int y) override; | 121 void CopyImageAt(int x, int y) override; |
122 virtual void SaveImageAt(int x, int y) override; | 122 void SaveImageAt(int x, int y) override; |
123 virtual void DirectoryEnumerationFinished( | 123 void DirectoryEnumerationFinished( |
124 int request_id, | 124 int request_id, |
125 const std::vector<base::FilePath>& files) override; | 125 const std::vector<base::FilePath>& files) override; |
126 virtual void DisableScrollbarsForThreshold(const gfx::Size& size) override; | 126 void DisableScrollbarsForThreshold(const gfx::Size& size) override; |
127 virtual void DragSourceEndedAt( | 127 void DragSourceEndedAt(int client_x, |
128 int client_x, int client_y, int screen_x, int screen_y, | 128 int client_y, |
129 blink::WebDragOperation operation) override; | 129 int screen_x, |
130 virtual void DragSourceSystemDragEnded() override; | 130 int screen_y, |
131 virtual void DragTargetDragEnter( | 131 blink::WebDragOperation operation) override; |
132 const DropData& drop_data, | 132 void DragSourceSystemDragEnded() override; |
133 const gfx::Point& client_pt, | 133 void DragTargetDragEnter(const DropData& drop_data, |
134 const gfx::Point& screen_pt, | 134 const gfx::Point& client_pt, |
135 blink::WebDragOperationsMask operations_allowed, | 135 const gfx::Point& screen_pt, |
136 int key_modifiers) override; | 136 blink::WebDragOperationsMask operations_allowed, |
137 virtual void DragTargetDragOver( | 137 int key_modifiers) override; |
138 const gfx::Point& client_pt, | 138 void DragTargetDragOver(const gfx::Point& client_pt, |
139 const gfx::Point& screen_pt, | 139 const gfx::Point& screen_pt, |
140 blink::WebDragOperationsMask operations_allowed, | 140 blink::WebDragOperationsMask operations_allowed, |
141 int key_modifiers) override; | 141 int key_modifiers) override; |
142 virtual void DragTargetDragLeave() override; | 142 void DragTargetDragLeave() override; |
143 virtual void DragTargetDrop(const gfx::Point& client_pt, | 143 void DragTargetDrop(const gfx::Point& client_pt, |
144 const gfx::Point& screen_pt, | 144 const gfx::Point& screen_pt, |
145 int key_modifiers) override; | 145 int key_modifiers) override; |
146 virtual void EnableAutoResize(const gfx::Size& min_size, | 146 void EnableAutoResize(const gfx::Size& min_size, |
147 const gfx::Size& max_size) override; | 147 const gfx::Size& max_size) override; |
148 virtual void DisableAutoResize(const gfx::Size& new_size) override; | 148 void DisableAutoResize(const gfx::Size& new_size) override; |
149 virtual void EnablePreferredSizeMode() override; | 149 void EnablePreferredSizeMode() override; |
150 virtual void ExecuteMediaPlayerActionAtLocation( | 150 void ExecuteMediaPlayerActionAtLocation( |
151 const gfx::Point& location, | 151 const gfx::Point& location, |
152 const blink::WebMediaPlayerAction& action) override; | 152 const blink::WebMediaPlayerAction& action) override; |
153 virtual void ExecutePluginActionAtLocation( | 153 void ExecutePluginActionAtLocation( |
154 const gfx::Point& location, | 154 const gfx::Point& location, |
155 const blink::WebPluginAction& action) override; | 155 const blink::WebPluginAction& action) override; |
156 virtual void ExitFullscreen() override; | 156 void ExitFullscreen() override; |
157 virtual void FilesSelectedInChooser( | 157 void FilesSelectedInChooser( |
158 const std::vector<content::FileChooserFileInfo>& files, | 158 const std::vector<content::FileChooserFileInfo>& files, |
159 FileChooserParams::Mode permissions) override; | 159 FileChooserParams::Mode permissions) override; |
160 virtual RenderViewHostDelegate* GetDelegate() const override; | 160 RenderViewHostDelegate* GetDelegate() const override; |
161 virtual int GetEnabledBindings() const override; | 161 int GetEnabledBindings() const override; |
162 virtual SiteInstanceImpl* GetSiteInstance() const override; | 162 SiteInstanceImpl* GetSiteInstance() const override; |
163 virtual bool IsRenderViewLive() const override; | 163 bool IsRenderViewLive() const override; |
164 virtual void NotifyMoveOrResizeStarted() override; | 164 void NotifyMoveOrResizeStarted() override; |
165 virtual void SetWebUIProperty(const std::string& name, | 165 void SetWebUIProperty(const std::string& name, |
166 const std::string& value) override; | 166 const std::string& value) override; |
167 virtual void Zoom(PageZoom zoom) override; | 167 void Zoom(PageZoom zoom) override; |
168 virtual void SyncRendererPrefs() override; | 168 void SyncRendererPrefs() override; |
169 virtual WebPreferences GetWebkitPreferences() override; | 169 WebPreferences GetWebkitPreferences() override; |
170 virtual void UpdateWebkitPreferences( | 170 void UpdateWebkitPreferences(const WebPreferences& prefs) override; |
171 const WebPreferences& prefs) override; | 171 void OnWebkitPreferencesChanged() override; |
172 virtual void OnWebkitPreferencesChanged() override; | 172 void GetAudioOutputControllers( |
173 virtual void GetAudioOutputControllers( | |
174 const GetAudioOutputControllersCallback& callback) const override; | 173 const GetAudioOutputControllersCallback& callback) const override; |
175 virtual void SelectWordAroundCaret() override; | 174 void SelectWordAroundCaret() override; |
176 | 175 |
177 #if defined(OS_ANDROID) | 176 #if defined(OS_ANDROID) |
178 virtual void ActivateNearestFindResult(int request_id, | 177 virtual void ActivateNearestFindResult(int request_id, |
179 float x, | 178 float x, |
180 float y) override; | 179 float y) override; |
181 virtual void RequestFindMatchRects(int current_version) override; | 180 virtual void RequestFindMatchRects(int current_version) override; |
182 #endif | 181 #endif |
183 | 182 |
184 void set_delegate(RenderViewHostDelegate* d) { | 183 void set_delegate(RenderViewHostDelegate* d) { |
185 CHECK(d); // http://crbug.com/82827 | 184 CHECK(d); // http://crbug.com/82827 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 const net::LoadStateWithParam& load_state, | 254 const net::LoadStateWithParam& load_state, |
256 uint64 upload_position, | 255 uint64 upload_position, |
257 uint64 upload_size); | 256 uint64 upload_size); |
258 | 257 |
259 bool SuddenTerminationAllowed() const; | 258 bool SuddenTerminationAllowed() const; |
260 void set_sudden_termination_allowed(bool enabled) { | 259 void set_sudden_termination_allowed(bool enabled) { |
261 sudden_termination_allowed_ = enabled; | 260 sudden_termination_allowed_ = enabled; |
262 } | 261 } |
263 | 262 |
264 // RenderWidgetHost public overrides. | 263 // RenderWidgetHost public overrides. |
265 virtual void Init() override; | 264 void Init() override; |
266 virtual void Shutdown() override; | 265 void Shutdown() override; |
267 virtual void WasHidden() override; | 266 void WasHidden() override; |
268 virtual void WasShown(const ui::LatencyInfo& latency_info) override; | 267 void WasShown(const ui::LatencyInfo& latency_info) override; |
269 virtual bool IsRenderView() const override; | 268 bool IsRenderView() const override; |
270 virtual bool OnMessageReceived(const IPC::Message& msg) override; | 269 bool OnMessageReceived(const IPC::Message& msg) override; |
271 virtual void GotFocus() override; | 270 void GotFocus() override; |
272 virtual void LostCapture() override; | 271 void LostCapture() override; |
273 virtual void LostMouseLock() override; | 272 void LostMouseLock() override; |
274 virtual void SetIsLoading(bool is_loading) override; | 273 void SetIsLoading(bool is_loading) override; |
275 virtual void ForwardMouseEvent( | 274 void ForwardMouseEvent(const blink::WebMouseEvent& mouse_event) override; |
276 const blink::WebMouseEvent& mouse_event) override; | 275 void OnPointerEventActivate() override; |
277 virtual void OnPointerEventActivate() override; | 276 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event) override; |
278 virtual void ForwardKeyboardEvent( | 277 gfx::Rect GetRootWindowResizerRect() const override; |
279 const NativeWebKeyboardEvent& key_event) override; | |
280 virtual gfx::Rect GetRootWindowResizerRect() const override; | |
281 | 278 |
282 // Creates a new RenderView with the given route id. | 279 // Creates a new RenderView with the given route id. |
283 void CreateNewWindow( | 280 void CreateNewWindow( |
284 int route_id, | 281 int route_id, |
285 int main_frame_route_id, | 282 int main_frame_route_id, |
286 const ViewHostMsg_CreateWindow_Params& params, | 283 const ViewHostMsg_CreateWindow_Params& params, |
287 SessionStorageNamespace* session_storage_namespace); | 284 SessionStorageNamespace* session_storage_namespace); |
288 | 285 |
289 // Creates a new RenderWidget with the given route id. |popup_type| indicates | 286 // Creates a new RenderWidget with the given route id. |popup_type| indicates |
290 // if this widget is a popup and what kind of popup it is (select, autofill). | 287 // if this widget is a popup and what kind of popup it is (select, autofill). |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // currently using it. | 323 // currently using it. |
327 int ref_count() { return frames_ref_count_; } | 324 int ref_count() { return frames_ref_count_; } |
328 | 325 |
329 // NOTE: Do not add functions that just send an IPC message that are called in | 326 // NOTE: Do not add functions that just send an IPC message that are called in |
330 // one or two places. Have the caller send the IPC message directly (unless | 327 // one or two places. Have the caller send the IPC message directly (unless |
331 // the caller places are in different platforms, in which case it's better | 328 // the caller places are in different platforms, in which case it's better |
332 // to keep them consistent). | 329 // to keep them consistent). |
333 | 330 |
334 protected: | 331 protected: |
335 // RenderWidgetHost protected overrides. | 332 // RenderWidgetHost protected overrides. |
336 virtual void OnUserGesture() override; | 333 void OnUserGesture() override; |
337 virtual void NotifyRendererUnresponsive() override; | 334 void NotifyRendererUnresponsive() override; |
338 virtual void NotifyRendererResponsive() override; | 335 void NotifyRendererResponsive() override; |
339 virtual void OnRenderAutoResized(const gfx::Size& size) override; | 336 void OnRenderAutoResized(const gfx::Size& size) override; |
340 virtual void RequestToLockMouse(bool user_gesture, | 337 void RequestToLockMouse(bool user_gesture, |
341 bool last_unlocked_by_target) override; | 338 bool last_unlocked_by_target) override; |
342 virtual bool IsFullscreen() const override; | 339 bool IsFullscreen() const override; |
343 virtual void OnFocus() override; | 340 void OnFocus() override; |
344 virtual void OnBlur() override; | 341 void OnBlur() override; |
345 | 342 |
346 // IPC message handlers. | 343 // IPC message handlers. |
347 void OnShowView(int route_id, | 344 void OnShowView(int route_id, |
348 WindowOpenDisposition disposition, | 345 WindowOpenDisposition disposition, |
349 const gfx::Rect& initial_pos, | 346 const gfx::Rect& initial_pos, |
350 bool user_gesture); | 347 bool user_gesture); |
351 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 348 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
352 void OnShowFullscreenWidget(int route_id); | 349 void OnShowFullscreenWidget(int route_id); |
353 void OnRunModal(int opener_id, IPC::Message* reply_msg); | 350 void OnRunModal(int opener_id, IPC::Message* reply_msg); |
354 void OnRenderViewReady(); | 351 void OnRenderViewReady(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 468 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
472 }; | 469 }; |
473 | 470 |
474 #if defined(COMPILER_MSVC) | 471 #if defined(COMPILER_MSVC) |
475 #pragma warning(pop) | 472 #pragma warning(pop) |
476 #endif | 473 #endif |
477 | 474 |
478 } // namespace content | 475 } // namespace content |
479 | 476 |
480 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 477 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |