OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/common/automation_messages.h" | 9 #include "chrome/common/automation_messages.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
12 #include "ipc/ipc_message_macros.h" | 12 #include "ipc/ipc_message_macros.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 | 14 |
15 using content::WebContents; | 15 using content::WebContents; |
16 | 16 |
17 int AutomationTabHelper::kUserDataKey; | 17 DEFINE_WEB_CONTENTS_USER_DATA_KEY(AutomationTabHelper) |
18 | 18 |
19 TabEventObserver::TabEventObserver() { } | 19 TabEventObserver::TabEventObserver() { } |
20 | 20 |
21 TabEventObserver::~TabEventObserver() { | 21 TabEventObserver::~TabEventObserver() { |
22 for (size_t i = 0; i < event_sources_.size(); ++i) { | 22 for (size_t i = 0; i < event_sources_.size(); ++i) { |
23 if (event_sources_[i]) | 23 if (event_sources_[i]) |
24 event_sources_[i]->RemoveObserver(this); | 24 event_sources_[i]->RemoveObserver(this); |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // It is possible that we did not track the redirect becasue it had a non-zero | 165 // It is possible that we did not track the redirect becasue it had a non-zero |
166 // delay. See the comment in |OnWillPerformClientRedirect|. | 166 // delay. See the comment in |OnWillPerformClientRedirect|. |
167 if (iter != pending_client_redirects_.end()) { | 167 if (iter != pending_client_redirects_.end()) { |
168 pending_client_redirects_.erase(iter); | 168 pending_client_redirects_.erase(iter); |
169 if (!has_pending_loads()) { | 169 if (!has_pending_loads()) { |
170 FOR_EACH_OBSERVER(TabEventObserver, observers_, | 170 FOR_EACH_OBSERVER(TabEventObserver, observers_, |
171 OnNoMorePendingLoads(web_contents())); | 171 OnNoMorePendingLoads(web_contents())); |
172 } | 172 } |
173 } | 173 } |
174 } | 174 } |
OLD | NEW |