OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 13 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
15 #include "base/process_util.h" | 16 #include "base/process_util.h" |
16 #include "content/browser/renderer_host/render_widget_host.h" | 17 #include "content/browser/renderer_host/render_widget_host.h" |
17 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
18 #include "content/common/window_container_type.h" | 19 #include "content/common/window_container_type.h" |
19 #include "net/base/load_states.h" | 20 #include "net/base/load_states.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 const net::LoadStateWithParam& load_state, | 319 const net::LoadStateWithParam& load_state, |
319 uint64 upload_position, | 320 uint64 upload_position, |
320 uint64 upload_size); | 321 uint64 upload_size); |
321 | 322 |
322 bool SuddenTerminationAllowed() const; | 323 bool SuddenTerminationAllowed() const; |
323 void set_sudden_termination_allowed(bool enabled) { | 324 void set_sudden_termination_allowed(bool enabled) { |
324 sudden_termination_allowed_ = enabled; | 325 sudden_termination_allowed_ = enabled; |
325 } | 326 } |
326 | 327 |
327 // RenderWidgetHost public overrides. | 328 // RenderWidgetHost public overrides. |
328 virtual void Shutdown(); | 329 virtual void Shutdown() OVERRIDE; |
329 virtual bool IsRenderView() const; | 330 virtual bool IsRenderView() const OVERRIDE; |
330 virtual bool OnMessageReceived(const IPC::Message& msg); | 331 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
331 virtual void GotFocus(); | 332 virtual void GotFocus() OVERRIDE; |
332 virtual void LostCapture(); | 333 virtual void LostCapture() OVERRIDE; |
333 virtual void ForwardMouseEvent(const WebKit::WebMouseEvent& mouse_event); | 334 virtual void ForwardMouseEvent( |
334 virtual void OnMouseActivate(); | 335 const WebKit::WebMouseEvent& mouse_event) OVERRIDE; |
335 virtual void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event); | 336 virtual void OnMouseActivate() OVERRIDE; |
| 337 virtual void ForwardKeyboardEvent( |
| 338 const NativeWebKeyboardEvent& key_event) OVERRIDE; |
336 | 339 |
337 // Creates a new RenderView with the given route id. | 340 // Creates a new RenderView with the given route id. |
338 void CreateNewWindow(int route_id, | 341 void CreateNewWindow(int route_id, |
339 const ViewHostMsg_CreateWindow_Params& params); | 342 const ViewHostMsg_CreateWindow_Params& params); |
340 | 343 |
341 // Creates a new RenderWidget with the given route id. |popup_type| indicates | 344 // Creates a new RenderWidget with the given route id. |popup_type| indicates |
342 // if this widget is a popup and what kind of popup it is (select, autofill). | 345 // if this widget is a popup and what kind of popup it is (select, autofill). |
343 void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type); | 346 void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type); |
344 | 347 |
345 // Creates a full screen RenderWidget. | 348 // Creates a full screen RenderWidget. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 protected: | 449 protected: |
447 friend class RenderViewHostObserver; | 450 friend class RenderViewHostObserver; |
448 | 451 |
449 // Add and remove observers for filtering IPC messages. Clients must be sure | 452 // Add and remove observers for filtering IPC messages. Clients must be sure |
450 // to remove the observer before they go away. | 453 // to remove the observer before they go away. |
451 void AddObserver(RenderViewHostObserver* observer); | 454 void AddObserver(RenderViewHostObserver* observer); |
452 void RemoveObserver(RenderViewHostObserver* observer); | 455 void RemoveObserver(RenderViewHostObserver* observer); |
453 | 456 |
454 // RenderWidgetHost protected overrides. | 457 // RenderWidgetHost protected overrides. |
455 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 458 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
456 bool* is_keyboard_shortcut); | 459 bool* is_keyboard_shortcut) OVERRIDE; |
457 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); | 460 virtual void UnhandledKeyboardEvent( |
458 virtual void OnUserGesture(); | 461 const NativeWebKeyboardEvent& event) OVERRIDE; |
459 virtual void NotifyRendererUnresponsive(); | 462 virtual void OnUserGesture() OVERRIDE; |
460 virtual void NotifyRendererResponsive(); | 463 virtual void NotifyRendererUnresponsive() OVERRIDE; |
461 virtual void OnMsgFocus(); | 464 virtual void NotifyRendererResponsive() OVERRIDE; |
462 virtual void OnMsgBlur(); | 465 virtual bool CanLockMouse() const OVERRIDE; |
| 466 virtual void OnMsgFocus() OVERRIDE; |
| 467 virtual void OnMsgBlur() OVERRIDE; |
463 | 468 |
464 // IPC message handlers. | 469 // IPC message handlers. |
465 void OnMsgShowView(int route_id, | 470 void OnMsgShowView(int route_id, |
466 WindowOpenDisposition disposition, | 471 WindowOpenDisposition disposition, |
467 const gfx::Rect& initial_pos, | 472 const gfx::Rect& initial_pos, |
468 bool user_gesture); | 473 bool user_gesture); |
469 void OnMsgShowWidget(int route_id, const gfx::Rect& initial_pos); | 474 void OnMsgShowWidget(int route_id, const gfx::Rect& initial_pos); |
470 void OnMsgShowFullscreenWidget(int route_id); | 475 void OnMsgShowFullscreenWidget(int route_id); |
471 void OnMsgRunModal(IPC::Message* reply_msg); | 476 void OnMsgRunModal(IPC::Message* reply_msg); |
472 void OnMsgRenderViewReady(); | 477 void OnMsgRenderViewReady(); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 // The termination status of the last render view that terminated. | 625 // The termination status of the last render view that terminated. |
621 base::TerminationStatus render_view_termination_status_; | 626 base::TerminationStatus render_view_termination_status_; |
622 | 627 |
623 // A list of observers that filter messages. Weak references. | 628 // A list of observers that filter messages. Weak references. |
624 ObserverList<RenderViewHostObserver> observers_; | 629 ObserverList<RenderViewHostObserver> observers_; |
625 | 630 |
626 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 631 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
627 }; | 632 }; |
628 | 633 |
629 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 634 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
OLD | NEW |