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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 161113002: Fix pushState causing stop/reload button and favicon to flicker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | Annotate | Revision Log
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 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/metrics/user_metrics_action.h" 9 #include "base/metrics/user_metrics_action.h"
10 #include "content/browser/child_process_security_policy_impl.h" 10 #include "content/browser/child_process_security_policy_impl.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 void RenderFrameHostImpl::SwapOut() { 366 void RenderFrameHostImpl::SwapOut() {
367 if (render_view_host_->IsRenderViewLive()) { 367 if (render_view_host_->IsRenderViewLive()) {
368 Send(new FrameMsg_SwapOut(routing_id_)); 368 Send(new FrameMsg_SwapOut(routing_id_));
369 } else { 369 } else {
370 // Our RenderViewHost doesn't have a live renderer, so just skip the unload 370 // Our RenderViewHost doesn't have a live renderer, so just skip the unload
371 // event. 371 // event.
372 OnSwappedOut(true); 372 OnSwappedOut(true);
373 } 373 }
374 } 374 }
375 375
376 void RenderFrameHostImpl::OnDidStartLoading() { 376 void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) {
377 delegate_->DidStartLoading(this); 377 delegate_->DidStartLoading(this, to_different_document);
378 } 378 }
379 379
380 void RenderFrameHostImpl::OnDidStopLoading() { 380 void RenderFrameHostImpl::OnDidStopLoading() {
381 delegate_->DidStopLoading(this); 381 delegate_->DidStopLoading(this);
382 } 382 }
383 383
384 void RenderFrameHostImpl::OnSwapOutACK() { 384 void RenderFrameHostImpl::OnSwapOutACK() {
385 OnSwappedOut(false); 385 OnSwappedOut(false);
386 } 386 }
387 387
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 // browser. But we want to keep the throbber in sync with what's happening 457 // browser. But we want to keep the throbber in sync with what's happening
458 // in the UI. For example, we want to start throbbing immediately when the 458 // in the UI. For example, we want to start throbbing immediately when the
459 // user naivgates even if the renderer is delayed. There is also an issue 459 // user naivgates even if the renderer is delayed. There is also an issue
460 // with the throbber starting because the WebUI (which controls whether the 460 // with the throbber starting because the WebUI (which controls whether the
461 // favicon is displayed) happens synchronously. If the start loading 461 // favicon is displayed) happens synchronously. If the start loading
462 // messages was asynchronous, then the default favicon would flash in. 462 // messages was asynchronous, then the default favicon would flash in.
463 // 463 //
464 // Blink doesn't send throb notifications for JavaScript URLs, so we 464 // Blink doesn't send throb notifications for JavaScript URLs, so we
465 // don't want to either. 465 // don't want to either.
466 if (!params.url.SchemeIs(kJavaScriptScheme)) 466 if (!params.url.SchemeIs(kJavaScriptScheme))
467 delegate_->DidStartLoading(this); 467 delegate_->DidStartLoading(this, true);
468 } 468 }
469 469
470 void RenderFrameHostImpl::NavigateToURL(const GURL& url) { 470 void RenderFrameHostImpl::NavigateToURL(const GURL& url) {
471 FrameMsg_Navigate_Params params; 471 FrameMsg_Navigate_Params params;
472 params.page_id = -1; 472 params.page_id = -1;
473 params.pending_history_list_offset = -1; 473 params.pending_history_list_offset = -1;
474 params.current_history_list_offset = -1; 474 params.current_history_list_offset = -1;
475 params.current_history_list_length = 0; 475 params.current_history_list_length = 0;
476 params.url = url; 476 params.url = url;
477 params.transition = PAGE_TRANSITION_LINK; 477 params.transition = PAGE_TRANSITION_LINK;
478 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; 478 params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
479 Navigate(params); 479 Navigate(params);
480 } 480 }
481 481
482 } // namespace content 482 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698