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

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

Issue 297973002: Navigation transitions: Block first response until after transitions have run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review. Created 6 years, 6 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 <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 // RenderFrameHostDelegate --------------------------------------------------- 322 // RenderFrameHostDelegate ---------------------------------------------------
323 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, 323 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host,
324 const IPC::Message& message) OVERRIDE; 324 const IPC::Message& message) OVERRIDE;
325 virtual const GURL& GetMainFrameLastCommittedURL() const OVERRIDE; 325 virtual const GURL& GetMainFrameLastCommittedURL() const OVERRIDE;
326 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE; 326 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE;
327 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) OVERRIDE; 327 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) OVERRIDE;
328 virtual void DidStartLoading(RenderFrameHost* render_frame_host, 328 virtual void DidStartLoading(RenderFrameHost* render_frame_host,
329 bool to_different_document) OVERRIDE; 329 bool to_different_document) OVERRIDE;
330 virtual void SwappedOut(RenderFrameHost* render_frame_host) OVERRIDE; 330 virtual void SwappedOut(RenderFrameHost* render_frame_host) OVERRIDE;
331 virtual void DidDeferAfterResponseStarted() OVERRIDE;
332 virtual bool WillHandleDeferAfterResponseStarted() OVERRIDE;
331 virtual void WorkerCrashed(RenderFrameHost* render_frame_host) OVERRIDE; 333 virtual void WorkerCrashed(RenderFrameHost* render_frame_host) OVERRIDE;
332 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, 334 virtual void ShowContextMenu(RenderFrameHost* render_frame_host,
333 const ContextMenuParams& params) OVERRIDE; 335 const ContextMenuParams& params) OVERRIDE;
334 virtual void RunJavaScriptMessage(RenderFrameHost* render_frame_host, 336 virtual void RunJavaScriptMessage(RenderFrameHost* render_frame_host,
335 const base::string16& message, 337 const base::string16& message,
336 const base::string16& default_prompt, 338 const base::string16& default_prompt,
337 const GURL& frame_url, 339 const GURL& frame_url,
338 JavaScriptMessageType type, 340 JavaScriptMessageType type,
339 IPC::Message* reply_msg) OVERRIDE; 341 IPC::Message* reply_msg) OVERRIDE;
340 virtual void RunBeforeUnloadConfirm(RenderFrameHost* render_frame_host, 342 virtual void RunBeforeUnloadConfirm(RenderFrameHost* render_frame_host,
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 bool is_loading, 620 bool is_loading,
619 bool to_different_document, 621 bool to_different_document,
620 LoadNotificationDetails* details) OVERRIDE; 622 LoadNotificationDetails* details) OVERRIDE;
621 623
622 typedef base::Callback<void(WebContents*)> CreatedCallback; 624 typedef base::Callback<void(WebContents*)> CreatedCallback;
623 625
624 // Requests the renderer to select the region between two points in the 626 // Requests the renderer to select the region between two points in the
625 // currently focused frame. 627 // currently focused frame.
626 void SelectRange(const gfx::Point& start, const gfx::Point& end); 628 void SelectRange(const gfx::Point& start, const gfx::Point& end);
627 629
630 // Notifies the TransitionRequestManager that the main frame navigation is
631 // a transition navigation.
632 void SetHasPendingTransitionRequest(bool has_pending_transition);
633
634 // Notifies the main frame that it can continue navigation (if it was deferred
635 // immediately at first response).
636 void ResumeResponseDeferredAtStart();
637
638 typedef base::Callback<void()> DidDeferCallback;
639
640 // Callback to be used when the WebContentsImpl handles a navigation
641 // transition.
642 void set_did_defer_callback_for_testing(const DidDeferCallback& callback) {
643 did_defer_callback_for_testing_ = callback;
shatch 2014/06/14 00:41:37 Wanted a way to get a callback for the browsertest
644 }
645
628 private: 646 private:
629 friend class TestNavigationObserver; 647 friend class TestNavigationObserver;
630 friend class WebContentsAddedObserver; 648 friend class WebContentsAddedObserver;
631 friend class WebContentsObserver; 649 friend class WebContentsObserver;
632 friend class WebContents; // To implement factory methods. 650 friend class WebContents; // To implement factory methods.
633 651
634 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials); 652 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials);
635 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle); 653 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle);
636 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FindOpenerRVHWhenPending); 654 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FindOpenerRVHWhenPending);
637 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, 655 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; 1139 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap;
1122 ImageDownloadMap image_download_map_; 1140 ImageDownloadMap image_download_map_;
1123 1141
1124 // Whether this WebContents is responsible for displaying a subframe in a 1142 // Whether this WebContents is responsible for displaying a subframe in a
1125 // different process from its parent page. 1143 // different process from its parent page.
1126 bool is_subframe_; 1144 bool is_subframe_;
1127 1145
1128 // Whether the last JavaScript dialog shown was suppressed. Used for testing. 1146 // Whether the last JavaScript dialog shown was suppressed. Used for testing.
1129 bool last_dialog_suppressed_; 1147 bool last_dialog_suppressed_;
1130 1148
1149 DidDeferCallback did_defer_callback_for_testing_;
1150
1131 scoped_ptr<GeolocationDispatcherHost> geolocation_dispatcher_host_; 1151 scoped_ptr<GeolocationDispatcherHost> geolocation_dispatcher_host_;
1132 1152
1133 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 1153 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
1134 }; 1154 };
1135 1155
1136 } // namespace content 1156 } // namespace content
1137 1157
1138 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1158 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/transition_request_message_filter.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