| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_frame/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 AutomationMsg_NavigationResponseValues result) { | 776 AutomationMsg_NavigationResponseValues result) { |
| 777 if (result == AUTOMATION_MSG_NAVIGATION_ERROR) | 777 if (result == AUTOMATION_MSG_NAVIGATION_ERROR) |
| 778 ReportNavigationError(AUTOMATION_MSG_NAVIGATION_ERROR, | 778 ReportNavigationError(AUTOMATION_MSG_NAVIGATION_ERROR, |
| 779 chrome_launch_params_->url().spec()); | 779 chrome_launch_params_->url().spec()); |
| 780 } | 780 } |
| 781 | 781 |
| 782 void ChromeFrameAutomationClient::FindInPage(const std::wstring& search_string, | 782 void ChromeFrameAutomationClient::FindInPage(const std::wstring& search_string, |
| 783 FindInPageDirection forward, | 783 FindInPageDirection forward, |
| 784 FindInPageCase match_case, | 784 FindInPageCase match_case, |
| 785 bool find_next) { | 785 bool find_next) { |
| 786 DCHECK(tab_.get()); | 786 // Note that we can be called by the find dialog after the tab has gone away. |
| 787 if (!tab_) |
| 788 return; |
| 787 | 789 |
| 788 // What follows is quite similar to TabProxy::FindInPage() but uses | 790 // What follows is quite similar to TabProxy::FindInPage() but uses |
| 789 // the SyncMessageReplyDispatcher to avoid concerns about blocking | 791 // the SyncMessageReplyDispatcher to avoid concerns about blocking |
| 790 // synchronous messages. | 792 // synchronous messages. |
| 791 AutomationMsg_Find_Params params; | 793 AutomationMsg_Find_Params params; |
| 792 params.search_string = WideToUTF16Hack(search_string); | 794 params.search_string = WideToUTF16Hack(search_string); |
| 793 params.find_next = find_next; | 795 params.find_next = find_next; |
| 794 params.match_case = (match_case == CASE_SENSITIVE); | 796 params.match_case = (match_case == CASE_SENSITIVE); |
| 795 params.forward = (forward == FWD); | 797 params.forward = (forward == FWD); |
| 796 | 798 |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 const net::URLRequestStatus& status) { | 1324 const net::URLRequestStatus& status) { |
| 1323 automation_server_->Send(new AutomationMsg_RequestEnd( | 1325 automation_server_->Send(new AutomationMsg_RequestEnd( |
| 1324 tab_->handle(), request_id, status)); | 1326 tab_->handle(), request_id, status)); |
| 1325 } | 1327 } |
| 1326 | 1328 |
| 1327 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1329 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
| 1328 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1330 const GURL& url, const std::string& cookie_string, int cookie_id) { |
| 1329 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( | 1331 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
| 1330 tab_->handle(), success, url, cookie_string, cookie_id)); | 1332 tab_->handle(), success, url, cookie_string, cookie_id)); |
| 1331 } | 1333 } |
| OLD | NEW |