| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // 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 | 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/renderer/load_progress_tracker.h" | 5 #include "content/renderer/load_progress_tracker.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
| 9 #include "content/renderer/render_view.h" | 9 #include "content/renderer/render_view_impl.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 const int kMinimumDelayBetweenUpdatesMS = 100; | 13 const int kMinimumDelayBetweenUpdatesMS = 100; |
| 14 | 14 |
| 15 } | 15 } |
| 16 | 16 |
| 17 LoadProgressTracker::LoadProgressTracker(RenderView* render_view) | 17 LoadProgressTracker::LoadProgressTracker(RenderViewImpl* render_view) |
| 18 : render_view_(render_view), | 18 : render_view_(render_view), |
| 19 tracked_frame_(NULL), | 19 tracked_frame_(NULL), |
| 20 progress_(0.0), | 20 progress_(0.0), |
| 21 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { | 21 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { |
| 22 } | 22 } |
| 23 | 23 |
| 24 LoadProgressTracker::~LoadProgressTracker() { | 24 LoadProgressTracker::~LoadProgressTracker() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void LoadProgressTracker::DidStopLoading() { | 27 void LoadProgressTracker::DidStopLoading() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 new ViewHostMsg_DidChangeLoadProgress(render_view_->routing_id(), | 77 new ViewHostMsg_DidChangeLoadProgress(render_view_->routing_id(), |
| 78 progress_)); | 78 progress_)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void LoadProgressTracker::ResetStates() { | 81 void LoadProgressTracker::ResetStates() { |
| 82 tracked_frame_ = NULL; | 82 tracked_frame_ = NULL; |
| 83 progress_ = 0.0; | 83 progress_ = 0.0; |
| 84 method_factory_.RevokeAll(); | 84 method_factory_.RevokeAll(); |
| 85 last_time_progress_sent_ = base::TimeTicks(); | 85 last_time_progress_sent_ = base::TimeTicks(); |
| 86 } | 86 } |
| OLD | NEW |