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

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 2506183002: Make window.open() IPCs be frame-based (Closed)
Patch Set: Rebase. Created 3 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <functional> 10 #include <functional>
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 bool ShouldRouteMessageEvent( 480 bool ShouldRouteMessageEvent(
481 RenderFrameHost* target_rfh, 481 RenderFrameHost* target_rfh,
482 SiteInstance* source_site_instance) const override; 482 SiteInstance* source_site_instance) const override;
483 void EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) override; 483 void EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) override;
484 std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( 484 std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost(
485 const GURL& url) override; 485 const GURL& url) override;
486 void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) override; 486 void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) override;
487 void OnFocusedElementChangedInFrame( 487 void OnFocusedElementChangedInFrame(
488 RenderFrameHostImpl* frame, 488 RenderFrameHostImpl* frame,
489 const gfx::Rect& bounds_in_root_view) override; 489 const gfx::Rect& bounds_in_root_view) override;
490 void CreateNewWindow(
491 SiteInstance* source_site_instance,
492 int32_t render_view_route_id,
493 int32_t main_frame_route_id,
494 int32_t main_frame_widget_route_id,
495 const mojom::CreateNewWindowParams& params,
496 SessionStorageNamespace* session_storage_namespace) override;
497 void ShowCreatedWindow(int process_id,
498 int main_frame_widget_route_id,
499 WindowOpenDisposition disposition,
500 const gfx::Rect& initial_rect,
501 bool user_gesture) override;
490 502
491 // RenderViewHostDelegate ---------------------------------------------------- 503 // RenderViewHostDelegate ----------------------------------------------------
492 RenderViewHostDelegateView* GetDelegateView() override; 504 RenderViewHostDelegateView* GetDelegateView() override;
493 bool OnMessageReceived(RenderViewHostImpl* render_view_host, 505 bool OnMessageReceived(RenderViewHostImpl* render_view_host,
494 const IPC::Message& message) override; 506 const IPC::Message& message) override;
495 // RenderFrameHostDelegate has the same method, so list it there because this 507 // RenderFrameHostDelegate has the same method, so list it there because this
496 // interface is going away. 508 // interface is going away.
497 // WebContents* GetAsWebContents() override; 509 // WebContents* GetAsWebContents() override;
498 void RenderViewCreated(RenderViewHost* render_view_host) override; 510 void RenderViewCreated(RenderViewHost* render_view_host) override;
499 void RenderViewReady(RenderViewHost* render_view_host) override; 511 void RenderViewReady(RenderViewHost* render_view_host) override;
(...skipping 14 matching lines...) Expand all
514 const base::string16& message, 526 const base::string16& message,
515 int32_t line_no, 527 int32_t line_no,
516 const base::string16& source_id) override; 528 const base::string16& source_id) override;
517 RendererPreferences GetRendererPrefs( 529 RendererPreferences GetRendererPrefs(
518 BrowserContext* browser_context) const override; 530 BrowserContext* browser_context) const override;
519 void OnUserInteraction(RenderWidgetHostImpl* render_widget_host, 531 void OnUserInteraction(RenderWidgetHostImpl* render_widget_host,
520 const blink::WebInputEvent::Type type) override; 532 const blink::WebInputEvent::Type type) override;
521 void OnIgnoredUIEvent() override; 533 void OnIgnoredUIEvent() override;
522 void Activate() override; 534 void Activate() override;
523 void UpdatePreferredSize(const gfx::Size& pref_size) override; 535 void UpdatePreferredSize(const gfx::Size& pref_size) override;
524 void CreateNewWindow(
525 SiteInstance* source_site_instance,
526 int32_t route_id,
527 int32_t main_frame_route_id,
528 int32_t main_frame_widget_route_id,
529 const mojom::CreateNewWindowParams& params,
530 SessionStorageNamespace* session_storage_namespace) override;
531 void CreateNewWidget(int32_t render_process_id, 536 void CreateNewWidget(int32_t render_process_id,
532 int32_t route_id, 537 int32_t route_id,
533 blink::WebPopupType popup_type) override; 538 blink::WebPopupType popup_type) override;
534 void CreateNewFullscreenWidget(int32_t render_process_id, 539 void CreateNewFullscreenWidget(int32_t render_process_id,
535 int32_t route_id) override; 540 int32_t route_id) override;
536 void ShowCreatedWindow(int process_id,
537 int route_id,
538 WindowOpenDisposition disposition,
539 const gfx::Rect& initial_rect,
540 bool user_gesture) override;
541 void ShowCreatedWidget(int process_id, 541 void ShowCreatedWidget(int process_id,
542 int route_id, 542 int route_id,
543 const gfx::Rect& initial_rect) override; 543 const gfx::Rect& initial_rect) override;
544 void ShowCreatedFullscreenWidget(int process_id, int route_id) override; 544 void ShowCreatedFullscreenWidget(int process_id, int route_id) override;
545 void RequestMediaAccessPermission( 545 void RequestMediaAccessPermission(
546 const MediaStreamRequest& request, 546 const MediaStreamRequest& request,
547 const MediaResponseCallback& callback) override; 547 const MediaResponseCallback& callback) override;
548 bool CheckMediaAccessPermission(const GURL& security_origin, 548 bool CheckMediaAccessPermission(const GURL& security_origin,
549 MediaStreamType type) override; 549 MediaStreamType type) override;
550 SessionStorageNamespace* GetSessionStorageNamespace( 550 SessionStorageNamespace* GetSessionStorageNamespace(
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 799
800 private: 800 private:
801 friend class WebContentsObserver; 801 friend class WebContentsObserver;
802 friend class WebContents; // To implement factory methods. 802 friend class WebContents; // To implement factory methods.
803 803
804 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials); 804 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials);
805 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle); 805 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle);
806 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FindOpenerRVHWhenPending); 806 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FindOpenerRVHWhenPending);
807 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, 807 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
808 CrossSiteCantPreemptAfterUnload); 808 CrossSiteCantPreemptAfterUnload);
809 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, PendingContents); 809 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, PendingContentsDestroyed);
810 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, PendingContentsShown);
810 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FrameTreeShape); 811 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FrameTreeShape);
811 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, GetLastActiveTime); 812 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, GetLastActiveTime);
812 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, 813 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
813 LoadResourceFromMemoryCacheWithBadSecurityInfo); 814 LoadResourceFromMemoryCacheWithBadSecurityInfo);
814 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, 815 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
815 LoadResourceWithEmptySecurityInfo); 816 LoadResourceWithEmptySecurityInfo);
816 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, 817 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
817 ResetJavaScriptDialogOnUserNavigate); 818 ResetJavaScriptDialogOnUserNavigate);
818 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles); 819 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles);
819 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate); 820 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 // Helper for ShowCreatedWidget/ShowCreatedFullscreenWidget. 1086 // Helper for ShowCreatedWidget/ShowCreatedFullscreenWidget.
1086 void ShowCreatedWidget(int process_id, 1087 void ShowCreatedWidget(int process_id,
1087 int route_id, 1088 int route_id,
1088 bool is_fullscreen, 1089 bool is_fullscreen,
1089 const gfx::Rect& initial_rect); 1090 const gfx::Rect& initial_rect);
1090 1091
1091 // Finds the new RenderWidgetHost and returns it. Note that this can only be 1092 // Finds the new RenderWidgetHost and returns it. Note that this can only be
1092 // called once as this call also removes it from the internal map. 1093 // called once as this call also removes it from the internal map.
1093 RenderWidgetHostView* GetCreatedWidget(int process_id, int route_id); 1094 RenderWidgetHostView* GetCreatedWidget(int process_id, int route_id);
1094 1095
1095 // Finds the new WebContentsImpl by route_id, initializes it for 1096 // Finds the new WebContentsImpl by |main_frame_widget_route_id|, initializes
1096 // renderer-initiated creation, and returns it. Note that this can only be 1097 // it for renderer-initiated creation, and returns it. Note that this can only
1097 // called once as this call also removes it from the internal map. 1098 // be called once as this call also removes it from the internal map.
1098 WebContentsImpl* GetCreatedWindow(int process_id, int route_id); 1099 WebContentsImpl* GetCreatedWindow(int process_id,
1100 int main_frame_widget_route_id);
1099 1101
1100 // Sends a Page message IPC. 1102 // Sends a Page message IPC.
1101 void SendPageMessage(IPC::Message* msg); 1103 void SendPageMessage(IPC::Message* msg);
1102 1104
1103 // Tracking loading progress ------------------------------------------------- 1105 // Tracking loading progress -------------------------------------------------
1104 1106
1105 // Resets the tracking state of the current load progress. 1107 // Resets the tracking state of the current load progress.
1106 void ResetLoadProgressState(); 1108 void ResetLoadProgressState();
1107 1109
1108 // Notifies the delegate that the load progress was updated. 1110 // Notifies the delegate that the load progress was updated.
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 // Adds/removes a callback called on creation of each new WebContents. 1516 // Adds/removes a callback called on creation of each new WebContents.
1515 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1517 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1516 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1518 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1517 1519
1518 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1520 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1519 }; 1521 };
1520 1522
1521 } // namespace content 1523 } // namespace content
1522 1524
1523 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1525 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698