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 #include "chrome/browser/automation/automation_tab_helper.h" | 5 #include "chrome/browser/automation/automation_tab_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "content/browser/tab_contents/navigation_controller.h" | 9 #include "content/browser/tab_contents/navigation_controller.h" |
10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 LOG(WARNING) << "Received DidStopLoading while loading already stopped."; | 80 LOG(WARNING) << "Received DidStopLoading while loading already stopped."; |
81 return; | 81 return; |
82 } | 82 } |
83 is_loading_ = false; | 83 is_loading_ = false; |
84 if (!has_pending_loads()) { | 84 if (!has_pending_loads()) { |
85 FOR_EACH_OBSERVER(TabEventObserver, observers_, | 85 FOR_EACH_OBSERVER(TabEventObserver, observers_, |
86 OnNoMorePendingLoads(tab_contents())); | 86 OnNoMorePendingLoads(tab_contents())); |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 void AutomationTabHelper::RenderViewGone() { | 90 void AutomationTabHelper::RenderViewGone(base::TerminationStatus status) { |
91 OnTabOrRenderViewDestroyed(tab_contents()); | 91 OnTabOrRenderViewDestroyed(tab_contents()); |
92 } | 92 } |
93 | 93 |
94 void AutomationTabHelper::TabContentsDestroyed(TabContents* tab_contents) { | 94 void AutomationTabHelper::TabContentsDestroyed(TabContents* tab_contents) { |
95 OnTabOrRenderViewDestroyed(tab_contents); | 95 OnTabOrRenderViewDestroyed(tab_contents); |
96 } | 96 } |
97 | 97 |
98 void AutomationTabHelper::OnTabOrRenderViewDestroyed( | 98 void AutomationTabHelper::OnTabOrRenderViewDestroyed( |
99 TabContents* tab_contents) { | 99 TabContents* tab_contents) { |
100 if (has_pending_loads()) { | 100 if (has_pending_loads()) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // It is possible that we did not track the redirect becasue it had a non-zero | 155 // It is possible that we did not track the redirect becasue it had a non-zero |
156 // delay. See the comment in |OnWillPerformClientRedirect|. | 156 // delay. See the comment in |OnWillPerformClientRedirect|. |
157 if (iter != pending_client_redirects_.end()) { | 157 if (iter != pending_client_redirects_.end()) { |
158 pending_client_redirects_.erase(iter); | 158 pending_client_redirects_.erase(iter); |
159 if (!has_pending_loads()) { | 159 if (!has_pending_loads()) { |
160 FOR_EACH_OBSERVER(TabEventObserver, observers_, | 160 FOR_EACH_OBSERVER(TabEventObserver, observers_, |
161 OnNoMorePendingLoads(tab_contents())); | 161 OnNoMorePendingLoads(tab_contents())); |
162 } | 162 } |
163 } | 163 } |
164 } | 164 } |
OLD | NEW |