| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_TEST_AUTOMATION_TAB_PROXY_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
| 6 #define CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 6 #define CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" |
| 9 |
| 10 #if defined(OS_WIN) |
| 8 #include <wtypes.h> | 11 #include <wtypes.h> |
| 12 #endif |
| 13 |
| 9 #include <string> | 14 #include <string> |
| 10 #include <vector> | 15 #include <vector> |
| 11 | 16 |
| 12 #include "chrome/browser/download/save_package.h" | 17 #include "chrome/browser/download/save_package.h" |
| 13 #include "chrome/browser/tab_contents/navigation_entry.h" | 18 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 14 #include "chrome/browser/tab_contents/security_style.h" | 19 #include "chrome/browser/tab_contents/security_style.h" |
| 15 #include "chrome/test/automation/automation_constants.h" | 20 #include "chrome/test/automation/automation_constants.h" |
| 16 #include "chrome/test/automation/automation_handle_tracker.h" | 21 #include "chrome/test/automation/automation_handle_tracker.h" |
| 17 | 22 |
| 18 class ConstrainedWindowProxy; | 23 class ConstrainedWindowProxy; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // until the browser has initiated the close (wait_until_closed = false). | 125 // until the browser has initiated the close (wait_until_closed = false). |
| 121 // | 126 // |
| 122 // When a tab is closed the browser does additional work via invoke later | 127 // When a tab is closed the browser does additional work via invoke later |
| 123 // and may wait for messages from the renderer. Supplying a value of true to | 128 // and may wait for messages from the renderer. Supplying a value of true to |
| 124 // this method waits until all processing is done. Be careful with this, | 129 // this method waits until all processing is done. Be careful with this, |
| 125 // when closing the last tab it is possible for the browser to shutdown BEFORE | 130 // when closing the last tab it is possible for the browser to shutdown BEFORE |
| 126 // the tab has completely closed. In other words, this may NOT be sent for | 131 // the tab has completely closed. In other words, this may NOT be sent for |
| 127 // the last tab. | 132 // the last tab. |
| 128 bool Close(bool wait_until_closed); | 133 bool Close(bool wait_until_closed); |
| 129 | 134 |
| 135 #if defined(OS_WIN) |
| 136 // TODO(port): Use portable replacement for HWND. |
| 137 |
| 130 // Gets the HWND that corresponds to the content area of this tab. | 138 // Gets the HWND that corresponds to the content area of this tab. |
| 131 // Returns true if the call was successful. | 139 // Returns true if the call was successful. |
| 132 bool GetHWND(HWND* hwnd) const; | 140 bool GetHWND(HWND* hwnd) const; |
| 141 #endif // defined(OS_WIN) |
| 133 | 142 |
| 134 // Gets the process ID that corresponds to the content area of this tab. | 143 // Gets the process ID that corresponds to the content area of this tab. |
| 135 // Returns true if the call was successful. If the specified tab has no | 144 // Returns true if the call was successful. If the specified tab has no |
| 136 // separate process for rendering its content, the return value is true but | 145 // separate process for rendering its content, the return value is true but |
| 137 // the process_id is 0. | 146 // the process_id is 0. |
| 138 bool GetProcessID(int* process_id) const; | 147 bool GetProcessID(int* process_id) const; |
| 139 | 148 |
| 140 // Supply or cancel authentication to a login prompt. These are synchronous | 149 // Supply or cancel authentication to a login prompt. These are synchronous |
| 141 // calls and hence block until the load finishes (or another login prompt | 150 // calls and hence block until the load finishes (or another login prompt |
| 142 // appears, in the case of invalid login info). | 151 // appears, in the case of invalid login info). |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 bool GetDownloadDirectory(std::wstring* download_directory); | 199 bool GetDownloadDirectory(std::wstring* download_directory); |
| 191 | 200 |
| 192 // Shows an interstitial page. Blocks until the interstitial page | 201 // Shows an interstitial page. Blocks until the interstitial page |
| 193 // has been loaded. Return false if a failure happens.3 | 202 // has been loaded. Return false if a failure happens.3 |
| 194 bool ShowInterstitialPage(const std::string& html_text, int timeout_ms); | 203 bool ShowInterstitialPage(const std::string& html_text, int timeout_ms); |
| 195 | 204 |
| 196 // Hides the currently shown interstitial page. Blocks until the interstitial | 205 // Hides the currently shown interstitial page. Blocks until the interstitial |
| 197 // page has been hidden. Return false if a failure happens. | 206 // page has been hidden. Return false if a failure happens. |
| 198 bool HideInterstitialPage(); | 207 bool HideInterstitialPage(); |
| 199 | 208 |
| 209 #if defined(OS_WIN) |
| 210 // TODO(port): Use something portable. |
| 211 |
| 200 // This sets the keyboard accelerators to be used by an externally | 212 // This sets the keyboard accelerators to be used by an externally |
| 201 // hosted tab. This call is not valid on a regular tab hosted within | 213 // hosted tab. This call is not valid on a regular tab hosted within |
| 202 // Chrome. | 214 // Chrome. |
| 203 bool SetAccelerators(HACCEL accel_table, int accel_table_entry_count); | 215 bool SetAccelerators(HACCEL accel_table, int accel_table_entry_count); |
| 204 | 216 |
| 205 // The container of an externally hosted tab calls this to reflect any | 217 // The container of an externally hosted tab calls this to reflect any |
| 206 // accelerator keys that it did not process. This gives the tab a chance | 218 // accelerator keys that it did not process. This gives the tab a chance |
| 207 // to handle the keys | 219 // to handle the keys |
| 208 bool ProcessUnhandledAccelerator(const MSG& msg); | 220 bool ProcessUnhandledAccelerator(const MSG& msg); |
| 221 #endif // defined(OS_WIN) |
| 209 | 222 |
| 210 // Ask the tab to set focus to either the first or last element on the page. | 223 // Ask the tab to set focus to either the first or last element on the page. |
| 211 bool SetInitialFocus(bool reverse); | 224 bool SetInitialFocus(bool reverse); |
| 212 | 225 |
| 213 // Waits for the tab to finish being restored. Returns true on success. | 226 // Waits for the tab to finish being restored. Returns true on success. |
| 214 // timeout_ms gives the max amount of time to wait for restore to complete. | 227 // timeout_ms gives the max amount of time to wait for restore to complete. |
| 215 bool WaitForTabToBeRestored(uint32 timeout_ms); | 228 bool WaitForTabToBeRestored(uint32 timeout_ms); |
| 216 | 229 |
| 217 // Retrieves the different security states for the current tab. | 230 // Retrieves the different security states for the current tab. |
| 218 bool GetSecurityState(SecurityStyle* security_style, | 231 bool GetSecurityState(SecurityStyle* security_style, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 283 |
| 271 // Uses the specified encoding to override encoding of the page in the tab. | 284 // Uses the specified encoding to override encoding of the page in the tab. |
| 272 bool OverrideEncoding(const std::wstring& encoding); | 285 bool OverrideEncoding(const std::wstring& encoding); |
| 273 | 286 |
| 274 private: | 287 private: |
| 275 DISALLOW_COPY_AND_ASSIGN(TabProxy); | 288 DISALLOW_COPY_AND_ASSIGN(TabProxy); |
| 276 }; | 289 }; |
| 277 | 290 |
| 278 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 291 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
| 279 | 292 |
| OLD | NEW |