| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 // Gets/Sets the View of this RenderWidgetHost. Can be NULL, e.g. if the | 140 // Gets/Sets the View of this RenderWidgetHost. Can be NULL, e.g. if the |
| 141 // RenderWidget is being destroyed or the render process crashed. You should | 141 // RenderWidget is being destroyed or the render process crashed. You should |
| 142 // never cache this pointer since it can become NULL if the renderer crashes, | 142 // never cache this pointer since it can become NULL if the renderer crashes, |
| 143 // instead you should always ask for it using the accessor. | 143 // instead you should always ask for it using the accessor. |
| 144 void set_view(RenderWidgetHostView* view) { view_ = view; } | 144 void set_view(RenderWidgetHostView* view) { view_ = view; } |
| 145 RenderWidgetHostView* view() const { return view_; } | 145 RenderWidgetHostView* view() const { return view_; } |
| 146 | 146 |
| 147 RenderProcessHost* process() const { return process_; } | 147 RenderProcessHost* process() const { return process_; } |
| 148 int routing_id() const { return routing_id_; } | 148 int routing_id() const { return routing_id_; } |
| 149 static bool renderer_accessible() { return renderer_accessible_; } |
| 149 | 150 |
| 150 // Set the PaintObserver on this object. Takes ownership. | 151 // Set the PaintObserver on this object. Takes ownership. |
| 151 void set_paint_observer(PaintObserver* paint_observer) { | 152 void set_paint_observer(PaintObserver* paint_observer) { |
| 152 paint_observer_.reset(paint_observer); | 153 paint_observer_.reset(paint_observer); |
| 153 } | 154 } |
| 154 | 155 |
| 155 // Returns the property bag for this widget, where callers can add extra data | 156 // Returns the property bag for this widget, where callers can add extra data |
| 156 // they may wish to associate with it. Returns a pointer rather than a | 157 // they may wish to associate with it. Returns a pointer rather than a |
| 157 // reference since the PropertyAccessors expect this. | 158 // reference since the PropertyAccessors expect this. |
| 158 const PropertyBag* property_bag() const { return &property_bag_; } | 159 const PropertyBag* property_bag() const { return &property_bag_; } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 virtual void SetActive(bool active); | 393 virtual void SetActive(bool active); |
| 393 | 394 |
| 394 void set_ignore_input_events(bool ignore_input_events) { | 395 void set_ignore_input_events(bool ignore_input_events) { |
| 395 ignore_input_events_ = ignore_input_events; | 396 ignore_input_events_ = ignore_input_events; |
| 396 } | 397 } |
| 397 bool ignore_input_events() const { | 398 bool ignore_input_events() const { |
| 398 return ignore_input_events_; | 399 return ignore_input_events_; |
| 399 } | 400 } |
| 400 | 401 |
| 401 protected: | 402 protected: |
| 402 // Aid for determining when an accessibility tree request can be made. Set by | |
| 403 // TabContents to true on document load and to false on page navigation. | |
| 404 void SetDocumentLoaded(bool document_loaded); | |
| 405 | |
| 406 // Requests a snapshot of an accessible DOM tree from the renderer. | |
| 407 void RequestAccessibilityTree(); | |
| 408 | |
| 409 // Internal implementation of the public Forward*Event() methods. | 403 // Internal implementation of the public Forward*Event() methods. |
| 410 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 404 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
| 411 int event_size, bool is_keyboard_shortcut); | 405 int event_size, bool is_keyboard_shortcut); |
| 412 | 406 |
| 413 // Called when we receive a notification indicating that the renderer | 407 // Called when we receive a notification indicating that the renderer |
| 414 // process has gone. This will reset our state so that our state will be | 408 // process has gone. This will reset our state so that our state will be |
| 415 // consistent if a new renderer is created. | 409 // consistent if a new renderer is created. |
| 416 void RendererExited(); | 410 void RendererExited(); |
| 417 | 411 |
| 418 // Retrieves an id the renderer can use to refer to its view. | 412 // Retrieves an id the renderer can use to refer to its view. |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 // shall not send the following sequence of Char events, which was generated | 675 // shall not send the following sequence of Char events, which was generated |
| 682 // by this RawKeyDown event, to the renderer. Otherwise the renderer may | 676 // by this RawKeyDown event, to the renderer. Otherwise the renderer may |
| 683 // handle the Char events and cause unexpected behavior. | 677 // handle the Char events and cause unexpected behavior. |
| 684 // For example, pressing alt-2 may let the browser switch to the second tab, | 678 // For example, pressing alt-2 may let the browser switch to the second tab, |
| 685 // but the Char event generated by alt-2 may also activate a HTML element | 679 // but the Char event generated by alt-2 may also activate a HTML element |
| 686 // if its accesskey happens to be "2", then the user may get confused when | 680 // if its accesskey happens to be "2", then the user may get confused when |
| 687 // switching back to the original tab, because the content may already be | 681 // switching back to the original tab, because the content may already be |
| 688 // changed. | 682 // changed. |
| 689 bool suppress_next_char_events_; | 683 bool suppress_next_char_events_; |
| 690 | 684 |
| 691 // Keep track of if we have a loaded document so that we can request an | |
| 692 // accessibility tree on demand when renderer accessibility is enabled. | |
| 693 bool document_loaded_; | |
| 694 | |
| 695 // Keep track of if we've already requested the accessibility tree so | |
| 696 // we don't do it more than once. | |
| 697 bool requested_accessibility_tree_; | |
| 698 | |
| 699 // Optional video YUV layer for used for out-of-process compositing. | 685 // Optional video YUV layer for used for out-of-process compositing. |
| 700 scoped_ptr<VideoLayer> video_layer_; | 686 scoped_ptr<VideoLayer> video_layer_; |
| 701 | 687 |
| 702 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 688 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
| 703 }; | 689 }; |
| 704 | 690 |
| 705 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 691 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |