| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_ | 5 #ifndef CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_ |
| 6 #define CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_ | 6 #define CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 | 11 |
| 12 class RenderViewImpl; | |
| 13 | |
| 14 namespace WebKit { | 12 namespace WebKit { |
| 15 class WebFrame; | 13 class WebFrame; |
| 16 } | 14 } |
| 17 | 15 |
| 16 namespace content { |
| 17 class RenderViewImpl; |
| 18 |
| 18 class LoadProgressTracker { | 19 class LoadProgressTracker { |
| 19 public: | 20 public: |
| 20 explicit LoadProgressTracker(RenderViewImpl* render_view); | 21 explicit LoadProgressTracker(RenderViewImpl* render_view); |
| 21 ~LoadProgressTracker(); | 22 ~LoadProgressTracker(); |
| 22 | 23 |
| 23 void DidStopLoading(); | 24 void DidStopLoading(); |
| 24 | 25 |
| 25 void DidChangeLoadProgress(WebKit::WebFrame* frame, double progress); | 26 void DidChangeLoadProgress(WebKit::WebFrame* frame, double progress); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 void ResetStates(); | 29 void ResetStates(); |
| 29 | 30 |
| 30 void SendChangeLoadProgress(); | 31 void SendChangeLoadProgress(); |
| 31 | 32 |
| 32 RenderViewImpl* render_view_; | 33 RenderViewImpl* render_view_; |
| 33 | 34 |
| 34 WebKit::WebFrame* tracked_frame_; | 35 WebKit::WebFrame* tracked_frame_; |
| 35 | 36 |
| 36 double progress_; | 37 double progress_; |
| 37 | 38 |
| 38 base::TimeTicks last_time_progress_sent_; | 39 base::TimeTicks last_time_progress_sent_; |
| 39 | 40 |
| 40 base::WeakPtrFactory<LoadProgressTracker> weak_factory_; | 41 base::WeakPtrFactory<LoadProgressTracker> weak_factory_; |
| 41 | 42 |
| 42 DISALLOW_COPY_AND_ASSIGN(LoadProgressTracker); | 43 DISALLOW_COPY_AND_ASSIGN(LoadProgressTracker); |
| 43 }; | 44 }; |
| 44 | 45 |
| 46 } // namespace content |
| 47 |
| 45 #endif // CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_ | 48 #endif // CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_ |
| OLD | NEW |