| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1637 reply_message_->routing_id()); | 1637 reply_message_->routing_id()); |
| 1638 | 1638 |
| 1639 render_view_->ExecuteJavascriptInWebFrame(string16(), | 1639 render_view_->ExecuteJavascriptInWebFrame(string16(), |
| 1640 WideToUTF16Hack(set_automation_id)); | 1640 WideToUTF16Hack(set_automation_id)); |
| 1641 render_view_->ExecuteJavascriptInWebFrame(string16(), | 1641 render_view_->ExecuteJavascriptInWebFrame(string16(), |
| 1642 WideToUTF16Hack(javascript)); | 1642 WideToUTF16Hack(javascript)); |
| 1643 } | 1643 } |
| 1644 | 1644 |
| 1645 void PageSnapshotTaker::SendMessage(bool success) { | 1645 void PageSnapshotTaker::SendMessage(bool success) { |
| 1646 if (automation_) { | 1646 if (automation_) { |
| 1647 AutomationMsg_CaptureEntirePageAsPNG::WriteReplyParams(reply_message_.get(), | 1647 if (success) { |
| 1648 success); | 1648 AutomationJSONReply(automation_, reply_message_.release()) |
| 1649 automation_->Send(reply_message_.release()); | 1649 .SendSuccess(NULL); |
| 1650 } else { |
| 1651 AutomationJSONReply(automation_, reply_message_.release()) |
| 1652 .SendError("Failed to take snapshot of page"); |
| 1653 } |
| 1650 } | 1654 } |
| 1651 delete this; | 1655 delete this; |
| 1652 } | 1656 } |
| 1653 | 1657 |
| 1654 NTPInfoObserver::NTPInfoObserver( | 1658 NTPInfoObserver::NTPInfoObserver( |
| 1655 AutomationProvider* automation, | 1659 AutomationProvider* automation, |
| 1656 IPC::Message* reply_message, | 1660 IPC::Message* reply_message, |
| 1657 CancelableRequestConsumer* consumer) | 1661 CancelableRequestConsumer* consumer) |
| 1658 : automation_(automation->AsWeakPtr()), | 1662 : automation_(automation->AsWeakPtr()), |
| 1659 reply_message_(reply_message), | 1663 reply_message_(reply_message), |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2052 this, | 2056 this, |
| 2053 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); | 2057 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); |
| 2054 } | 2058 } |
| 2055 | 2059 |
| 2056 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { | 2060 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { |
| 2057 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2061 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 2058 if (automation_) | 2062 if (automation_) |
| 2059 automation_->Send(reply_message_.release()); | 2063 automation_->Send(reply_message_.release()); |
| 2060 Release(); | 2064 Release(); |
| 2061 } | 2065 } |
| OLD | NEW |