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 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 } | 127 } |
128 items->Append(item); | 128 items->Append(item); |
129 } | 129 } |
130 DictionaryValue* return_value = new DictionaryValue; | 130 DictionaryValue* return_value = new DictionaryValue; |
131 return_value->Set("tabs", items); | 131 return_value->Set("tabs", items); |
132 return return_value; | 132 return return_value; |
133 } | 133 } |
134 | 134 |
135 void InitialLoadObserver::ConditionMet() { | 135 void InitialLoadObserver::ConditionMet() { |
136 registrar_.RemoveAll(); | 136 registrar_.RemoveAll(); |
137 automation_->OnInitialLoadsComplete(); | 137 automation_->Send(new AutomationMsg_InitialLoadsComplete(0)); |
138 } | 138 } |
139 | 139 |
140 NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation) | 140 NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation) |
141 : automation_(automation) { | 141 : automation_(automation) { |
142 registrar_.Add(this, NotificationType::INITIAL_NEW_TAB_UI_LOAD, | 142 registrar_.Add(this, NotificationType::INITIAL_NEW_TAB_UI_LOAD, |
143 NotificationService::AllSources()); | 143 NotificationService::AllSources()); |
144 } | 144 } |
145 | 145 |
146 NewTabUILoadObserver::~NewTabUILoadObserver() { | 146 NewTabUILoadObserver::~NewTabUILoadObserver() { |
147 } | 147 } |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); | 1437 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); |
1438 } | 1438 } |
1439 | 1439 |
1440 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { | 1440 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { |
1441 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { | 1441 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { |
1442 collection_->set_on_collection_changed_callback(NULL); | 1442 collection_->set_on_collection_changed_callback(NULL); |
1443 reply_.SendSuccess(NULL); | 1443 reply_.SendSuccess(NULL); |
1444 delete this; | 1444 delete this; |
1445 } | 1445 } |
1446 } | 1446 } |
OLD | NEW |