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

Unified Diff: blimp/engine/session/page_load_tracker.cc

Issue 2629743003: Remove all blimp engine code (Closed)
Patch Set: Use consistent comment style in //chrome 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/engine/session/page_load_tracker.h ('k') | blimp/engine/session/tab.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/session/page_load_tracker.cc
diff --git a/blimp/engine/session/page_load_tracker.cc b/blimp/engine/session/page_load_tracker.cc
deleted file mode 100644
index 3345d06dcacfff1ced389b7631cc025d5e229e11..0000000000000000000000000000000000000000
--- a/blimp/engine/session/page_load_tracker.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "blimp/engine/session/page_load_tracker.h"
-
-#include "content/public/browser/navigation_handle.h"
-#include "content/public/browser/render_widget_host_view.h"
-
-namespace blimp {
-namespace engine {
-
-namespace {
-
-bool ShouldIgnoreNavigation(content::NavigationHandle* navigation_handle) {
- // We change the progress bar for main frame navigations only.
- if (!navigation_handle->IsInMainFrame())
- return true;
-
- // Same page navigations don't need to trigger a progress bar update.
- if (navigation_handle->IsSamePage())
- return true;
-
- return false;
-}
-
-} // namespace
-
-PageLoadTracker::PageLoadTracker(content::WebContents* web_contents,
- PageLoadTrackerClient* client)
- : client_(client) {
- DCHECK(web_contents);
- Observe(web_contents);
-}
-
-PageLoadTracker::~PageLoadTracker() {}
-
-void PageLoadTracker::DidStartNavigation(
- content::NavigationHandle* navigation_handle) {
- if (ShouldIgnoreNavigation(navigation_handle))
- return;
-
- // Cancel any pending callbacks for the previous navigation. We will send an
- // update based on the progress of this navigation.
- did_paint_after_navigation_callback_.Cancel();
- client_->SendPageLoadStatusUpdate(PageLoadStatus::LOADING);
-}
-
-void PageLoadTracker::DidFinishNavigation(
- content::NavigationHandle* navigation_handle) {
- if (ShouldIgnoreNavigation(navigation_handle))
- return;
-
- if (navigation_handle->HasCommitted()) {
- // Make sure that at least one compositor content update after the
- // navigation commits is sent to the client.
- // Note that a visual state update in our case implies that this callback
- // will be invoked after the update is queued to be sent to the client.
- did_paint_after_navigation_callback_.Reset(
- base::Bind(&PageLoadTracker::DidPaintAfterNavigationCommitted,
- base::Unretained(this)));
- navigation_handle->GetRenderFrameHost()->InsertVisualStateCallback(
- did_paint_after_navigation_callback_.callback());
- } else {
- // Inform the client to update the progress bar right away.
- client_->SendPageLoadStatusUpdate(PageLoadStatus::LOADED);
- }
-}
-
-void PageLoadTracker::DidPaintAfterNavigationCommitted(bool result) {
- client_->SendPageLoadStatusUpdate(PageLoadStatus::LOADED);
-}
-
-} // namespace engine
-} // namespace blimp
« no previous file with comments | « blimp/engine/session/page_load_tracker.h ('k') | blimp/engine/session/tab.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698