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