diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 04:15:31 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 04:15:31 +0000 |
commit | 5a52f16a208389a6f8d285cd63333f6bfe17997d (patch) | |
tree | d69ae768f9e6d0e1f52021db1760eafa5c17ba1d /chrome/browser/automation | |
parent | 6eb0876213f6859369ea1c7247a350b0d70cc15b (diff) | |
download | chromium_src-5a52f16a208389a6f8d285cd63333f6bfe17997d.zip chromium_src-5a52f16a208389a6f8d285cd63333f6bfe17997d.tar.gz chromium_src-5a52f16a208389a6f8d285cd63333f6bfe17997d.tar.bz2 |
Adding a UI test to catch the crash described in issue 1341577.This test is disabled, and will be turned on once we fix the issue.I added to TabProxy the ability to do FindNext, which was necessary to reproduce the crash, and changed the automation IPC to take a FindInPageRequest struct, which makes it identical to the IPC we pass to render_view.BUG=1341577
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 25 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 11 |
2 files changed, 25 insertions, 11 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 5451a82..2112e27 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -178,7 +178,7 @@ class NavigationControllerRestoredObserver : public NotificationObserver { NavigationController* controller_; const int routing_id_; - DISALLOW_EVIL_CONSTRUCTORS(NavigationControllerRestoredObserver); + DISALLOW_COPY_AND_ASSIGN(NavigationControllerRestoredObserver); }; @@ -576,7 +576,7 @@ AutomationProvider::AutomationProvider(Profile* profile) AutomationProvider::~AutomationProvider() { // Make sure that any outstanding NotificationObservers also get destroyed. ObserverList<NotificationObserver>::Iterator it(notification_observer_list_); - NotificationObserver* observer; + NotificationObserver* observer; while ((observer = it.GetNext()) != NULL) delete observer; } @@ -749,6 +749,8 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) { HandleOpenFindInPageRequest) IPC_MESSAGE_HANDLER(AutomationMsg_HandleMessageFromExternalHost, OnMessageFromExternalHost) + IPC_MESSAGE_HANDLER(AutomationMsg_FindRequest, + HandleFindRequest) IPC_END_MESSAGE_MAP() } @@ -1161,7 +1163,7 @@ class MouseEventTask : public Task { POINT point_; int flags_; - DISALLOW_EVIL_CONSTRUCTORS(MouseEventTask); + DISALLOW_COPY_AND_ASSIGN(MouseEventTask); }; void AutomationProvider::ScheduleMouseEvent(ChromeViews::View* view, @@ -1187,7 +1189,7 @@ class InvokeTaskLaterTask : public Task { private: Task* task_; - DISALLOW_EVIL_CONSTRUCTORS(InvokeTaskLaterTask); + DISALLOW_COPY_AND_ASSIGN(InvokeTaskLaterTask); }; // This task sends a WindowDragResponse message with the appropriate @@ -1208,7 +1210,7 @@ class WindowDragResponseTask : public Task { AutomationProvider* provider_; int routing_id_; - DISALLOW_EVIL_CONSTRUCTORS(WindowDragResponseTask); + DISALLOW_COPY_AND_ASSIGN(WindowDragResponseTask); }; void AutomationProvider::WindowSimulateClick(const IPC::Message& message, @@ -1658,6 +1660,14 @@ void AutomationProvider::GetConstrainedWindowBounds(const IPC::Message& message, void AutomationProvider::HandleFindInPageRequest( const IPC::Message& message, int handle, const std::wstring& find_request, int forward, int match_case) { + NOTREACHED() << "This function has been deprecated." + << "Please use HandleFindRequest instead."; + Send(new AutomationMsg_FindInPageResponse(message.routing_id(), -1)); + return; +} + +void AutomationProvider::HandleFindRequest(const IPC::Message& message, + int handle, const FindInPageRequest& request) { if (!tab_tracker_->ContainsHandle(handle)) { Send(new AutomationMsg_FindInPageResponse(message.routing_id(), -1)); return; @@ -1677,11 +1687,10 @@ void AutomationProvider::HandleFindInPageRequest( tab_contents->AsWebContents()->OpenFindInPageWindow(*browser); } - // The explicit comparison to TRUE avoids a warning (C4800). tab_contents->StartFinding( FindInPageNotificationObserver::kFindInPageRequestId, - find_request, forward == TRUE, match_case == TRUE, - false); // Not a FindNext operation. + request.search_string, request.forward, request.match_case, + request.find_next); } void AutomationProvider::HandleOpenFindInPageRequest( diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 6d40253..0b08627 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -185,14 +185,19 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, void GetConstrainedWindowBounds(const IPC::Message& message, int handle); - // Responds to the FindInPage request, retrieves the search query parameters, - // launches an observer to listen for results and issues a StartFind request. + // This function has been deprecated, please use HandleFindRequest. void HandleFindInPageRequest(const IPC::Message& message, int handle, const std::wstring& find_request, int forward, int match_case); + // Responds to the FindInPage request, retrieves the search query parameters, + // launches an observer to listen for results and issues a StartFind request. + void HandleFindRequest(const IPC::Message& message, + int handle, + const FindInPageRequest& request); + // Responds to requests to open the FindInPage window. void HandleOpenFindInPageRequest(const IPC::Message& message, int handle); @@ -332,7 +337,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, Profile* profile_; - DISALLOW_EVIL_CONSTRUCTORS(AutomationProvider); + DISALLOW_COPY_AND_ASSIGN(AutomationProvider); }; // When life started, the AutomationProvider class was a singleton and was meant |