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

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

Issue 2746043003: Fix user agent overridding with PlzNavigate. (Closed)
Patch Set: without PlzNavigate Created 3 years, 9 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 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after
3419 return true; 3419 return true;
3420 return delegate_->ShouldTransferNavigation(is_main_frame_navigation); 3420 return delegate_->ShouldTransferNavigation(is_main_frame_navigation);
3421 } 3421 }
3422 3422
3423 bool WebContentsImpl::ShouldPreserveAbortedURLs() { 3423 bool WebContentsImpl::ShouldPreserveAbortedURLs() {
3424 if (!delegate_) 3424 if (!delegate_)
3425 return false; 3425 return false;
3426 return delegate_->ShouldPreserveAbortedURLs(this); 3426 return delegate_->ShouldPreserveAbortedURLs(this);
3427 } 3427 }
3428 3428
3429 const std::string& WebContentsImpl::GetNavigationUserAgentOverride() {
3430 return renderer_preferences_.user_agent_override;
3431 }
3432
3429 void WebContentsImpl::DidNavigateMainFramePreCommit( 3433 void WebContentsImpl::DidNavigateMainFramePreCommit(
3430 bool navigation_is_within_page) { 3434 bool navigation_is_within_page) {
3431 // Ensure fullscreen mode is exited before committing the navigation to a 3435 // Ensure fullscreen mode is exited before committing the navigation to a
3432 // different page. The next page will not start out assuming it is in 3436 // different page. The next page will not start out assuming it is in
3433 // fullscreen mode. 3437 // fullscreen mode.
3434 if (navigation_is_within_page) { 3438 if (navigation_is_within_page) {
3435 // No page change? Then, the renderer and browser can remain in fullscreen. 3439 // No page change? Then, the renderer and browser can remain in fullscreen.
3436 return; 3440 return;
3437 } 3441 }
3438 if (IsFullscreenForCurrentTab()) 3442 if (IsFullscreenForCurrentTab())
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
5394 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5398 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5395 if (!render_view_host) 5399 if (!render_view_host)
5396 continue; 5400 continue;
5397 render_view_host_set.insert(render_view_host); 5401 render_view_host_set.insert(render_view_host);
5398 } 5402 }
5399 for (RenderViewHost* render_view_host : render_view_host_set) 5403 for (RenderViewHost* render_view_host : render_view_host_set)
5400 render_view_host->OnWebkitPreferencesChanged(); 5404 render_view_host->OnWebkitPreferencesChanged();
5401 } 5405 }
5402 5406
5403 } // namespace content 5407 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698