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

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

Issue 317703004: Simplify AreURLsInPageNavigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Kill the renderer if it claims a cross-origin in-page navigation 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 | Annotate | Revision Log
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 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after
2409 observers_, 2409 observers_,
2410 DidCommitProvisionalLoadForFrame(render_frame_id, 2410 DidCommitProvisionalLoadForFrame(render_frame_id,
2411 frame_unique_name, 2411 frame_unique_name,
2412 is_main_frame, 2412 is_main_frame,
2413 url, 2413 url,
2414 transition_type, 2414 transition_type,
2415 render_view_host)); 2415 render_view_host));
2416 } 2416 }
2417 2417
2418 void WebContentsImpl::DidNavigateMainFramePreCommit( 2418 void WebContentsImpl::DidNavigateMainFramePreCommit(
2419 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { 2419 bool navigation_is_within_page) {
2420 // Ensure fullscreen mode is exited before committing the navigation to a 2420 // Ensure fullscreen mode is exited before committing the navigation to a
2421 // different page. The next page will not start out assuming it is in 2421 // different page. The next page will not start out assuming it is in
2422 // fullscreen mode. 2422 // fullscreen mode.
2423 if (controller_.IsURLInPageNavigation(params.url, 2423 if (navigation_is_within_page) {
2424 params.was_within_same_page,
2425 NAVIGATION_TYPE_UNKNOWN)) {
2426 // No page change? Then, the renderer and browser can remain in fullscreen. 2424 // No page change? Then, the renderer and browser can remain in fullscreen.
2427 return; 2425 return;
2428 } 2426 }
2429 if (IsFullscreenForCurrentTab()) 2427 if (IsFullscreenForCurrentTab())
2430 GetRenderViewHost()->ExitFullscreen(); 2428 GetRenderViewHost()->ExitFullscreen();
2431 DCHECK(!IsFullscreenForCurrentTab()); 2429 DCHECK(!IsFullscreenForCurrentTab());
2432 } 2430 }
2433 2431
2434 void WebContentsImpl::DidNavigateMainFramePostCommit( 2432 void WebContentsImpl::DidNavigateMainFramePostCommit(
2435 const LoadCommittedDetails& details, 2433 const LoadCommittedDetails& details,
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
4050 4048
4051 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 4049 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
4052 if (!delegate_) 4050 if (!delegate_)
4053 return; 4051 return;
4054 const gfx::Size new_size = GetPreferredSize(); 4052 const gfx::Size new_size = GetPreferredSize();
4055 if (new_size != old_size) 4053 if (new_size != old_size)
4056 delegate_->UpdatePreferredSize(this, new_size); 4054 delegate_->UpdatePreferredSize(this, new_size);
4057 } 4055 }
4058 4056
4059 } // namespace content 4057 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698