Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.h

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/process/kill.h" 16 #include "base/process/kill.h"
17 #include "content/browser/renderer_host/render_widget_host_impl.h" 17 #include "content/browser/renderer_host/render_widget_host_impl.h"
18 #include "content/browser/site_instance_impl.h" 18 #include "content/browser/site_instance_impl.h"
19 #include "content/common/drag_event_source_info.h" 19 #include "content/common/drag_event_source_info.h"
20 #include "content/public/browser/notification_observer.h" 20 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/render_view_host.h" 21 #include "content/public/browser/render_view_host.h"
22 #include "content/public/common/window_container_type.h" 22 #include "content/public/common/window_container_type.h"
23 #include "net/base/load_states.h" 23 #include "net/base/load_states.h"
24 #include "third_party/WebKit/public/web/WebAXEnums.h" 24 #include "third_party/WebKit/public/web/WebAXEnums.h"
25 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 25 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
26 #include "third_party/WebKit/public/web/WebPopupType.h" 26 #include "third_party/WebKit/public/web/WebPopupType.h"
27 #include "third_party/skia/include/core/SkColor.h" 27 #include "third_party/skia/include/core/SkColor.h"
28 #include "ui/accessibility/ax_node_data.h"
29 #include "ui/base/window_open_disposition.h" 28 #include "ui/base/window_open_disposition.h"
30 29
31 class SkBitmap; 30 class SkBitmap;
32 class FrameMsg_Navigate; 31 class FrameMsg_Navigate;
33 struct AccessibilityHostMsg_EventParams;
34 struct AccessibilityHostMsg_LocationChangeParams;
35 struct MediaPlayerAction; 32 struct MediaPlayerAction;
36 struct ViewHostMsg_CreateWindow_Params; 33 struct ViewHostMsg_CreateWindow_Params;
37 struct ViewHostMsg_ShowPopup_Params; 34 struct ViewHostMsg_ShowPopup_Params;
38 struct FrameMsg_Navigate_Params; 35 struct FrameMsg_Navigate_Params;
39 struct ViewMsg_PostMessage_Params; 36 struct ViewMsg_PostMessage_Params;
40 37
41 namespace base { 38 namespace base {
42 class ListValue; 39 class ListValue;
43 } 40 }
44 41
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 void DidCancelPopupMenu(); 398 void DidCancelPopupMenu();
402 #endif 399 #endif
403 400
404 int main_frame_routing_id() const { 401 int main_frame_routing_id() const {
405 return main_frame_routing_id_; 402 return main_frame_routing_id_;
406 } 403 }
407 404
408 // Set the opener to null in the renderer process. 405 // Set the opener to null in the renderer process.
409 void DisownOpener(); 406 void DisownOpener();
410 407
411 // Turn on accessibility testing. The given callback will be run
412 // every time an accessibility notification is received from the
413 // renderer process, and the accessibility tree it sent can be
414 // retrieved using accessibility_tree_for_testing().
415 void SetAccessibilityCallbackForTesting(
416 const base::Callback<void(ui::AXEvent, int)>& callback);
417
418 // Only valid if SetAccessibilityCallbackForTesting was called and
419 // the callback was run at least once. Returns a snapshot of the
420 // accessibility tree received from the renderer as of the last time
421 // an accessibility notification was received.
422 const ui::AXTree& ax_tree_for_testing() {
423 CHECK(ax_tree_.get());
424 return *ax_tree_.get();
425 }
426
427 // Set accessibility callbacks.
428 void SetAccessibilityLayoutCompleteCallbackForTesting(
429 const base::Closure& callback);
430 void SetAccessibilityLoadCompleteCallbackForTesting(
431 const base::Closure& callback);
432 void SetAccessibilityOtherCallbackForTesting(
433 const base::Closure& callback);
434
435 bool is_waiting_for_beforeunload_ack() { 408 bool is_waiting_for_beforeunload_ack() {
436 return is_waiting_for_beforeunload_ack_; 409 return is_waiting_for_beforeunload_ack_;
437 } 410 }
438 411
439 // Whether the RVH is waiting for the unload ack from the renderer. 412 // Whether the RVH is waiting for the unload ack from the renderer.
440 bool IsWaitingForUnloadACK() const; 413 bool IsWaitingForUnloadACK() const;
441 414
442 void OnTextSurroundingSelectionResponse(const base::string16& content, 415 void OnTextSurroundingSelectionResponse(const base::string16& content,
443 size_t start_offset, 416 size_t start_offset,
444 size_t end_offset); 417 size_t end_offset);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 const SkBitmap& bitmap, 478 const SkBitmap& bitmap,
506 const gfx::Vector2d& bitmap_offset_in_dip, 479 const gfx::Vector2d& bitmap_offset_in_dip,
507 const DragEventSourceInfo& event_info); 480 const DragEventSourceInfo& event_info);
508 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); 481 void OnUpdateDragCursor(blink::WebDragOperation drag_operation);
509 void OnTargetDropACK(); 482 void OnTargetDropACK();
510 void OnTakeFocus(bool reverse); 483 void OnTakeFocus(bool reverse);
511 void OnFocusedNodeChanged(bool is_editable_node); 484 void OnFocusedNodeChanged(bool is_editable_node);
512 void OnUpdateInspectorSetting(const std::string& key, 485 void OnUpdateInspectorSetting(const std::string& key,
513 const std::string& value); 486 const std::string& value);
514 void OnClosePageACK(); 487 void OnClosePageACK();
515 void OnAccessibilityEvents(
516 const std::vector<AccessibilityHostMsg_EventParams>& params);
517 void OnAccessibilityLocationChanges(
518 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params);
519 void OnDidZoomURL(double zoom_level, const GURL& url); 488 void OnDidZoomURL(double zoom_level, const GURL& url);
520 void OnRunFileChooser(const FileChooserParams& params); 489 void OnRunFileChooser(const FileChooserParams& params);
521 void OnFocusedNodeTouched(bool editable); 490 void OnFocusedNodeTouched(bool editable);
522 491
523 #if defined(OS_MACOSX) || defined(OS_ANDROID) 492 #if defined(OS_MACOSX) || defined(OS_ANDROID)
524 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); 493 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params);
525 void OnHidePopup(); 494 void OnHidePopup();
526 #endif 495 #endif
527 496
528 private: 497 private:
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. 570 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state.
602 bool is_waiting_for_beforeunload_ack_; 571 bool is_waiting_for_beforeunload_ack_;
603 572
604 // Valid only when is_waiting_for_beforeunload_ack_ or 573 // Valid only when is_waiting_for_beforeunload_ack_ or
605 // IsWaitingForUnloadACK is true. This tells us if the unload request 574 // IsWaitingForUnloadACK is true. This tells us if the unload request
606 // is for closing the entire tab ( = false), or only this RenderViewHost in 575 // is for closing the entire tab ( = false), or only this RenderViewHost in
607 // the case of a cross-site transition ( = true). 576 // the case of a cross-site transition ( = true).
608 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. 577 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state.
609 bool unload_ack_is_for_cross_site_transition_; 578 bool unload_ack_is_for_cross_site_transition_;
610 579
611 // Accessibility callback for testing.
612 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_;
613
614 // The most recently received accessibility tree - for testing only.
615 scoped_ptr<ui::AXTree> ax_tree_;
616
617 // True if the render view can be shut down suddenly. 580 // True if the render view can be shut down suddenly.
618 bool sudden_termination_allowed_; 581 bool sudden_termination_allowed_;
619 582
620 // The termination status of the last render view that terminated. 583 // The termination status of the last render view that terminated.
621 base::TerminationStatus render_view_termination_status_; 584 base::TerminationStatus render_view_termination_status_;
622 585
623 // Set to true if we requested the on screen keyboard to be displayed. 586 // Set to true if we requested the on screen keyboard to be displayed.
624 bool virtual_keyboard_requested_; 587 bool virtual_keyboard_requested_;
625 588
626 #if defined(ENABLE_BROWSER_CDMS) 589 #if defined(ENABLE_BROWSER_CDMS)
(...skipping 20 matching lines...) Expand all
647 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); 610 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl);
648 }; 611 };
649 612
650 #if defined(COMPILER_MSVC) 613 #if defined(COMPILER_MSVC)
651 #pragma warning(pop) 614 #pragma warning(pop)
652 #endif 615 #endif
653 616
654 } // namespace content 617 } // namespace content
655 618
656 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 619 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698