| 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_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
| 18 #include "base/property_bag.h" | 18 #include "base/property_bag.h" |
| 19 #include "base/string16.h" | 19 #include "base/string16.h" |
| 20 #include "base/timer.h" | 20 #include "base/timer.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "content/common/view_message_enums.h" |
| 22 #include "content/public/browser/render_widget_host.h" | 23 #include "content/public/browser/render_widget_host.h" |
| 23 #include "content/public/common/page_zoom.h" | 24 #include "content/public/common/page_zoom.h" |
| 24 #include "ui/base/ime/text_input_type.h" | 25 #include "ui/base/ime/text_input_type.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 26 | 27 |
| 27 class BackingStore; | 28 class BackingStore; |
| 28 class MockRenderWidgetHost; | 29 class MockRenderWidgetHost; |
| 29 class WebCursor; | 30 class WebCursor; |
| 30 struct EditCommand; | 31 struct EditCommand; |
| 31 struct ViewHostMsg_UpdateRect_Params; | 32 struct ViewHostMsg_UpdateRect_Params; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 const gfx::Size& accelerated_dest_size, | 83 const gfx::Size& accelerated_dest_size, |
| 83 skia::PlatformCanvas* output) OVERRIDE; | 84 skia::PlatformCanvas* output) OVERRIDE; |
| 84 #if defined(TOOLKIT_GTK) | 85 #if defined(TOOLKIT_GTK) |
| 85 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, | 86 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, |
| 86 GdkWindow* target) OVERRIDE; | 87 GdkWindow* target) OVERRIDE; |
| 87 #elif defined(OS_MACOSX) | 88 #elif defined(OS_MACOSX) |
| 88 virtual gfx::Size GetBackingStoreSize() OVERRIDE; | 89 virtual gfx::Size GetBackingStoreSize() OVERRIDE; |
| 89 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect, | 90 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect, |
| 90 CGContextRef target) OVERRIDE; | 91 CGContextRef target) OVERRIDE; |
| 91 #endif | 92 #endif |
| 92 virtual void EnableRendererAccessibility() OVERRIDE; | 93 virtual void EnableFullAccessibilityMode() OVERRIDE; |
| 93 virtual void ForwardMouseEvent( | 94 virtual void ForwardMouseEvent( |
| 94 const WebKit::WebMouseEvent& mouse_event) OVERRIDE; | 95 const WebKit::WebMouseEvent& mouse_event) OVERRIDE; |
| 95 virtual void ForwardWheelEvent( | 96 virtual void ForwardWheelEvent( |
| 96 const WebKit::WebMouseWheelEvent& wheel_event) OVERRIDE; | 97 const WebKit::WebMouseWheelEvent& wheel_event) OVERRIDE; |
| 97 virtual void ForwardKeyboardEvent( | 98 virtual void ForwardKeyboardEvent( |
| 98 const NativeWebKeyboardEvent& key_event) OVERRIDE; | 99 const NativeWebKeyboardEvent& key_event) OVERRIDE; |
| 99 virtual const gfx::Point& GetLastScrollOffset() const OVERRIDE; | 100 virtual const gfx::Point& GetLastScrollOffset() const OVERRIDE; |
| 100 virtual RenderProcessHost* GetProcess() const OVERRIDE; | 101 virtual RenderProcessHost* GetProcess() const OVERRIDE; |
| 101 virtual int GetRoutingID() const OVERRIDE; | 102 virtual int GetRoutingID() const OVERRIDE; |
| 102 virtual RenderWidgetHostView* GetView() const OVERRIDE; | 103 virtual RenderWidgetHostView* GetView() const OVERRIDE; |
| 103 virtual bool IsRenderView() const OVERRIDE; | 104 virtual bool IsRenderView() const OVERRIDE; |
| 104 virtual void PaintAtSize(TransportDIB::Handle dib_handle, | 105 virtual void PaintAtSize(TransportDIB::Handle dib_handle, |
| 105 int tag, | 106 int tag, |
| 106 const gfx::Size& page_size, | 107 const gfx::Size& page_size, |
| 107 const gfx::Size& desired_size) OVERRIDE; | 108 const gfx::Size& desired_size) OVERRIDE; |
| 108 virtual void Replace(const string16& word) OVERRIDE; | 109 virtual void Replace(const string16& word) OVERRIDE; |
| 109 virtual void ResizeRectChanged(const gfx::Rect& new_rect) OVERRIDE; | 110 virtual void ResizeRectChanged(const gfx::Rect& new_rect) OVERRIDE; |
| 110 virtual void RestartHangMonitorTimeout() OVERRIDE; | 111 virtual void RestartHangMonitorTimeout() OVERRIDE; |
| 111 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; | 112 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; |
| 112 virtual void Stop() OVERRIDE; | 113 virtual void Stop() OVERRIDE; |
| 113 virtual void WasResized() OVERRIDE; | 114 virtual void WasResized() OVERRIDE; |
| 114 virtual void AddKeyboardListener(KeyboardListener* listener) OVERRIDE; | 115 virtual void AddKeyboardListener(KeyboardListener* listener) OVERRIDE; |
| 115 virtual void RemoveKeyboardListener(KeyboardListener* listener) OVERRIDE; | 116 virtual void RemoveKeyboardListener(KeyboardListener* listener) OVERRIDE; |
| 116 | 117 |
| 117 // Sets the View of this RenderWidgetHost. | 118 // Sets the View of this RenderWidgetHost. |
| 118 void SetView(RenderWidgetHostView* view); | 119 void SetView(RenderWidgetHostView* view); |
| 119 | 120 |
| 120 int surface_id() const { return surface_id_; } | 121 int surface_id() const { return surface_id_; } |
| 121 bool renderer_accessible() { return renderer_accessible_; } | |
| 122 | 122 |
| 123 bool empty() const { return current_size_.IsEmpty(); } | 123 bool empty() const { return current_size_.IsEmpty(); } |
| 124 | 124 |
| 125 // Returns the property bag for this widget, where callers can add extra data | 125 // Returns the property bag for this widget, where callers can add extra data |
| 126 // they may wish to associate with it. Returns a pointer rather than a | 126 // they may wish to associate with it. Returns a pointer rather than a |
| 127 // reference since the PropertyAccessors expect this. | 127 // reference since the PropertyAccessors expect this. |
| 128 const base::PropertyBag* property_bag() const { return &property_bag_; } | 128 const base::PropertyBag* property_bag() const { return &property_bag_; } |
| 129 base::PropertyBag* property_bag() { return &property_bag_; } | 129 base::PropertyBag* property_bag() { return &property_bag_; } |
| 130 | 130 |
| 131 // Called when a renderer object already been created for this host, and we | 131 // Called when a renderer object already been created for this host, and we |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 void StartUserGesture(); | 286 void StartUserGesture(); |
| 287 | 287 |
| 288 // Set the RenderView background. | 288 // Set the RenderView background. |
| 289 void SetBackground(const SkBitmap& background); | 289 void SetBackground(const SkBitmap& background); |
| 290 | 290 |
| 291 // Notifies the renderer that the next key event is bound to one or more | 291 // Notifies the renderer that the next key event is bound to one or more |
| 292 // pre-defined edit commands | 292 // pre-defined edit commands |
| 293 void SetEditCommandsForNextKeyEvent( | 293 void SetEditCommandsForNextKeyEvent( |
| 294 const std::vector<EditCommand>& commands); | 294 const std::vector<EditCommand>& commands); |
| 295 | 295 |
| 296 // Send a message to the renderer process to change the accessibility mode. |
| 297 void SetAccessibilityMode(AccessibilityMode mode); |
| 298 |
| 296 // Relay a request from assistive technology to perform the default action | 299 // Relay a request from assistive technology to perform the default action |
| 297 // on a given node. | 300 // on a given node. |
| 298 void AccessibilityDoDefaultAction(int object_id); | 301 void AccessibilityDoDefaultAction(int object_id); |
| 299 | 302 |
| 300 // Relay a request from assistive technology to set focus to a given node. | 303 // Relay a request from assistive technology to set focus to a given node. |
| 301 void AccessibilitySetFocus(int object_id); | 304 void AccessibilitySetFocus(int object_id); |
| 302 | 305 |
| 303 // Relay a request from assistive technology to make a given object | 306 // Relay a request from assistive technology to make a given object |
| 304 // visible by scrolling as many scrollable containers as necessary. | 307 // visible by scrolling as many scrollable containers as necessary. |
| 305 // In addition, if it's not possible to make the entire object visible, | 308 // In addition, if it's not possible to make the entire object visible, |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 void DelayedAutoResized(); | 541 void DelayedAutoResized(); |
| 539 | 542 |
| 540 // Created during construction but initialized during Init*(). Therefore, it | 543 // Created during construction but initialized during Init*(). Therefore, it |
| 541 // is guaranteed never to be NULL, but its channel may be NULL if the | 544 // is guaranteed never to be NULL, but its channel may be NULL if the |
| 542 // renderer crashed, so you must always check that. | 545 // renderer crashed, so you must always check that. |
| 543 RenderProcessHost* process_; | 546 RenderProcessHost* process_; |
| 544 | 547 |
| 545 // The ID of the corresponding object in the Renderer Instance. | 548 // The ID of the corresponding object in the Renderer Instance. |
| 546 int routing_id_; | 549 int routing_id_; |
| 547 | 550 |
| 548 // True if renderer accessibility is enabled. This should only be set when a | |
| 549 // screenreader is detected as it can potentially slow down Chrome. | |
| 550 bool renderer_accessible_; | |
| 551 | |
| 552 // Stores random bits of data for others to associate with this object. | 551 // Stores random bits of data for others to associate with this object. |
| 553 base::PropertyBag property_bag_; | 552 base::PropertyBag property_bag_; |
| 554 | 553 |
| 555 // The ID of the surface corresponding to this render widget. | 554 // The ID of the surface corresponding to this render widget. |
| 556 int surface_id_; | 555 int surface_id_; |
| 557 | 556 |
| 558 // Indicates whether a page is loading or not. | 557 // Indicates whether a page is loading or not. |
| 559 bool is_loading_; | 558 bool is_loading_; |
| 560 | 559 |
| 561 // Indicates whether a page is hidden or not. | 560 // Indicates whether a page is hidden or not. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 699 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 701 | 700 |
| 702 scoped_ptr<TapSuppressionController> tap_suppression_controller_; | 701 scoped_ptr<TapSuppressionController> tap_suppression_controller_; |
| 703 | 702 |
| 704 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 703 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 705 }; | 704 }; |
| 706 | 705 |
| 707 } // namespace content | 706 } // namespace content |
| 708 | 707 |
| 709 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 708 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |