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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 items->Append(item); | 134 items->Append(item); |
135 } | 135 } |
136 DictionaryValue* return_value = new DictionaryValue; | 136 DictionaryValue* return_value = new DictionaryValue; |
137 return_value->Set("tabs", items); | 137 return_value->Set("tabs", items); |
138 return return_value; | 138 return return_value; |
139 } | 139 } |
140 | 140 |
141 void InitialLoadObserver::ConditionMet() { | 141 void InitialLoadObserver::ConditionMet() { |
142 registrar_.RemoveAll(); | 142 registrar_.RemoveAll(); |
143 automation_->Send(new AutomationMsg_InitialLoadsComplete(0)); | 143 automation_->OnInitialLoadsComplete(); |
144 } | 144 } |
145 | 145 |
146 NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation) | 146 NewTabUILoadObserver::NewTabUILoadObserver(AutomationProvider* automation) |
147 : automation_(automation) { | 147 : automation_(automation) { |
148 registrar_.Add(this, NotificationType::INITIAL_NEW_TAB_UI_LOAD, | 148 registrar_.Add(this, NotificationType::INITIAL_NEW_TAB_UI_LOAD, |
149 NotificationService::AllSources()); | 149 NotificationService::AllSources()); |
150 } | 150 } |
151 | 151 |
152 NewTabUILoadObserver::~NewTabUILoadObserver() { | 152 NewTabUILoadObserver::~NewTabUILoadObserver() { |
153 } | 153 } |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); | 1528 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); |
1529 } | 1529 } |
1530 | 1530 |
1531 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { | 1531 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { |
1532 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { | 1532 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { |
1533 collection_->set_on_collection_changed_callback(NULL); | 1533 collection_->set_on_collection_changed_callback(NULL); |
1534 reply_.SendSuccess(NULL); | 1534 reply_.SendSuccess(NULL); |
1535 delete this; | 1535 delete this; |
1536 } | 1536 } |
1537 } | 1537 } |
OLD | NEW |