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

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: Fix win & android compile Created 6 years, 7 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 void DidCancelPopupMenu(); 397 void DidCancelPopupMenu();
401 #endif 398 #endif
402 399
403 int main_frame_routing_id() const { 400 int main_frame_routing_id() const {
404 return main_frame_routing_id_; 401 return main_frame_routing_id_;
405 } 402 }
406 403
407 // Set the opener to null in the renderer process. 404 // Set the opener to null in the renderer process.
408 void DisownOpener(); 405 void DisownOpener();
409 406
410 // Turn on accessibility testing. The given callback will be run
411 // every time an accessibility notification is received from the
412 // renderer process, and the accessibility tree it sent can be
413 // retrieved using accessibility_tree_for_testing().
414 void SetAccessibilityCallbackForTesting(
415 const base::Callback<void(ui::AXEvent)>& callback);
416
417 // Only valid if SetAccessibilityCallbackForTesting was called and
418 // the callback was run at least once. Returns a snapshot of the
419 // accessibility tree received from the renderer as of the last time
420 // an accessibility notification was received.
421 const ui::AXTree& ax_tree_for_testing() {
422 CHECK(ax_tree_.get());
423 return *ax_tree_.get();
424 }
425
426 // Set accessibility callbacks.
427 void SetAccessibilityLayoutCompleteCallbackForTesting(
428 const base::Closure& callback);
429 void SetAccessibilityLoadCompleteCallbackForTesting(
430 const base::Closure& callback);
431 void SetAccessibilityOtherCallbackForTesting(
432 const base::Closure& callback);
433
434 bool is_waiting_for_beforeunload_ack() { 407 bool is_waiting_for_beforeunload_ack() {
435 return is_waiting_for_beforeunload_ack_; 408 return is_waiting_for_beforeunload_ack_;
436 } 409 }
437 410
438 // Whether the RVH is waiting for the unload ack from the renderer. 411 // Whether the RVH is waiting for the unload ack from the renderer.
439 bool IsWaitingForUnloadACK() const; 412 bool IsWaitingForUnloadACK() const;
440 413
441 // Update the FrameTree to use this RenderViewHost's main frame 414 // Update the FrameTree to use this RenderViewHost's main frame
442 // RenderFrameHost. Called when the RenderViewHost is committed. 415 // RenderFrameHost. Called when the RenderViewHost is committed.
443 // 416 //
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 const SkBitmap& bitmap, 480 const SkBitmap& bitmap,
508 const gfx::Vector2d& bitmap_offset_in_dip, 481 const gfx::Vector2d& bitmap_offset_in_dip,
509 const DragEventSourceInfo& event_info); 482 const DragEventSourceInfo& event_info);
510 void OnUpdateDragCursor(blink::WebDragOperation drag_operation); 483 void OnUpdateDragCursor(blink::WebDragOperation drag_operation);
511 void OnTargetDropACK(); 484 void OnTargetDropACK();
512 void OnTakeFocus(bool reverse); 485 void OnTakeFocus(bool reverse);
513 void OnFocusedNodeChanged(bool is_editable_node); 486 void OnFocusedNodeChanged(bool is_editable_node);
514 void OnUpdateInspectorSetting(const std::string& key, 487 void OnUpdateInspectorSetting(const std::string& key,
515 const std::string& value); 488 const std::string& value);
516 void OnClosePageACK(); 489 void OnClosePageACK();
517 void OnAccessibilityEvents(
518 const std::vector<AccessibilityHostMsg_EventParams>& params);
519 void OnAccessibilityLocationChanges(
520 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params);
521 void OnDidZoomURL(double zoom_level, bool remember, const GURL& url); 490 void OnDidZoomURL(double zoom_level, bool remember, const GURL& url);
522 void OnRunFileChooser(const FileChooserParams& params); 491 void OnRunFileChooser(const FileChooserParams& params);
523 void OnFocusedNodeTouched(bool editable); 492 void OnFocusedNodeTouched(bool editable);
524 493
525 #if defined(OS_MACOSX) || defined(OS_ANDROID) 494 #if defined(OS_MACOSX) || defined(OS_ANDROID)
526 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); 495 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params);
527 void OnHidePopup(); 496 void OnHidePopup();
528 #endif 497 #endif
529 498
530 private: 499 private:
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. 572 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state.
604 bool is_waiting_for_beforeunload_ack_; 573 bool is_waiting_for_beforeunload_ack_;
605 574
606 // Valid only when is_waiting_for_beforeunload_ack_ or 575 // Valid only when is_waiting_for_beforeunload_ack_ or
607 // IsWaitingForUnloadACK is true. This tells us if the unload request 576 // IsWaitingForUnloadACK is true. This tells us if the unload request
608 // is for closing the entire tab ( = false), or only this RenderViewHost in 577 // is for closing the entire tab ( = false), or only this RenderViewHost in
609 // the case of a cross-site transition ( = true). 578 // the case of a cross-site transition ( = true).
610 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. 579 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state.
611 bool unload_ack_is_for_cross_site_transition_; 580 bool unload_ack_is_for_cross_site_transition_;
612 581
613 // Accessibility callback for testing.
614 base::Callback<void(ui::AXEvent)> accessibility_testing_callback_;
615
616 // The most recently received accessibility tree - for testing only.
617 scoped_ptr<ui::AXTree> ax_tree_;
618
619 // True if the render view can be shut down suddenly. 582 // True if the render view can be shut down suddenly.
620 bool sudden_termination_allowed_; 583 bool sudden_termination_allowed_;
621 584
622 // The termination status of the last render view that terminated. 585 // The termination status of the last render view that terminated.
623 base::TerminationStatus render_view_termination_status_; 586 base::TerminationStatus render_view_termination_status_;
624 587
625 // Set to true if we requested the on screen keyboard to be displayed. 588 // Set to true if we requested the on screen keyboard to be displayed.
626 bool virtual_keyboard_requested_; 589 bool virtual_keyboard_requested_;
627 590
628 #if defined(OS_ANDROID) 591 #if defined(OS_ANDROID)
(...skipping 20 matching lines...) Expand all
649 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); 612 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl);
650 }; 613 };
651 614
652 #if defined(COMPILER_MSVC) 615 #if defined(COMPILER_MSVC)
653 #pragma warning(pop) 616 #pragma warning(pop)
654 #endif 617 #endif
655 618
656 } // namespace content 619 } // namespace content
657 620
658 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ 621 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698