blob: 490bd820d635a3a4092f42e6bc194b97c0375749 [file] [log] [blame]
[email protected]90109412010-12-15 17:14:241// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// 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"
9#include "base/task.h"
10#include "base/time.h"
11
12class RenderView;
13
14namespace WebKit {
15class WebFrame;
16}
17
18class LoadProgressTracker {
19 public:
20 explicit LoadProgressTracker(RenderView* render_view);
21 ~LoadProgressTracker();
22
23 void DidStopLoading();
24
25 void DidChangeLoadProgress(WebKit::WebFrame* frame, double progress);
26
27 private:
28 void ResetStates();
29
30 void SendChangeLoadProgress();
31
32 RenderView* render_view_;
33
34 WebKit::WebFrame* tracked_frame_;
35
36 double progress_;
37
38 base::TimeTicks last_time_progress_sent_;
39
40 ScopedRunnableMethodFactory<LoadProgressTracker> method_factory_;
41
42 DISALLOW_COPY_AND_ASSIGN(LoadProgressTracker);
43};
44
[email protected]921f1592011-03-18 00:41:0245#endif // CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_