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 "chrome/browser/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 items->Append(item); | 140 items->Append(item); |
141 } | 141 } |
142 DictionaryValue* return_value = new DictionaryValue; | 142 DictionaryValue* return_value = new DictionaryValue; |
143 return_value->Set("tabs", items); | 143 return_value->Set("tabs", items); |
144 return return_value; | 144 return return_value; |
145 } | 145 } |
146 | 146 |
147 void InitialLoadObserver::ConditionMet() { | 147 void InitialLoadObserver::ConditionMet() { |
148 registrar_.RemoveAll(); | 148 registrar_.RemoveAll(); |
149 automation_->Send(new AutomationMsg_InitialLoadsComplete(0)); | 149 automation_->Send(new AutomationMsg_InitialLoadsComplete()); |
150 } | 150 } |
151 | 151 |
152 NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation) | 152 NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation) |
153 : automation_(automation) { | 153 : automation_(automation) { |
154 registrar_.Add(this, NotificationType::INITIAL_NEW_TAB_UI_LOAD, | 154 registrar_.Add(this, NotificationType::INITIAL_NEW_TAB_UI_LOAD, |
155 NotificationService::AllSources()); | 155 NotificationService::AllSources()); |
156 } | 156 } |
157 | 157 |
158 NewTabUILoadObserver::~NewTabUILoadObserver() { | 158 NewTabUILoadObserver::~NewTabUILoadObserver() { |
159 } | 159 } |
160 | 160 |
161 void NewTabUILoadObserver::Observe(NotificationType type, | 161 void NewTabUILoadObserver::Observe(NotificationType type, |
162 const NotificationSource& source, | 162 const NotificationSource& source, |
163 const NotificationDetails& details) { | 163 const NotificationDetails& details) { |
164 if (type == NotificationType::INITIAL_NEW_TAB_UI_LOAD) { | 164 if (type == NotificationType::INITIAL_NEW_TAB_UI_LOAD) { |
165 Details<int> load_time(details); | 165 Details<int> load_time(details); |
166 automation_->Send( | 166 automation_->Send( |
167 new AutomationMsg_InitialNewTabUILoadComplete(0, *load_time.ptr())); | 167 new AutomationMsg_InitialNewTabUILoadComplete(*load_time.ptr())); |
168 } else { | 168 } else { |
169 NOTREACHED(); | 169 NOTREACHED(); |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 NavigationControllerRestoredObserver::NavigationControllerRestoredObserver( | 173 NavigationControllerRestoredObserver::NavigationControllerRestoredObserver( |
174 AutomationProvider* automation, | 174 AutomationProvider* automation, |
175 NavigationController* controller, | 175 NavigationController* controller, |
176 IPC::Message* reply_message) | 176 IPC::Message* reply_message) |
177 : automation_(automation), | 177 : automation_(automation), |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 NotificationService::AllSources()); | 1632 NotificationService::AllSources()); |
1633 } | 1633 } |
1634 | 1634 |
1635 void RendererProcessClosedObserver::Observe( | 1635 void RendererProcessClosedObserver::Observe( |
1636 NotificationType type, | 1636 NotificationType type, |
1637 const NotificationSource& source, | 1637 const NotificationSource& source, |
1638 const NotificationDetails& details) { | 1638 const NotificationDetails& details) { |
1639 AutomationJSONReply(automation_, reply_message_).SendSuccess(NULL); | 1639 AutomationJSONReply(automation_, reply_message_).SendSuccess(NULL); |
1640 delete this; | 1640 delete this; |
1641 } | 1641 } |
OLD | NEW |