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 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 delete this; | 1423 delete this; |
1424 } | 1424 } |
1425 | 1425 |
1426 NTPInfoObserver::NTPInfoObserver( | 1426 NTPInfoObserver::NTPInfoObserver( |
1427 AutomationProvider* automation, | 1427 AutomationProvider* automation, |
1428 IPC::Message* reply_message, | 1428 IPC::Message* reply_message, |
1429 CancelableRequestConsumer* consumer) | 1429 CancelableRequestConsumer* consumer) |
1430 : automation_(automation), | 1430 : automation_(automation), |
1431 reply_message_(reply_message), | 1431 reply_message_(reply_message), |
1432 consumer_(consumer), | 1432 consumer_(consumer), |
1433 request_(NULL), | 1433 request_(0), |
1434 ntp_info_(new DictionaryValue) { | 1434 ntp_info_(new DictionaryValue) { |
1435 top_sites_ = automation_->profile()->GetTopSites(); | 1435 top_sites_ = automation_->profile()->GetTopSites(); |
1436 if (!top_sites_) { | 1436 if (!top_sites_) { |
1437 AutomationJSONReply(automation_, reply_message_) | 1437 AutomationJSONReply(automation_, reply_message_) |
1438 .SendError("Profile does not have service for querying the top sites."); | 1438 .SendError("Profile does not have service for querying the top sites."); |
1439 return; | 1439 return; |
1440 } | 1440 } |
1441 TabRestoreService* service = automation_->profile()->GetTabRestoreService(); | 1441 TabRestoreService* service = automation_->profile()->GetTabRestoreService(); |
1442 if (!service) { | 1442 if (!service) { |
1443 AutomationJSONReply(automation_, reply_message_) | 1443 AutomationJSONReply(automation_, reply_message_) |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 NotificationService::AllSources()); | 1629 NotificationService::AllSources()); |
1630 } | 1630 } |
1631 | 1631 |
1632 void RendererProcessClosedObserver::Observe( | 1632 void RendererProcessClosedObserver::Observe( |
1633 NotificationType type, | 1633 NotificationType type, |
1634 const NotificationSource& source, | 1634 const NotificationSource& source, |
1635 const NotificationDetails& details) { | 1635 const NotificationDetails& details) { |
1636 AutomationJSONReply(automation_, reply_message_).SendSuccess(NULL); | 1636 AutomationJSONReply(automation_, reply_message_).SendSuccess(NULL); |
1637 delete this; | 1637 delete this; |
1638 } | 1638 } |
OLD | NEW |