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 #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" // NOLINT | 8 #include "build/build_config.h" // NOLINT |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <wtypes.h> // NOLINT | 11 #include <wtypes.h> // NOLINT |
12 #endif | 12 #endif |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
20 #include "chrome/common/automation_constants.h" | 20 #include "chrome/common/automation_constants.h" |
21 #include "chrome/test/automation/automation_handle_tracker.h" | 21 #include "chrome/test/automation/automation_handle_tracker.h" |
22 #include "content/public/browser/save_page_type.h" | 22 #include "content/public/browser/save_page_type.h" |
23 #include "content/public/common/page_type.h" | 23 #include "content/public/common/page_type.h" |
24 #include "content/public/common/security_style.h" | 24 #include "content/public/common/security_style.h" |
25 #include "net/base/cert_status_flags.h" | 25 #include "net/base/cert_status_flags.h" |
26 #include "ui/base/keycodes/keyboard_codes.h" | 26 #include "ui/base/keycodes/keyboard_codes.h" |
27 #include "ui/base/window_open_disposition.h" | 27 #include "ui/base/window_open_disposition.h" |
28 | 28 |
29 class BrowserProxy; | 29 class BrowserProxy; |
30 class FilePath; | |
31 class GURL; | 30 class GURL; |
| 31 |
32 namespace IPC { | 32 namespace IPC { |
33 class Message; | 33 class Message; |
34 } | 34 } |
35 | 35 |
36 namespace base { | 36 namespace base { |
| 37 class FilePath; |
37 class Value; | 38 class Value; |
38 } | 39 } |
39 | 40 |
40 class TabProxy : public AutomationResourceProxy { | 41 class TabProxy : public AutomationResourceProxy { |
41 public: | 42 public: |
42 class TabProxyDelegate { | 43 class TabProxyDelegate { |
43 public: | 44 public: |
44 virtual bool OnMessageReceived(TabProxy* tab, const IPC::Message& msg) { | 45 virtual bool OnMessageReceived(TabProxy* tab, const IPC::Message& msg) { |
45 return false; | 46 return false; |
46 } | 47 } |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 197 |
197 // Waits until the infobar count is |count|. | 198 // Waits until the infobar count is |count|. |
198 // Returns true on success. | 199 // Returns true on success. |
199 bool WaitForInfoBarCount(size_t count) WARN_UNUSED_RESULT; | 200 bool WaitForInfoBarCount(size_t count) WARN_UNUSED_RESULT; |
200 | 201 |
201 // Uses the specified encoding to override encoding of the page in the tab. | 202 // Uses the specified encoding to override encoding of the page in the tab. |
202 bool OverrideEncoding(const std::string& encoding) WARN_UNUSED_RESULT; | 203 bool OverrideEncoding(const std::string& encoding) WARN_UNUSED_RESULT; |
203 | 204 |
204 // Captures the entire page and saves as a PNG at the given path. Returns | 205 // Captures the entire page and saves as a PNG at the given path. Returns |
205 // true on success. | 206 // true on success. |
206 bool CaptureEntirePageAsPNG(const FilePath& path) WARN_UNUSED_RESULT; | 207 bool CaptureEntirePageAsPNG(const base::FilePath& path) WARN_UNUSED_RESULT; |
207 | 208 |
208 #if defined(OS_WIN) | 209 #if defined(OS_WIN) |
209 // Resizes the tab window. | 210 // Resizes the tab window. |
210 // The parent_window parameter allows a parent to be specified for the window | 211 // The parent_window parameter allows a parent to be specified for the window |
211 // passed in. | 212 // passed in. |
212 void Reposition(HWND window, HWND window_insert_after, int left, int top, | 213 void Reposition(HWND window, HWND window_insert_after, int left, int top, |
213 int width, int height, int flags, HWND parent_window); | 214 int width, int height, int flags, HWND parent_window); |
214 | 215 |
215 // Sends the selected context menu command to the chrome instance | 216 // Sends the selected context menu command to the chrome instance |
216 void SendContextMenuCommand(int selected_command); | 217 void SendContextMenuCommand(int selected_command); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 const std::wstring& frame_xpath, | 264 const std::wstring& frame_xpath, |
264 const std::wstring& jscript) WARN_UNUSED_RESULT; | 265 const std::wstring& jscript) WARN_UNUSED_RESULT; |
265 | 266 |
266 private: | 267 private: |
267 base::Lock list_lock_; // Protects the observers_list_. | 268 base::Lock list_lock_; // Protects the observers_list_. |
268 ObserverList<TabProxyDelegate> observers_list_; | 269 ObserverList<TabProxyDelegate> observers_list_; |
269 DISALLOW_COPY_AND_ASSIGN(TabProxy); | 270 DISALLOW_COPY_AND_ASSIGN(TabProxy); |
270 }; | 271 }; |
271 | 272 |
272 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 273 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
OLD | NEW |