| 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 21 matching lines...) Expand all Loading... |
| 56 | 58 |
| 57 namespace content { | 59 namespace content { |
| 58 | 60 |
| 59 class ChildFrameCompositingHelper; | 61 class ChildFrameCompositingHelper; |
| 60 class GeolocationDispatcher; | 62 class GeolocationDispatcher; |
| 61 class MediaStreamRendererFactory; | 63 class MediaStreamRendererFactory; |
| 62 class MidiDispatcher; | 64 class MidiDispatcher; |
| 63 class NotificationProvider; | 65 class NotificationProvider; |
| 64 class PepperPluginInstanceImpl; | 66 class PepperPluginInstanceImpl; |
| 65 class PushMessagingDispatcher; | 67 class PushMessagingDispatcher; |
| 68 class RendererAccessibility; |
| 66 class RendererCdmManager; | 69 class RendererCdmManager; |
| 67 class RendererMediaPlayerManager; | 70 class RendererMediaPlayerManager; |
| 68 class RendererPpapiHost; | 71 class RendererPpapiHost; |
| 69 class RenderFrameObserver; | 72 class RenderFrameObserver; |
| 70 class RenderViewImpl; | 73 class RenderViewImpl; |
| 71 class RenderWidget; | 74 class RenderWidget; |
| 72 class RenderWidgetFullscreenPepper; | 75 class RenderWidgetFullscreenPepper; |
| 73 class ScreenOrientationDispatcher; | 76 class ScreenOrientationDispatcher; |
| 74 struct CustomContextMenuContext; | 77 struct CustomContextMenuContext; |
| 75 | 78 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Start/Stop loading notifications. | 142 // Start/Stop loading notifications. |
| 140 // TODO(nasko): Those are page-level methods at this time and come from | 143 // TODO(nasko): Those are page-level methods at this time and come from |
| 141 // WebViewClient. We should move them to be WebFrameClient calls and put | 144 // WebViewClient. We should move them to be WebFrameClient calls and put |
| 142 // logic in the browser side to balance starts/stops. | 145 // logic in the browser side to balance starts/stops. |
| 143 // |to_different_document| will be true unless the load is a fragment | 146 // |to_different_document| will be true unless the load is a fragment |
| 144 // navigation, or triggered by history.pushState/replaceState. | 147 // navigation, or triggered by history.pushState/replaceState. |
| 145 virtual void didStartLoading(bool to_different_document); | 148 virtual void didStartLoading(bool to_different_document); |
| 146 virtual void didStopLoading(); | 149 virtual void didStopLoading(); |
| 147 virtual void didChangeLoadProgress(double load_progress); | 150 virtual void didChangeLoadProgress(double load_progress); |
| 148 | 151 |
| 152 AccessibilityMode accessibility_mode() { |
| 153 return accessibility_mode_; |
| 154 } |
| 155 |
| 156 RendererAccessibility* renderer_accessibility() { |
| 157 return renderer_accessibility_; |
| 158 } |
| 159 |
| 160 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj, |
| 161 blink::WebAXEvent event); |
| 162 |
| 163 // TODO(dmazzoni): the only reason this is here is to plumb it through to |
| 164 // RendererAccessibility. It should be part of RenderFrameObserver, once |
| 165 // blink has a separate accessibility tree per frame. |
| 166 void FocusedNodeChanged(const blink::WebNode& node); |
| 167 |
| 149 #if defined(ENABLE_PLUGINS) | 168 #if defined(ENABLE_PLUGINS) |
| 150 // Notification that a PPAPI plugin has been created. | 169 // Notification that a PPAPI plugin has been created. |
| 151 void PepperPluginCreated(RendererPpapiHost* host); | 170 void PepperPluginCreated(RendererPpapiHost* host); |
| 152 | 171 |
| 153 // Notifies that |instance| has changed the cursor. | 172 // Notifies that |instance| has changed the cursor. |
| 154 // This will update the cursor appearance if it is currently over the plugin | 173 // This will update the cursor appearance if it is currently over the plugin |
| 155 // instance. | 174 // instance. |
| 156 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, | 175 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
| 157 const blink::WebCursorInfo& cursor); | 176 const blink::WebCursorInfo& cursor); |
| 158 | 177 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 // Binds this render frame's service registry to a handle to the remote | 424 // Binds this render frame's service registry to a handle to the remote |
| 406 // service registry. | 425 // service registry. |
| 407 void BindServiceRegistry( | 426 void BindServiceRegistry( |
| 408 mojo::ScopedMessagePipeHandle service_provider_handle); | 427 mojo::ScopedMessagePipeHandle service_provider_handle); |
| 409 | 428 |
| 410 protected: | 429 protected: |
| 411 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); | 430 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
| 412 | 431 |
| 413 private: | 432 private: |
| 414 friend class RenderFrameObserver; | 433 friend class RenderFrameObserver; |
| 434 friend class RendererAccessibilityTest; |
| 415 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, | 435 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, |
| 416 AccessibilityMessagesQueueWhileSwappedOut); | 436 AccessibilityMessagesQueueWhileSwappedOut); |
| 417 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | 437 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 418 ShouldUpdateSelectionTextFromContextMenuParams); | 438 ShouldUpdateSelectionTextFromContextMenuParams); |
| 419 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 439 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 420 OnExtendSelectionAndDelete); | 440 OnExtendSelectionAndDelete); |
| 421 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); | 441 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); |
| 422 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); | 442 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); |
| 423 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 443 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 424 SetEditableSelectionAndComposition); | 444 SetEditableSelectionAndComposition); |
| 445 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 446 OnSetAccessibilityMode); |
| 425 | 447 |
| 426 typedef std::map<GURL, double> HostZoomLevels; | 448 typedef std::map<GURL, double> HostZoomLevels; |
| 427 | 449 |
| 428 // Functions to add and remove observers for this object. | 450 // Functions to add and remove observers for this object. |
| 429 void AddObserver(RenderFrameObserver* observer); | 451 void AddObserver(RenderFrameObserver* observer); |
| 430 void RemoveObserver(RenderFrameObserver* observer); | 452 void RemoveObserver(RenderFrameObserver* observer); |
| 431 | 453 |
| 432 void UpdateURL(blink::WebFrame* frame); | 454 void UpdateURL(blink::WebFrame* frame); |
| 433 | 455 |
| 434 // Gets the focused element. If no such element exists then the element will | 456 // Gets the focused element. If no such element exists then the element will |
| (...skipping 27 matching lines...) Expand all Loading... |
| 462 int id, | 484 int id, |
| 463 bool notify_result); | 485 bool notify_result); |
| 464 void OnSetEditableSelectionOffsets(int start, int end); | 486 void OnSetEditableSelectionOffsets(int start, int end); |
| 465 void OnSetCompositionFromExistingText( | 487 void OnSetCompositionFromExistingText( |
| 466 int start, int end, | 488 int start, int end, |
| 467 const std::vector<blink::WebCompositionUnderline>& underlines); | 489 const std::vector<blink::WebCompositionUnderline>& underlines); |
| 468 void OnExtendSelectionAndDelete(int before, int after); | 490 void OnExtendSelectionAndDelete(int before, int after); |
| 469 void OnReload(bool ignore_cache); | 491 void OnReload(bool ignore_cache); |
| 470 void OnTextSurroundingSelectionRequest(size_t max_length); | 492 void OnTextSurroundingSelectionRequest(size_t max_length); |
| 471 void OnAddStyleSheetByURL(const std::string& url); | 493 void OnAddStyleSheetByURL(const std::string& url); |
| 494 void OnSetAccessibilityMode(AccessibilityMode new_mode); |
| 472 #if defined(OS_MACOSX) | 495 #if defined(OS_MACOSX) |
| 473 void OnCopyToFindPboard(); | 496 void OnCopyToFindPboard(); |
| 474 #endif | 497 #endif |
| 475 | 498 |
| 476 // Virtual since overridden by WebTestProxy for layout tests. | 499 // Virtual since overridden by WebTestProxy for layout tests. |
| 477 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( | 500 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( |
| 478 RenderFrame* render_frame, | 501 RenderFrame* render_frame, |
| 479 blink::WebFrame* frame, | 502 blink::WebFrame* frame, |
| 480 blink::WebDataSource::ExtraData* extraData, | 503 blink::WebDataSource::ExtraData* extraData, |
| 481 const blink::WebURLRequest& request, | 504 const blink::WebURLRequest& request, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 | 672 |
| 650 // The push messaging dispatcher attached to this frame, lazily initialized. | 673 // The push messaging dispatcher attached to this frame, lazily initialized. |
| 651 PushMessagingDispatcher* push_messaging_dispatcher_; | 674 PushMessagingDispatcher* push_messaging_dispatcher_; |
| 652 | 675 |
| 653 ServiceRegistryImpl service_registry_; | 676 ServiceRegistryImpl service_registry_; |
| 654 | 677 |
| 655 // The screen orientation dispatcher attached to the frame, lazily | 678 // The screen orientation dispatcher attached to the frame, lazily |
| 656 // initialized. | 679 // initialized. |
| 657 ScreenOrientationDispatcher* screen_orientation_dispatcher_; | 680 ScreenOrientationDispatcher* screen_orientation_dispatcher_; |
| 658 | 681 |
| 682 // The current accessibility mode. |
| 683 AccessibilityMode accessibility_mode_; |
| 684 |
| 685 // Only valid if |accessibility_mode_| is anything other than |
| 686 // AccessibilityModeOff. |
| 687 RendererAccessibility* renderer_accessibility_; |
| 688 |
| 659 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 689 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 660 | 690 |
| 661 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 691 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 662 }; | 692 }; |
| 663 | 693 |
| 664 } // namespace content | 694 } // namespace content |
| 665 | 695 |
| 666 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 696 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |