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 | 7 |
8 #include <deque> | 8 #include <deque> |
| 9 #include <string> |
| 10 #include <vector> |
9 | 11 |
10 #include "app/surface/transport_dib.h" | 12 #include "app/surface/transport_dib.h" |
11 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
12 #include "base/process.h" | 14 #include "base/process.h" |
13 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
14 #include "base/string16.h" | 16 #include "base/string16.h" |
15 #include "base/timer.h" | 17 #include "base/timer.h" |
16 #include "chrome/common/edit_command.h" | 18 #include "chrome/common/edit_command.h" |
17 #include "chrome/common/native_web_keyboard_event.h" | 19 #include "chrome/common/native_web_keyboard_event.h" |
18 #include "chrome/common/property_bag.h" | 20 #include "chrome/common/property_bag.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 // Makes an IPC call to tell webkit to replace the currently selected word | 365 // Makes an IPC call to tell webkit to replace the currently selected word |
364 // or a word around the cursor. | 366 // or a word around the cursor. |
365 void Replace(const string16& word); | 367 void Replace(const string16& word); |
366 | 368 |
367 // Makes an IPC call to tell webkit to advance to the next misspelling. | 369 // Makes an IPC call to tell webkit to advance to the next misspelling. |
368 void AdvanceToNextMisspelling(); | 370 void AdvanceToNextMisspelling(); |
369 | 371 |
370 // Requests a snapshot of an accessible DOM tree from the renderer. | 372 // Requests a snapshot of an accessible DOM tree from the renderer. |
371 void RequestAccessibilityTree(); | 373 void RequestAccessibilityTree(); |
372 | 374 |
| 375 // Aid for determining when an accessibility tree request can be made. Set by |
| 376 // TabContents to true on document load and to false on page nativigation. |
| 377 void SetDocumentLoaded(bool document_loaded); |
| 378 |
| 379 // Enable renderer accessibility. This should only be called when a |
| 380 // screenreader is detected. |
| 381 void EnableRendererAccessibility(); |
| 382 |
373 // Relays a request from assistive technology to set focus to the | 383 // Relays a request from assistive technology to set focus to the |
374 // node with this accessibility object id. | 384 // node with this accessibility object id. |
375 void SetAccessibilityFocus(int acc_obj_id); | 385 void SetAccessibilityFocus(int acc_obj_id); |
376 | 386 |
377 // Relays a request from assistive technology to perform the default action | 387 // Relays a request from assistive technology to perform the default action |
378 // on a node with this accessibility object id. | 388 // on a node with this accessibility object id. |
379 void AccessibilityDoDefaultAction(int acc_obj_id); | 389 void AccessibilityDoDefaultAction(int acc_obj_id); |
380 | 390 |
381 // Sets the active state (i.e., control tints). | 391 // Sets the active state (i.e., control tints). |
382 virtual void SetActive(bool active); | 392 virtual void SetActive(bool active); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 const gfx::Rect& bitmap_rect); | 533 const gfx::Rect& bitmap_rect); |
524 | 534 |
525 // Called by OnMsgInputEventAck() to process a keyboard event ack message. | 535 // Called by OnMsgInputEventAck() to process a keyboard event ack message. |
526 void ProcessKeyboardEventAck(int type, bool processed); | 536 void ProcessKeyboardEventAck(int type, bool processed); |
527 | 537 |
528 // Called by OnMsgInputEventAck() to process a wheel event ack message. | 538 // Called by OnMsgInputEventAck() to process a wheel event ack message. |
529 // This could result in a task being posted to allow additional wheel | 539 // This could result in a task being posted to allow additional wheel |
530 // input messages to be coalesced. | 540 // input messages to be coalesced. |
531 void ProcessWheelAck(); | 541 void ProcessWheelAck(); |
532 | 542 |
| 543 // True if renderer accessibility is enabled. This should only be set when a |
| 544 // screenreader is detected as it can potentially slow down Chrome. |
| 545 static bool renderer_accessible_; |
| 546 |
533 // The View associated with the RenderViewHost. The lifetime of this object | 547 // The View associated with the RenderViewHost. The lifetime of this object |
534 // is associated with the lifetime of the Render process. If the Renderer | 548 // is associated with the lifetime of the Render process. If the Renderer |
535 // crashes, its View is destroyed and this pointer becomes NULL, even though | 549 // crashes, its View is destroyed and this pointer becomes NULL, even though |
536 // render_view_host_ lives on to load another URL (creating a new View while | 550 // render_view_host_ lives on to load another URL (creating a new View while |
537 // doing so). | 551 // doing so). |
538 RenderWidgetHostView* view_; | 552 RenderWidgetHostView* view_; |
539 | 553 |
540 // Created during construction but initialized during Init*(). Therefore, it | 554 // Created during construction but initialized during Init*(). Therefore, it |
541 // is guaranteed never to be NULL, but its channel may be NULL if the | 555 // is guaranteed never to be NULL, but its channel may be NULL if the |
542 // renderer crashed, so you must always check that. | 556 // renderer crashed, so you must always check that. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 // shall not send the following sequence of Char events, which was generated | 674 // shall not send the following sequence of Char events, which was generated |
661 // by this RawKeyDown event, to the renderer. Otherwise the renderer may | 675 // by this RawKeyDown event, to the renderer. Otherwise the renderer may |
662 // handle the Char events and cause unexpected behavior. | 676 // handle the Char events and cause unexpected behavior. |
663 // For example, pressing alt-2 may let the browser switch to the second tab, | 677 // For example, pressing alt-2 may let the browser switch to the second tab, |
664 // but the Char event generated by alt-2 may also activate a HTML element | 678 // but the Char event generated by alt-2 may also activate a HTML element |
665 // if its accesskey happens to be "2", then the user may get confused when | 679 // if its accesskey happens to be "2", then the user may get confused when |
666 // switching back to the original tab, because the content may already be | 680 // switching back to the original tab, because the content may already be |
667 // changed. | 681 // changed. |
668 bool suppress_next_char_events_; | 682 bool suppress_next_char_events_; |
669 | 683 |
| 684 // Keep track of if we have a loaded document so that we can request an |
| 685 // accessibility tree on demand when renderer accessibility is enabled. |
| 686 bool document_loaded_; |
| 687 |
| 688 // Keep track of if we've already requested the accessibility tree so |
| 689 // we don't do it more than once. |
| 690 bool requested_accessibility_tree_; |
| 691 |
670 // Optional video YUV layer for used for out-of-process compositing. | 692 // Optional video YUV layer for used for out-of-process compositing. |
671 scoped_ptr<VideoLayer> video_layer_; | 693 scoped_ptr<VideoLayer> video_layer_; |
672 | 694 |
673 // Set to true if we want to wait until at least one more time through | 695 // Set to true if we want to wait until at least one more time through |
674 // the event loop to see if any additional wheel messages are coming in | 696 // the event loop to see if any additional wheel messages are coming in |
675 // before sending the coalesced ones. | 697 // before sending the coalesced ones. |
676 bool spin_runloop_before_sending_wheel_event_; | 698 bool spin_runloop_before_sending_wheel_event_; |
677 | 699 |
678 // The time the last wheel message was sent to the renderer. | 700 // The time the last wheel message was sent to the renderer. |
679 base::TimeTicks last_wheel_message_time_; | 701 base::TimeTicks last_wheel_message_time_; |
680 | 702 |
681 // For running tasks. | 703 // For running tasks. |
682 ScopedRunnableMethodFactory<RenderWidgetHost> method_runner_; | 704 ScopedRunnableMethodFactory<RenderWidgetHost> method_runner_; |
683 | 705 |
684 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 706 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
685 }; | 707 }; |
686 | 708 |
687 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 709 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |