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 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome/browser/automation/automation_provider.h" | 10 #include "chrome/browser/automation/automation_provider.h" |
11 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
| 12 #include "chrome/browser/history/history.h" |
12 #include "chrome/common/notification_registrar.h" | 13 #include "chrome/common/notification_registrar.h" |
13 | 14 |
14 // This is an automation provider containing testing calls. | 15 // This is an automation provider containing testing calls. |
15 class TestingAutomationProvider : public AutomationProvider, | 16 class TestingAutomationProvider : public AutomationProvider, |
16 public BrowserList::Observer, | 17 public BrowserList::Observer, |
17 public NotificationObserver { | 18 public NotificationObserver { |
18 public: | 19 public: |
19 explicit TestingAutomationProvider(Profile* profile); | 20 explicit TestingAutomationProvider(Profile* profile); |
20 | 21 |
21 // BrowserList::Observer implementation | 22 // BrowserList::Observer implementation |
(...skipping 23 matching lines...) Expand all Loading... |
45 const std::string value, | 46 const std::string value, |
46 int handle, | 47 int handle, |
47 int* response_value); | 48 int* response_value); |
48 void DeleteCookie(const GURL& url, const std::string& cookie_name, | 49 void DeleteCookie(const GURL& url, const std::string& cookie_name, |
49 int handle, bool* success); | 50 int handle, bool* success); |
50 void ShowCollectedCookiesDialog(int handle, bool* success); | 51 void ShowCollectedCookiesDialog(int handle, bool* success); |
51 void NavigateToURL(int handle, const GURL& url, IPC::Message* reply_message); | 52 void NavigateToURL(int handle, const GURL& url, IPC::Message* reply_message); |
52 void NavigateToURLBlockUntilNavigationsComplete(int handle, const GURL& url, | 53 void NavigateToURLBlockUntilNavigationsComplete(int handle, const GURL& url, |
53 int number_of_navigations, | 54 int number_of_navigations, |
54 IPC::Message* reply_message); | 55 IPC::Message* reply_message); |
| 56 void NavigationAsync(int handle, const GURL& url, bool* status); |
| 57 void NavigationAsyncWithDisposition(int handle, |
| 58 const GURL& url, |
| 59 WindowOpenDisposition disposition, |
| 60 bool* status); |
| 61 void GoBack(int handle, IPC::Message* reply_message); |
| 62 void GoForward(int handle, IPC::Message* reply_message); |
| 63 void Reload(int handle, IPC::Message* reply_message); |
| 64 void SetAuth(int tab_handle, const std::wstring& username, |
| 65 const std::wstring& password, IPC::Message* reply_message); |
| 66 void CancelAuth(int tab_handle, IPC::Message* reply_message); |
| 67 void NeedsAuth(int tab_handle, bool* needs_auth); |
| 68 void GetRedirectsFrom(int tab_handle, |
| 69 const GURL& source_url, |
| 70 IPC::Message* reply_message); |
| 71 void GetBrowserWindowCount(int* window_count); |
| 72 void GetNormalBrowserWindowCount(int* window_count); |
| 73 |
| 74 // Callback for history redirect queries. |
| 75 virtual void OnRedirectQueryComplete( |
| 76 HistoryService::Handle request_handle, |
| 77 GURL from_url, |
| 78 bool success, |
| 79 history::RedirectList* redirects); |
55 | 80 |
56 virtual void Observe(NotificationType type, | 81 virtual void Observe(NotificationType type, |
57 const NotificationSource& source, | 82 const NotificationSource& source, |
58 const NotificationDetails& details); | 83 const NotificationDetails& details); |
59 | 84 |
60 void OnRemoveProvider(); // Called via PostTask | 85 void OnRemoveProvider(); // Called via PostTask |
61 | 86 |
| 87 // Handle for an in-process redirect query. We expect only one redirect query |
| 88 // at a time (we should have only one caller, and it will block while waiting |
| 89 // for the results) so there is only one handle. When non-0, indicates a |
| 90 // query in progress. |
| 91 HistoryService::Handle redirect_query_; |
| 92 |
62 NotificationRegistrar registrar_; | 93 NotificationRegistrar registrar_; |
63 | 94 |
64 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 95 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
65 }; | 96 }; |
66 | 97 |
67 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 98 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
OLD | NEW |