| 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/render_frame_proxy.h" | 22 #include "content/renderer/render_frame_proxy.h" |
| 22 #include "content/renderer/renderer_webcookiejar_impl.h" | 23 #include "content/renderer/renderer_webcookiejar_impl.h" |
| 23 #include "ipc/ipc_message.h" | 24 #include "ipc/ipc_message.h" |
| 25 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 24 #include "third_party/WebKit/public/web/WebDataSource.h" | 26 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 25 #include "third_party/WebKit/public/web/WebFrameClient.h" | 27 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 26 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 28 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
| 27 #include "ui/gfx/range/range.h" | 29 #include "ui/gfx/range/range.h" |
| 28 | 30 |
| 29 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
| 30 #include "content/renderer/media/android/renderer_media_player_manager.h" | 32 #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 31 #endif | 33 #endif |
| 32 | 34 |
| 33 class TransportDIB; | 35 class TransportDIB; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 54 class Range; | 56 class Range; |
| 55 class Rect; | 57 class Rect; |
| 56 } | 58 } |
| 57 | 59 |
| 58 namespace content { | 60 namespace content { |
| 59 | 61 |
| 60 class ChildFrameCompositingHelper; | 62 class ChildFrameCompositingHelper; |
| 61 class MediaStreamRendererFactory; | 63 class MediaStreamRendererFactory; |
| 62 class NotificationProvider; | 64 class NotificationProvider; |
| 63 class PepperPluginInstanceImpl; | 65 class PepperPluginInstanceImpl; |
| 66 class RendererAccessibility; |
| 64 class RendererPpapiHost; | 67 class RendererPpapiHost; |
| 65 class RenderFrameObserver; | 68 class RenderFrameObserver; |
| 66 class RenderViewImpl; | 69 class RenderViewImpl; |
| 67 class RenderWidget; | 70 class RenderWidget; |
| 68 class RenderWidgetFullscreenPepper; | 71 class RenderWidgetFullscreenPepper; |
| 69 struct CustomContextMenuContext; | 72 struct CustomContextMenuContext; |
| 70 | 73 |
| 71 #if defined(OS_ANDROID) | 74 #if defined(OS_ANDROID) |
| 72 class RendererMediaPlayerManager; | 75 class RendererMediaPlayerManager; |
| 73 #endif | 76 #endif |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // Start/Stop loading notifications. | 137 // Start/Stop loading notifications. |
| 135 // TODO(nasko): Those are page-level methods at this time and come from | 138 // TODO(nasko): Those are page-level methods at this time and come from |
| 136 // WebViewClient. We should move them to be WebFrameClient calls and put | 139 // WebViewClient. We should move them to be WebFrameClient calls and put |
| 137 // logic in the browser side to balance starts/stops. | 140 // logic in the browser side to balance starts/stops. |
| 138 // |to_different_document| will be true unless the load is a fragment | 141 // |to_different_document| will be true unless the load is a fragment |
| 139 // navigation, or triggered by history.pushState/replaceState. | 142 // navigation, or triggered by history.pushState/replaceState. |
| 140 virtual void didStartLoading(bool to_different_document); | 143 virtual void didStartLoading(bool to_different_document); |
| 141 virtual void didStopLoading(); | 144 virtual void didStopLoading(); |
| 142 virtual void didChangeLoadProgress(double load_progress); | 145 virtual void didChangeLoadProgress(double load_progress); |
| 143 | 146 |
| 147 AccessibilityMode accessibility_mode() { |
| 148 return accessibility_mode_; |
| 149 } |
| 150 |
| 151 RendererAccessibility* renderer_accessibility() { |
| 152 return renderer_accessibility_; |
| 153 } |
| 154 |
| 155 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj, |
| 156 blink::WebAXEvent event); |
| 157 |
| 158 // TODO(dmazzoni): the only reason this is here is to plumb it through to |
| 159 // RendererAccessibility. It should be part of RenderFrameObserver, once |
| 160 // blink has a separate accessibility tree per frame. |
| 161 void FocusedNodeChanged(const blink::WebNode& node); |
| 162 |
| 144 #if defined(ENABLE_PLUGINS) | 163 #if defined(ENABLE_PLUGINS) |
| 145 // Notification that a PPAPI plugin has been created. | 164 // Notification that a PPAPI plugin has been created. |
| 146 void PepperPluginCreated(RendererPpapiHost* host); | 165 void PepperPluginCreated(RendererPpapiHost* host); |
| 147 | 166 |
| 148 // Notifies that |instance| has changed the cursor. | 167 // Notifies that |instance| has changed the cursor. |
| 149 // This will update the cursor appearance if it is currently over the plugin | 168 // This will update the cursor appearance if it is currently over the plugin |
| 150 // instance. | 169 // instance. |
| 151 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, | 170 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
| 152 const blink::WebCursorInfo& cursor); | 171 const blink::WebCursorInfo& cursor); |
| 153 | 172 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 410 |
| 392 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move | 411 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move |
| 393 // this back to private member. | 412 // this back to private member. |
| 394 void OnNavigate(const FrameMsg_Navigate_Params& params); | 413 void OnNavigate(const FrameMsg_Navigate_Params& params); |
| 395 | 414 |
| 396 protected: | 415 protected: |
| 397 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); | 416 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
| 398 | 417 |
| 399 private: | 418 private: |
| 400 friend class RenderFrameObserver; | 419 friend class RenderFrameObserver; |
| 420 friend class RendererAccessibilityTest; |
| 401 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, | 421 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, |
| 402 AccessibilityMessagesQueueWhileSwappedOut); | 422 AccessibilityMessagesQueueWhileSwappedOut); |
| 403 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | 423 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 404 ShouldUpdateSelectionTextFromContextMenuParams); | 424 ShouldUpdateSelectionTextFromContextMenuParams); |
| 405 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 425 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 406 OnExtendSelectionAndDelete); | 426 OnExtendSelectionAndDelete); |
| 407 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); | 427 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); |
| 408 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); | 428 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); |
| 409 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 429 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 410 SetEditableSelectionAndComposition); | 430 SetEditableSelectionAndComposition); |
| 431 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 432 OnSetAccessibilityMode); |
| 411 | 433 |
| 412 typedef std::map<GURL, double> HostZoomLevels; | 434 typedef std::map<GURL, double> HostZoomLevels; |
| 413 | 435 |
| 414 // Functions to add and remove observers for this object. | 436 // Functions to add and remove observers for this object. |
| 415 void AddObserver(RenderFrameObserver* observer); | 437 void AddObserver(RenderFrameObserver* observer); |
| 416 void RemoveObserver(RenderFrameObserver* observer); | 438 void RemoveObserver(RenderFrameObserver* observer); |
| 417 | 439 |
| 418 void UpdateURL(blink::WebFrame* frame); | 440 void UpdateURL(blink::WebFrame* frame); |
| 419 | 441 |
| 420 // Gets the focused element. If no such element exists then the element will | 442 // Gets the focused element. If no such element exists then the element will |
| (...skipping 28 matching lines...) Expand all Loading... |
| 449 void OnCSSInsertRequest(const std::string& css); | 471 void OnCSSInsertRequest(const std::string& css); |
| 450 void OnJavaScriptExecuteRequest(const base::string16& javascript, | 472 void OnJavaScriptExecuteRequest(const base::string16& javascript, |
| 451 int id, | 473 int id, |
| 452 bool notify_result); | 474 bool notify_result); |
| 453 void OnSetEditableSelectionOffsets(int start, int end); | 475 void OnSetEditableSelectionOffsets(int start, int end); |
| 454 void OnSetCompositionFromExistingText( | 476 void OnSetCompositionFromExistingText( |
| 455 int start, int end, | 477 int start, int end, |
| 456 const std::vector<blink::WebCompositionUnderline>& underlines); | 478 const std::vector<blink::WebCompositionUnderline>& underlines); |
| 457 void OnExtendSelectionAndDelete(int before, int after); | 479 void OnExtendSelectionAndDelete(int before, int after); |
| 458 void OnReload(bool ignore_cache); | 480 void OnReload(bool ignore_cache); |
| 481 void OnSetAccessibilityMode(AccessibilityMode new_mode); |
| 459 #if defined(OS_MACOSX) | 482 #if defined(OS_MACOSX) |
| 460 void OnCopyToFindPboard(); | 483 void OnCopyToFindPboard(); |
| 461 #endif | 484 #endif |
| 462 | 485 |
| 463 // Virtual since overridden by WebTestProxy for layout tests. | 486 // Virtual since overridden by WebTestProxy for layout tests. |
| 464 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( | 487 virtual blink::WebNavigationPolicy DecidePolicyForNavigation( |
| 465 RenderFrame* render_frame, | 488 RenderFrame* render_frame, |
| 466 blink::WebFrame* frame, | 489 blink::WebFrame* frame, |
| 467 blink::WebDataSource::ExtraData* extraData, | 490 blink::WebDataSource::ExtraData* extraData, |
| 468 const blink::WebURLRequest& request, | 491 const blink::WebURLRequest& request, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 624 |
| 602 blink::WebUserMediaClient* web_user_media_client_; | 625 blink::WebUserMediaClient* web_user_media_client_; |
| 603 | 626 |
| 604 #if defined(OS_ANDROID) | 627 #if defined(OS_ANDROID) |
| 605 // Manages all media players in this render frame for communicating with the | 628 // Manages all media players in this render frame for communicating with the |
| 606 // real media player and CDM objects in the browser process. It's okay to use | 629 // real media player and CDM objects in the browser process. It's okay to use |
| 607 // raw pointers since it's a RenderFrameObserver. | 630 // raw pointers since it's a RenderFrameObserver. |
| 608 RendererMediaPlayerManager* media_player_manager_; | 631 RendererMediaPlayerManager* media_player_manager_; |
| 609 #endif | 632 #endif |
| 610 | 633 |
| 634 // The current accessibility mode. |
| 635 AccessibilityMode accessibility_mode_; |
| 636 |
| 637 // Only valid if |accessibility_mode_| is anything other than |
| 638 // AccessibilityModeOff. |
| 639 RendererAccessibility* renderer_accessibility_; |
| 640 |
| 611 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 641 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 612 | 642 |
| 613 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 643 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 614 }; | 644 }; |
| 615 | 645 |
| 616 } // namespace content | 646 } // namespace content |
| 617 | 647 |
| 618 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 648 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |