blob: cfcd5a892cf785d8c33d26a6c3f510df4d871e51 [file] [log] [blame]
[email protected]32876ae2011-11-15 22:25:211// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]90109412010-12-15 17:14:242// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]921f1592011-03-18 00:41:025#ifndef CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_
6#define CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_
[email protected]90109412010-12-15 17:14:247
8#include "base/logging.h"
[email protected]32876ae2011-11-15 22:25:219#include "base/memory/weak_ptr.h"
[email protected]90109412010-12-15 17:14:2410#include "base/time.h"
11
[email protected]90109412010-12-15 17:14:2412namespace WebKit {
13class WebFrame;
14}
15
[email protected]e9ff79c2012-10-19 21:31:2616namespace content {
17class RenderViewImpl;
18
[email protected]90109412010-12-15 17:14:2419class LoadProgressTracker {
20 public:
[email protected]310ebd6302011-10-10 19:06:2821 explicit LoadProgressTracker(RenderViewImpl* render_view);
[email protected]90109412010-12-15 17:14:2422 ~LoadProgressTracker();
23
24 void DidStopLoading();
25
26 void DidChangeLoadProgress(WebKit::WebFrame* frame, double progress);
27
28 private:
29 void ResetStates();
30
31 void SendChangeLoadProgress();
32
[email protected]310ebd6302011-10-10 19:06:2833 RenderViewImpl* render_view_;
[email protected]90109412010-12-15 17:14:2434
35 WebKit::WebFrame* tracked_frame_;
36
37 double progress_;
38
39 base::TimeTicks last_time_progress_sent_;
40
[email protected]32876ae2011-11-15 22:25:2141 base::WeakPtrFactory<LoadProgressTracker> weak_factory_;
[email protected]90109412010-12-15 17:14:2442
43 DISALLOW_COPY_AND_ASSIGN(LoadProgressTracker);
44};
45
[email protected]e9ff79c2012-10-19 21:31:2646} // namespace content
47
[email protected]921f1592011-03-18 00:41:0248#endif // CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_