Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: content/renderer/render_frame_impl.h

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

Powered by Google App Engine
This is Rietveld 408576698