OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" // NOLINT | 9 #include "build/build_config.h" // NOLINT |
10 | 10 |
11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
12 #include <wtypes.h> // NOLINT | 12 #include <wtypes.h> // NOLINT |
13 #endif | 13 #endif |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
| 20 #include "base/ref_counted.h" |
20 #include "chrome/browser/download/save_package.h" | 21 #include "chrome/browser/download/save_package.h" |
21 #include "chrome/common/automation_constants.h" | 22 #include "chrome/common/automation_constants.h" |
22 #include "chrome/common/page_type.h" | 23 #include "chrome/common/page_type.h" |
23 #include "chrome/common/security_style.h" | 24 #include "chrome/common/security_style.h" |
24 #include "chrome/test/automation/automation_handle_tracker.h" | 25 #include "chrome/test/automation/automation_handle_tracker.h" |
25 #include "chrome/test/automation/dom_element_proxy.h" | 26 #include "chrome/test/automation/dom_element_proxy.h" |
26 #include "chrome/test/automation/javascript_execution_controller.h" | 27 #include "chrome/test/automation/javascript_execution_controller.h" |
27 #include "webkit/glue/window_open_disposition.h" | 28 #include "webkit/glue/window_open_disposition.h" |
28 | 29 |
| 30 class BrowserProxy; |
29 class GURL; | 31 class GURL; |
30 class Value; | 32 class Value; |
31 namespace IPC { | 33 namespace IPC { |
32 class Message; | 34 class Message; |
33 }; | 35 }; |
34 | 36 |
35 enum FindInPageDirection { BACK = 0, FWD = 1 }; | 37 enum FindInPageDirection { BACK = 0, FWD = 1 }; |
36 enum FindInPageCase { IGNORE_CASE = 0, CASE_SENSITIVE = 1 }; | 38 enum FindInPageCase { IGNORE_CASE = 0, CASE_SENSITIVE = 1 }; |
37 // Specifies the font size on a page which is requested by an automation | 39 // Specifies the font size on a page which is requested by an automation |
38 // client. | 40 // client. |
(...skipping 16 matching lines...) Expand all Loading... |
55 virtual void OnChannelError(TabProxy* tab) {} | 57 virtual void OnChannelError(TabProxy* tab) {} |
56 | 58 |
57 protected: | 59 protected: |
58 virtual ~TabProxyDelegate() {} | 60 virtual ~TabProxyDelegate() {} |
59 }; | 61 }; |
60 | 62 |
61 TabProxy(AutomationMessageSender* sender, | 63 TabProxy(AutomationMessageSender* sender, |
62 AutomationHandleTracker* tracker, | 64 AutomationHandleTracker* tracker, |
63 int handle); | 65 int handle); |
64 | 66 |
| 67 // Gets the browser that holds this tab. |
| 68 scoped_refptr<BrowserProxy> GetParentBrowser() const; |
| 69 |
65 // Gets the current url of the tab. | 70 // Gets the current url of the tab. |
66 bool GetCurrentURL(GURL* url) const WARN_UNUSED_RESULT; | 71 bool GetCurrentURL(GURL* url) const WARN_UNUSED_RESULT; |
67 | 72 |
68 // Gets the title of the tab. | 73 // Gets the title of the tab. |
69 bool GetTabTitle(std::wstring* title) const WARN_UNUSED_RESULT; | 74 bool GetTabTitle(std::wstring* title) const WARN_UNUSED_RESULT; |
70 | 75 |
71 // Gets the tabstrip index of the tab. | 76 // Gets the tabstrip index of the tab. |
72 bool GetTabIndex(int* index) const WARN_UNUSED_RESULT; | 77 bool GetTabIndex(int* index) const WARN_UNUSED_RESULT; |
73 | 78 |
74 // Gets the number of constrained window for this tab. | 79 // Gets the number of constrained window for this tab. |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 // purposes. | 437 // purposes. |
433 void LastObjectRemoved(); | 438 void LastObjectRemoved(); |
434 | 439 |
435 private: | 440 private: |
436 base::Lock list_lock_; // Protects the observers_list_. | 441 base::Lock list_lock_; // Protects the observers_list_. |
437 ObserverList<TabProxyDelegate> observers_list_; | 442 ObserverList<TabProxyDelegate> observers_list_; |
438 DISALLOW_COPY_AND_ASSIGN(TabProxy); | 443 DISALLOW_COPY_AND_ASSIGN(TabProxy); |
439 }; | 444 }; |
440 | 445 |
441 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 446 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
OLD | NEW |