| 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/public/common/javascript_message_type.h" | 18 #include "content/public/common/javascript_message_type.h" |
| 18 #include "content/public/common/referrer.h" | 19 #include "content/public/common/referrer.h" |
| 19 #include "content/public/renderer/render_frame.h" | 20 #include "content/public/renderer/render_frame.h" |
| 20 #include "content/renderer/media/webmediaplayer_delegate.h" | 21 #include "content/renderer/media/webmediaplayer_delegate.h" |
| 21 #include "content/renderer/renderer_webcookiejar_impl.h" | 22 #include "content/renderer/renderer_webcookiejar_impl.h" |
| 22 #include "ipc/ipc_message.h" | 23 #include "ipc/ipc_message.h" |
| 24 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 23 #include "third_party/WebKit/public/web/WebDataSource.h" | 25 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 24 #include "third_party/WebKit/public/web/WebFrameClient.h" | 26 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 25 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 27 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
| 26 #include "ui/gfx/range/range.h" | 28 #include "ui/gfx/range/range.h" |
| 27 | 29 |
| 28 class TransportDIB; | 30 class TransportDIB; |
| 29 struct FrameMsg_BuffersSwapped_Params; | 31 struct FrameMsg_BuffersSwapped_Params; |
| 30 struct FrameMsg_CompositorFrameSwapped_Params; | 32 struct FrameMsg_CompositorFrameSwapped_Params; |
| 31 struct FrameMsg_Navigate_Params; | 33 struct FrameMsg_Navigate_Params; |
| 32 | 34 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 49 class Range; | 51 class Range; |
| 50 class Rect; | 52 class Rect; |
| 51 } | 53 } |
| 52 | 54 |
| 53 namespace content { | 55 namespace content { |
| 54 | 56 |
| 55 class ChildFrameCompositingHelper; | 57 class ChildFrameCompositingHelper; |
| 56 class MediaStreamClient; | 58 class MediaStreamClient; |
| 57 class NotificationProvider; | 59 class NotificationProvider; |
| 58 class PepperPluginInstanceImpl; | 60 class PepperPluginInstanceImpl; |
| 61 class RendererAccessibility; |
| 59 class RendererPpapiHost; | 62 class RendererPpapiHost; |
| 60 class RenderFrameObserver; | 63 class RenderFrameObserver; |
| 61 class RenderViewImpl; | 64 class RenderViewImpl; |
| 62 class RenderWidget; | 65 class RenderWidget; |
| 63 class RenderWidgetFullscreenPepper; | 66 class RenderWidgetFullscreenPepper; |
| 64 struct CustomContextMenuContext; | 67 struct CustomContextMenuContext; |
| 65 | 68 |
| 66 class CONTENT_EXPORT RenderFrameImpl | 69 class CONTENT_EXPORT RenderFrameImpl |
| 67 : public RenderFrame, | 70 : public RenderFrame, |
| 68 NON_EXPORTED_BASE(public blink::WebFrameClient), | 71 NON_EXPORTED_BASE(public blink::WebFrameClient), |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Start/Stop loading notifications. | 119 // Start/Stop loading notifications. |
| 117 // TODO(nasko): Those are page-level methods at this time and come from | 120 // TODO(nasko): Those are page-level methods at this time and come from |
| 118 // WebViewClient. We should move them to be WebFrameClient calls and put | 121 // WebViewClient. We should move them to be WebFrameClient calls and put |
| 119 // logic in the browser side to balance starts/stops. | 122 // logic in the browser side to balance starts/stops. |
| 120 // |to_different_document| will be true unless the load is a fragment | 123 // |to_different_document| will be true unless the load is a fragment |
| 121 // navigation, or triggered by history.pushState/replaceState. | 124 // navigation, or triggered by history.pushState/replaceState. |
| 122 virtual void didStartLoading(bool to_different_document); | 125 virtual void didStartLoading(bool to_different_document); |
| 123 virtual void didStopLoading(); | 126 virtual void didStopLoading(); |
| 124 virtual void didChangeLoadProgress(double load_progress); | 127 virtual void didChangeLoadProgress(double load_progress); |
| 125 | 128 |
| 129 AccessibilityMode accessibility_mode() { |
| 130 return accessibility_mode_; |
| 131 } |
| 132 |
| 133 RendererAccessibility* renderer_accessibility() { |
| 134 return renderer_accessibility_; |
| 135 } |
| 136 |
| 137 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj, |
| 138 blink::WebAXEvent event); |
| 139 |
| 126 #if defined(ENABLE_PLUGINS) | 140 #if defined(ENABLE_PLUGINS) |
| 127 // Notification that a PPAPI plugin has been created. | 141 // Notification that a PPAPI plugin has been created. |
| 128 void PepperPluginCreated(RendererPpapiHost* host); | 142 void PepperPluginCreated(RendererPpapiHost* host); |
| 129 | 143 |
| 130 // Notifies that |instance| has changed the cursor. | 144 // Notifies that |instance| has changed the cursor. |
| 131 // This will update the cursor appearance if it is currently over the plugin | 145 // This will update the cursor appearance if it is currently over the plugin |
| 132 // instance. | 146 // instance. |
| 133 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, | 147 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
| 134 const blink::WebCursorInfo& cursor); | 148 const blink::WebCursorInfo& cursor); |
| 135 | 149 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 391 |
| 378 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move | 392 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move |
| 379 // this back to private member. | 393 // this back to private member. |
| 380 void OnNavigate(const FrameMsg_Navigate_Params& params); | 394 void OnNavigate(const FrameMsg_Navigate_Params& params); |
| 381 | 395 |
| 382 protected: | 396 protected: |
| 383 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); | 397 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
| 384 | 398 |
| 385 private: | 399 private: |
| 386 friend class RenderFrameObserver; | 400 friend class RenderFrameObserver; |
| 401 friend class RendererAccessibilityTest; |
| 402 friend class RenderViewImplTest; |
| 387 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, | 403 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, |
| 388 AccessibilityMessagesQueueWhileSwappedOut); | 404 AccessibilityMessagesQueueWhileSwappedOut); |
| 389 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | 405 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 390 ShouldUpdateSelectionTextFromContextMenuParams); | 406 ShouldUpdateSelectionTextFromContextMenuParams); |
| 391 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 407 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 392 OnExtendSelectionAndDelete); | 408 OnExtendSelectionAndDelete); |
| 393 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); | 409 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); |
| 394 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); | 410 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); |
| 395 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 411 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 396 SetEditableSelectionAndComposition); | 412 SetEditableSelectionAndComposition); |
| 413 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 414 OnSetAccessibilityMode); |
| 397 | 415 |
| 398 typedef std::map<GURL, double> HostZoomLevels; | 416 typedef std::map<GURL, double> HostZoomLevels; |
| 399 | 417 |
| 400 // Functions to add and remove observers for this object. | 418 // Functions to add and remove observers for this object. |
| 401 void AddObserver(RenderFrameObserver* observer); | 419 void AddObserver(RenderFrameObserver* observer); |
| 402 void RemoveObserver(RenderFrameObserver* observer); | 420 void RemoveObserver(RenderFrameObserver* observer); |
| 403 | 421 |
| 404 void UpdateURL(blink::WebFrame* frame); | 422 void UpdateURL(blink::WebFrame* frame); |
| 405 | 423 |
| 406 // Gets the focused element. If no such element exists then the element will | 424 // Gets the focused element. If no such element exists then the element will |
| (...skipping 28 matching lines...) Expand all Loading... |
| 435 void OnCSSInsertRequest(const std::string& css); | 453 void OnCSSInsertRequest(const std::string& css); |
| 436 void OnJavaScriptExecuteRequest(const base::string16& javascript, | 454 void OnJavaScriptExecuteRequest(const base::string16& javascript, |
| 437 int id, | 455 int id, |
| 438 bool notify_result); | 456 bool notify_result); |
| 439 void OnSetEditableSelectionOffsets(int start, int end); | 457 void OnSetEditableSelectionOffsets(int start, int end); |
| 440 void OnSetCompositionFromExistingText( | 458 void OnSetCompositionFromExistingText( |
| 441 int start, int end, | 459 int start, int end, |
| 442 const std::vector<blink::WebCompositionUnderline>& underlines); | 460 const std::vector<blink::WebCompositionUnderline>& underlines); |
| 443 void OnExtendSelectionAndDelete(int before, int after); | 461 void OnExtendSelectionAndDelete(int before, int after); |
| 444 void OnReload(bool ignore_cache); | 462 void OnReload(bool ignore_cache); |
| 463 void OnSetAccessibilityMode(AccessibilityMode new_mode); |
| 445 #if defined(OS_MACOSX) | 464 #if defined(OS_MACOSX) |
| 446 void OnCopyToFindPboard(); | 465 void OnCopyToFindPboard(); |
| 447 #endif | 466 #endif |
| 448 | 467 |
| 449 // Virtual since overridden by WebTestProxy for layout tests. | 468 // Virtual since overridden by WebTestProxy for layout tests. |
| 450 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( | 469 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( |
| 451 RenderFrame* render_frame, | 470 RenderFrame* render_frame, |
| 452 blink::WebFrame* frame, | 471 blink::WebFrame* frame, |
| 453 blink::WebDataSource::ExtraData* extraData, | 472 blink::WebDataSource::ExtraData* extraData, |
| 454 const blink::WebURLRequest& request, | 473 const blink::WebURLRequest& request, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 // along with the RenderFrame automatically. This is why we just store weak | 575 // along with the RenderFrame automatically. This is why we just store weak |
| 557 // references. | 576 // references. |
| 558 | 577 |
| 559 // Holds a reference to the service which provides desktop notifications. | 578 // Holds a reference to the service which provides desktop notifications. |
| 560 NotificationProvider* notification_provider_; | 579 NotificationProvider* notification_provider_; |
| 561 | 580 |
| 562 // MediaStreamClient attached to this frame; lazily initialized. | 581 // MediaStreamClient attached to this frame; lazily initialized. |
| 563 MediaStreamClient* media_stream_client_; | 582 MediaStreamClient* media_stream_client_; |
| 564 blink::WebUserMediaClient* web_user_media_client_; | 583 blink::WebUserMediaClient* web_user_media_client_; |
| 565 | 584 |
| 585 // The current accessibility mode. |
| 586 AccessibilityMode accessibility_mode_; |
| 587 |
| 588 // Only valid if |accessibility_mode_| is anything other than |
| 589 // AccessibilityModeOff. |
| 590 RendererAccessibility* renderer_accessibility_; |
| 591 |
| 566 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 592 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 567 | 593 |
| 568 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 594 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 569 }; | 595 }; |
| 570 | 596 |
| 571 } // namespace content | 597 } // namespace content |
| 572 | 598 |
| 573 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 599 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |