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 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 reply_message_ = reply_message; | 1162 reply_message_ = reply_message; |
1163 model_ = model; | 1163 model_ = model; |
1164 model_->AddObserver(this); | 1164 model_->AddObserver(this); |
1165 } | 1165 } |
1166 | 1166 |
1167 AutomationProviderBookmarkModelObserver:: | 1167 AutomationProviderBookmarkModelObserver:: |
1168 ~AutomationProviderBookmarkModelObserver() { | 1168 ~AutomationProviderBookmarkModelObserver() { |
1169 model_->RemoveObserver(this); | 1169 model_->RemoveObserver(this); |
1170 } | 1170 } |
1171 | 1171 |
| 1172 void AutomationProviderBookmarkModelObserver::Loaded(BookmarkModel* model) { |
| 1173 ReplyAndDelete(true); |
| 1174 } |
| 1175 |
| 1176 void AutomationProviderBookmarkModelObserver::BookmarkModelBeingDeleted( |
| 1177 BookmarkModel* model) { |
| 1178 ReplyAndDelete(false); |
| 1179 } |
| 1180 |
1172 void AutomationProviderBookmarkModelObserver::ReplyAndDelete(bool success) { | 1181 void AutomationProviderBookmarkModelObserver::ReplyAndDelete(bool success) { |
1173 AutomationMsg_WaitForBookmarkModelToLoad::WriteReplyParams( | 1182 AutomationMsg_WaitForBookmarkModelToLoad::WriteReplyParams( |
1174 reply_message_, success); | 1183 reply_message_, success); |
1175 automation_provider_->Send(reply_message_); | 1184 automation_provider_->Send(reply_message_); |
1176 delete this; | 1185 delete this; |
1177 } | 1186 } |
1178 | 1187 |
1179 void AutomationProviderDownloadItemObserver::OnDownloadFileCompleted( | 1188 void AutomationProviderDownloadItemObserver::OnDownloadFileCompleted( |
1180 DownloadItem* download) { | 1189 DownloadItem* download) { |
1181 download->RemoveObserver(this); | 1190 download->RemoveObserver(this); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); | 1542 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); |
1534 } | 1543 } |
1535 | 1544 |
1536 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { | 1545 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { |
1537 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { | 1546 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { |
1538 collection_->set_on_collection_changed_callback(NULL); | 1547 collection_->set_on_collection_changed_callback(NULL); |
1539 reply_.SendSuccess(NULL); | 1548 reply_.SendSuccess(NULL); |
1540 delete this; | 1549 delete this; |
1541 } | 1550 } |
1542 } | 1551 } |
OLD | NEW |