| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 void MaybeEnableMojoBindings(); | 730 void MaybeEnableMojoBindings(); |
| 731 // Adds the given file chooser request to the file_chooser_completion_ queue | 731 // Adds the given file chooser request to the file_chooser_completion_ queue |
| 732 // (see that var for more) and requests the chooser be displayed if there are | 732 // (see that var for more) and requests the chooser be displayed if there are |
| 733 // no other waiting items in the queue. | 733 // no other waiting items in the queue. |
| 734 // | 734 // |
| 735 // Returns true if the chooser was successfully scheduled. False means we | 735 // Returns true if the chooser was successfully scheduled. False means we |
| 736 // didn't schedule anything. | 736 // didn't schedule anything. |
| 737 bool ScheduleFileChooser(const FileChooserParams& params, | 737 bool ScheduleFileChooser(const FileChooserParams& params, |
| 738 blink::WebFileChooserCompletion* completion); | 738 blink::WebFileChooserCompletion* completion); |
| 739 | 739 |
| 740 bool handling_select_range() const { return handling_select_range_; } |
| 741 |
| 742 void set_is_pasting(bool value) { is_pasting_ = value; } |
| 743 |
| 744 void set_handling_select_range(bool value) { handling_select_range_ = value; } |
| 745 |
| 740 // Plugin-related functions -------------------------------------------------- | 746 // Plugin-related functions -------------------------------------------------- |
| 741 | 747 |
| 742 #if BUILDFLAG(ENABLE_PLUGINS) | 748 #if BUILDFLAG(ENABLE_PLUGINS) |
| 743 PepperPluginInstanceImpl* focused_pepper_plugin() { | 749 PepperPluginInstanceImpl* focused_pepper_plugin() { |
| 744 return focused_pepper_plugin_; | 750 return focused_pepper_plugin_; |
| 745 } | 751 } |
| 746 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { | 752 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { |
| 747 return pepper_last_mouse_event_target_; | 753 return pepper_last_mouse_event_target_; |
| 748 } | 754 } |
| 749 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { | 755 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { |
| 750 pepper_last_mouse_event_target_ = plugin; | 756 pepper_last_mouse_event_target_ = plugin; |
| 751 } | 757 } |
| 752 | 758 |
| 753 // Indicates that the given instance has been created. | 759 // Indicates that the given instance has been created. |
| 754 void PepperInstanceCreated(PepperPluginInstanceImpl* instance); | 760 void PepperInstanceCreated(PepperPluginInstanceImpl* instance); |
| 755 | 761 |
| 756 // Indicates that the given instance is being destroyed. This is called from | 762 // Indicates that the given instance is being destroyed. This is called from |
| 757 // the destructor, so it's important that the instance is not dereferenced | 763 // the destructor, so it's important that the instance is not dereferenced |
| 758 // from this call. | 764 // from this call. |
| 759 void PepperInstanceDeleted(PepperPluginInstanceImpl* instance); | 765 void PepperInstanceDeleted(PepperPluginInstanceImpl* instance); |
| 760 | 766 |
| 761 // Notification that the given plugin is focused or unfocused. | 767 // Notification that the given plugin is focused or unfocused. |
| 762 void PepperFocusChanged(PepperPluginInstanceImpl* instance, bool focused); | 768 void PepperFocusChanged(PepperPluginInstanceImpl* instance, bool focused); |
| 763 | 769 |
| 764 void PepperStartsPlayback(PepperPluginInstanceImpl* instance); | 770 void PepperStartsPlayback(PepperPluginInstanceImpl* instance); |
| 765 void PepperStopsPlayback(PepperPluginInstanceImpl* instance); | 771 void PepperStopsPlayback(PepperPluginInstanceImpl* instance); |
| 766 void OnSetPepperVolume(int32_t pp_instance, double volume); | 772 void OnSetPepperVolume(int32_t pp_instance, double volume); |
| 767 #endif // ENABLE_PLUGINS | 773 #endif // ENABLE_PLUGINS |
| 768 | 774 |
| 775 #if defined(OS_MACOSX) |
| 776 void OnCopyToFindPboard(); |
| 777 #endif |
| 778 |
| 779 // Dispatches the current state of selection on the webpage to the browser if |
| 780 // it has changed. |
| 781 // TODO(varunjain): delete this method once we figure out how to keep |
| 782 // selection handles in sync with the webpage. |
| 783 void SyncSelectionIfRequired(bool user_initiated); |
| 784 |
| 769 protected: | 785 protected: |
| 770 explicit RenderFrameImpl(const CreateParams& params); | 786 explicit RenderFrameImpl(const CreateParams& params); |
| 771 | 787 |
| 772 private: | 788 private: |
| 773 friend class RenderFrameImplTest; | 789 friend class RenderFrameImplTest; |
| 774 friend class RenderFrameObserver; | 790 friend class RenderFrameObserver; |
| 775 friend class RenderAccessibilityImplTest; | 791 friend class RenderAccessibilityImplTest; |
| 776 friend class TestRenderFrame; | 792 friend class TestRenderFrame; |
| 777 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); | 793 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
| 778 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); | 794 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 | 970 |
| 955 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 971 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
| 956 #if defined(OS_MACOSX) | 972 #if defined(OS_MACOSX) |
| 957 void OnSelectPopupMenuItem(int selected_index); | 973 void OnSelectPopupMenuItem(int selected_index); |
| 958 #else | 974 #else |
| 959 void OnSelectPopupMenuItems(bool canceled, | 975 void OnSelectPopupMenuItems(bool canceled, |
| 960 const std::vector<int>& selected_indices); | 976 const std::vector<int>& selected_indices); |
| 961 #endif | 977 #endif |
| 962 #endif | 978 #endif |
| 963 | 979 |
| 964 #if defined(OS_MACOSX) | |
| 965 void OnCopyToFindPboard(); | |
| 966 #endif | |
| 967 | |
| 968 // Callback scheduled from OnSerializeAsMHTML for when writing serialized | 980 // Callback scheduled from OnSerializeAsMHTML for when writing serialized |
| 969 // MHTML to file has been completed in the file thread. | 981 // MHTML to file has been completed in the file thread. |
| 970 void OnWriteMHTMLToDiskComplete( | 982 void OnWriteMHTMLToDiskComplete( |
| 971 int job_id, | 983 int job_id, |
| 972 std::set<std::string> serialized_resources_uri_digests, | 984 std::set<std::string> serialized_resources_uri_digests, |
| 973 base::TimeDelta main_thread_use_time, | 985 base::TimeDelta main_thread_use_time, |
| 974 MhtmlSaveStatus save_status); | 986 MhtmlSaveStatus save_status); |
| 975 | 987 |
| 976 // Requests that the browser process navigates to |url|. If | 988 // Requests that the browser process navigates to |url|. If |
| 977 // |is_history_navigation_in_new_child| is true, the browser process should | 989 // |is_history_navigation_in_new_child| is true, the browser process should |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 // b) function:DidReceiveTitle. When this function is called, | 1022 // b) function:DidReceiveTitle. When this function is called, |
| 1011 // that means we have got specified title. Because in most of webpages, | 1023 // that means we have got specified title. Because in most of webpages, |
| 1012 // title tags will follow meta tags. In here we try to get encoding of | 1024 // title tags will follow meta tags. In here we try to get encoding of |
| 1013 // page if it has been specified in meta tag. | 1025 // page if it has been specified in meta tag. |
| 1014 // c) function:DidFinishDocumentLoadForFrame. When this function is | 1026 // c) function:DidFinishDocumentLoadForFrame. When this function is |
| 1015 // called, that means we have got whole html page. In here we should | 1027 // called, that means we have got whole html page. In here we should |
| 1016 // finally get right encoding of page. | 1028 // finally get right encoding of page. |
| 1017 void UpdateEncoding(blink::WebFrame* frame, | 1029 void UpdateEncoding(blink::WebFrame* frame, |
| 1018 const std::string& encoding_name); | 1030 const std::string& encoding_name); |
| 1019 | 1031 |
| 1020 // Dispatches the current state of selection on the webpage to the browser if | |
| 1021 // it has changed. | |
| 1022 // TODO(varunjain): delete this method once we figure out how to keep | |
| 1023 // selection handles in sync with the webpage. | |
| 1024 void SyncSelectionIfRequired(bool user_initiated); | |
| 1025 | |
| 1026 bool RunJavaScriptDialog(JavaScriptDialogType type, | 1032 bool RunJavaScriptDialog(JavaScriptDialogType type, |
| 1027 const base::string16& message, | 1033 const base::string16& message, |
| 1028 const base::string16& default_value, | 1034 const base::string16& default_value, |
| 1029 const GURL& frame_url, | 1035 const GURL& frame_url, |
| 1030 base::string16* result); | 1036 base::string16* result); |
| 1031 | 1037 |
| 1032 // Loads the appropriate error page for the specified failure into the frame. | 1038 // Loads the appropriate error page for the specified failure into the frame. |
| 1033 // |entry| is only used by PlzNavigate when navigating to a history item. | 1039 // |entry| is only used by PlzNavigate when navigating to a history item. |
| 1034 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request, | 1040 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request, |
| 1035 const blink::WebURLError& error, | 1041 const blink::WebURLError& error, |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; | 1484 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; |
| 1479 | 1485 |
| 1480 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1486 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 1481 | 1487 |
| 1482 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1488 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 1483 }; | 1489 }; |
| 1484 | 1490 |
| 1485 } // namespace content | 1491 } // namespace content |
| 1486 | 1492 |
| 1487 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1493 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |