OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_RENDER_FRAME_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/process/process_handle.h" | 16 #include "base/process/process_handle.h" |
| 17 #include "content/common/accessibility_mode_enums.h" |
17 #include "content/common/mojo/service_registry_impl.h" | 18 #include "content/common/mojo/service_registry_impl.h" |
18 #include "content/public/common/javascript_message_type.h" | 19 #include "content/public/common/javascript_message_type.h" |
19 #include "content/public/common/referrer.h" | 20 #include "content/public/common/referrer.h" |
20 #include "content/public/renderer/render_frame.h" | 21 #include "content/public/renderer/render_frame.h" |
21 #include "content/renderer/media/webmediaplayer_delegate.h" | 22 #include "content/renderer/media/webmediaplayer_delegate.h" |
22 #include "content/renderer/render_frame_proxy.h" | 23 #include "content/renderer/render_frame_proxy.h" |
23 #include "content/renderer/renderer_webcookiejar_impl.h" | 24 #include "content/renderer/renderer_webcookiejar_impl.h" |
24 #include "ipc/ipc_message.h" | 25 #include "ipc/ipc_message.h" |
| 26 #include "third_party/WebKit/public/web/WebAXObject.h" |
25 #include "third_party/WebKit/public/web/WebDataSource.h" | 27 #include "third_party/WebKit/public/web/WebDataSource.h" |
26 #include "third_party/WebKit/public/web/WebFrameClient.h" | 28 #include "third_party/WebKit/public/web/WebFrameClient.h" |
27 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 29 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
28 #include "ui/gfx/range/range.h" | 30 #include "ui/gfx/range/range.h" |
29 | 31 |
30 #if defined(OS_ANDROID) | 32 #if defined(OS_ANDROID) |
31 #include "content/renderer/media/android/renderer_media_player_manager.h" | 33 #include "content/renderer/media/android/renderer_media_player_manager.h" |
32 #endif | 34 #endif |
33 | 35 |
34 class TransportDIB; | 36 class TransportDIB; |
(...skipping 23 matching lines...) Expand all Loading... |
58 | 60 |
59 class ChildFrameCompositingHelper; | 61 class ChildFrameCompositingHelper; |
60 class GeolocationDispatcher; | 62 class GeolocationDispatcher; |
61 class MediaStreamDispatcher; | 63 class MediaStreamDispatcher; |
62 class MediaStreamImpl; | 64 class MediaStreamImpl; |
63 class MediaStreamRendererFactory; | 65 class MediaStreamRendererFactory; |
64 class MidiDispatcher; | 66 class MidiDispatcher; |
65 class NotificationProvider; | 67 class NotificationProvider; |
66 class PepperPluginInstanceImpl; | 68 class PepperPluginInstanceImpl; |
67 class PushMessagingDispatcher; | 69 class PushMessagingDispatcher; |
| 70 class RendererAccessibility; |
68 class RendererCdmManager; | 71 class RendererCdmManager; |
69 class RendererMediaPlayerManager; | 72 class RendererMediaPlayerManager; |
70 class RendererPpapiHost; | 73 class RendererPpapiHost; |
71 class RenderFrameObserver; | 74 class RenderFrameObserver; |
72 class RenderViewImpl; | 75 class RenderViewImpl; |
73 class RenderWidget; | 76 class RenderWidget; |
74 class RenderWidgetFullscreenPepper; | 77 class RenderWidgetFullscreenPepper; |
75 class ScreenOrientationDispatcher; | 78 class ScreenOrientationDispatcher; |
76 struct CustomContextMenuContext; | 79 struct CustomContextMenuContext; |
77 | 80 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Start/Stop loading notifications. | 144 // Start/Stop loading notifications. |
142 // TODO(nasko): Those are page-level methods at this time and come from | 145 // TODO(nasko): Those are page-level methods at this time and come from |
143 // WebViewClient. We should move them to be WebFrameClient calls and put | 146 // WebViewClient. We should move them to be WebFrameClient calls and put |
144 // logic in the browser side to balance starts/stops. | 147 // logic in the browser side to balance starts/stops. |
145 // |to_different_document| will be true unless the load is a fragment | 148 // |to_different_document| will be true unless the load is a fragment |
146 // navigation, or triggered by history.pushState/replaceState. | 149 // navigation, or triggered by history.pushState/replaceState. |
147 virtual void didStartLoading(bool to_different_document); | 150 virtual void didStartLoading(bool to_different_document); |
148 virtual void didStopLoading(); | 151 virtual void didStopLoading(); |
149 virtual void didChangeLoadProgress(double load_progress); | 152 virtual void didChangeLoadProgress(double load_progress); |
150 | 153 |
| 154 AccessibilityMode accessibility_mode() { |
| 155 return accessibility_mode_; |
| 156 } |
| 157 |
| 158 RendererAccessibility* renderer_accessibility() { |
| 159 return renderer_accessibility_; |
| 160 } |
| 161 |
| 162 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj, |
| 163 blink::WebAXEvent event); |
| 164 |
| 165 // TODO(dmazzoni): the only reason this is here is to plumb it through to |
| 166 // RendererAccessibility. It should be part of RenderFrameObserver, once |
| 167 // blink has a separate accessibility tree per frame. |
| 168 void FocusedNodeChanged(const blink::WebNode& node); |
| 169 |
151 #if defined(ENABLE_PLUGINS) | 170 #if defined(ENABLE_PLUGINS) |
152 // Notification that a PPAPI plugin has been created. | 171 // Notification that a PPAPI plugin has been created. |
153 void PepperPluginCreated(RendererPpapiHost* host); | 172 void PepperPluginCreated(RendererPpapiHost* host); |
154 | 173 |
155 // Notifies that |instance| has changed the cursor. | 174 // Notifies that |instance| has changed the cursor. |
156 // This will update the cursor appearance if it is currently over the plugin | 175 // This will update the cursor appearance if it is currently over the plugin |
157 // instance. | 176 // instance. |
158 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, | 177 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
159 const blink::WebCursorInfo& cursor); | 178 const blink::WebCursorInfo& cursor); |
160 | 179 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // Binds this render frame's service registry to a handle to the remote | 432 // Binds this render frame's service registry to a handle to the remote |
414 // service registry. | 433 // service registry. |
415 void BindServiceRegistry( | 434 void BindServiceRegistry( |
416 mojo::ScopedMessagePipeHandle service_provider_handle); | 435 mojo::ScopedMessagePipeHandle service_provider_handle); |
417 | 436 |
418 protected: | 437 protected: |
419 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); | 438 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
420 | 439 |
421 private: | 440 private: |
422 friend class RenderFrameObserver; | 441 friend class RenderFrameObserver; |
| 442 friend class RendererAccessibilityTest; |
423 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, | 443 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, |
424 AccessibilityMessagesQueueWhileSwappedOut); | 444 AccessibilityMessagesQueueWhileSwappedOut); |
425 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | 445 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
426 ShouldUpdateSelectionTextFromContextMenuParams); | 446 ShouldUpdateSelectionTextFromContextMenuParams); |
427 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 447 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
428 OnExtendSelectionAndDelete); | 448 OnExtendSelectionAndDelete); |
429 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); | 449 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); |
430 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); | 450 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); |
431 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 451 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
432 SetEditableSelectionAndComposition); | 452 SetEditableSelectionAndComposition); |
| 453 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 454 OnSetAccessibilityMode); |
433 | 455 |
434 typedef std::map<GURL, double> HostZoomLevels; | 456 typedef std::map<GURL, double> HostZoomLevels; |
435 | 457 |
436 // Functions to add and remove observers for this object. | 458 // Functions to add and remove observers for this object. |
437 void AddObserver(RenderFrameObserver* observer); | 459 void AddObserver(RenderFrameObserver* observer); |
438 void RemoveObserver(RenderFrameObserver* observer); | 460 void RemoveObserver(RenderFrameObserver* observer); |
439 | 461 |
440 void UpdateURL(blink::WebFrame* frame); | 462 void UpdateURL(blink::WebFrame* frame); |
441 | 463 |
442 // Gets the focused element. If no such element exists then the element will | 464 // Gets the focused element. If no such element exists then the element will |
(...skipping 27 matching lines...) Expand all Loading... |
470 int id, | 492 int id, |
471 bool notify_result); | 493 bool notify_result); |
472 void OnSetEditableSelectionOffsets(int start, int end); | 494 void OnSetEditableSelectionOffsets(int start, int end); |
473 void OnSetCompositionFromExistingText( | 495 void OnSetCompositionFromExistingText( |
474 int start, int end, | 496 int start, int end, |
475 const std::vector<blink::WebCompositionUnderline>& underlines); | 497 const std::vector<blink::WebCompositionUnderline>& underlines); |
476 void OnExtendSelectionAndDelete(int before, int after); | 498 void OnExtendSelectionAndDelete(int before, int after); |
477 void OnReload(bool ignore_cache); | 499 void OnReload(bool ignore_cache); |
478 void OnTextSurroundingSelectionRequest(size_t max_length); | 500 void OnTextSurroundingSelectionRequest(size_t max_length); |
479 void OnAddStyleSheetByURL(const std::string& url); | 501 void OnAddStyleSheetByURL(const std::string& url); |
| 502 void OnSetAccessibilityMode(AccessibilityMode new_mode); |
480 #if defined(OS_MACOSX) | 503 #if defined(OS_MACOSX) |
481 void OnCopyToFindPboard(); | 504 void OnCopyToFindPboard(); |
482 #endif | 505 #endif |
483 | 506 |
484 // Virtual since overridden by WebTestProxy for layout tests. | 507 // Virtual since overridden by WebTestProxy for layout tests. |
485 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( | 508 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( |
486 RenderFrame* render_frame, | 509 RenderFrame* render_frame, |
487 blink::WebFrame* frame, | 510 blink::WebFrame* frame, |
488 blink::WebDataSource::ExtraData* extraData, | 511 blink::WebDataSource::ExtraData* extraData, |
489 const blink::WebURLRequest& request, | 512 const blink::WebURLRequest& request, |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 | 681 |
659 // The push messaging dispatcher attached to this frame, lazily initialized. | 682 // The push messaging dispatcher attached to this frame, lazily initialized. |
660 PushMessagingDispatcher* push_messaging_dispatcher_; | 683 PushMessagingDispatcher* push_messaging_dispatcher_; |
661 | 684 |
662 ServiceRegistryImpl service_registry_; | 685 ServiceRegistryImpl service_registry_; |
663 | 686 |
664 // The screen orientation dispatcher attached to the frame, lazily | 687 // The screen orientation dispatcher attached to the frame, lazily |
665 // initialized. | 688 // initialized. |
666 ScreenOrientationDispatcher* screen_orientation_dispatcher_; | 689 ScreenOrientationDispatcher* screen_orientation_dispatcher_; |
667 | 690 |
| 691 // The current accessibility mode. |
| 692 AccessibilityMode accessibility_mode_; |
| 693 |
| 694 // Only valid if |accessibility_mode_| is anything other than |
| 695 // AccessibilityModeOff. |
| 696 RendererAccessibility* renderer_accessibility_; |
| 697 |
668 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 698 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
669 | 699 |
670 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 700 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
671 }; | 701 }; |
672 | 702 |
673 } // namespace content | 703 } // namespace content |
674 | 704 |
675 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 705 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |