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_CHROMEDRIVER_CHROME_CHROME_IMPL_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_IMPL_H_ |
6 #define CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_IMPL_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
15 #include "chrome/test/chromedriver/chrome/chrome.h" | 15 #include "chrome/test/chromedriver/chrome/chrome.h" |
16 | 16 |
17 class AutomationExtension; | 17 class AutomationExtension; |
18 struct BrowserInfo; | 18 struct BrowserInfo; |
19 class DevToolsClient; | 19 class DevToolsClient; |
20 class DevToolsEventListener; | 20 class DevToolsEventListener; |
21 class DevToolsHttpClient; | 21 class DevToolsHttpClient; |
22 class JavaScriptDialogManager; | 22 class JavaScriptDialogManager; |
23 class PortReservation; | 23 class PortReservation; |
24 class Status; | 24 class Status; |
25 class WebView; | 25 class WebView; |
26 class WebViewImpl; | 26 class WebViewImpl; |
27 | 27 |
28 class ChromeImpl : public Chrome { | 28 class ChromeImpl : public Chrome { |
29 public: | 29 public: |
30 virtual ~ChromeImpl(); | 30 ~ChromeImpl() override; |
31 | 31 |
32 // Overridden from Chrome: | 32 // Overridden from Chrome: |
33 virtual ChromeDesktopImpl* GetAsDesktop() override; | 33 ChromeDesktopImpl* GetAsDesktop() override; |
34 virtual const BrowserInfo* GetBrowserInfo() override; | 34 const BrowserInfo* GetBrowserInfo() override; |
35 virtual bool HasCrashedWebView() override; | 35 bool HasCrashedWebView() override; |
36 virtual Status GetWebViewIds(std::list<std::string>* web_view_ids) override; | 36 Status GetWebViewIds(std::list<std::string>* web_view_ids) override; |
37 virtual Status GetWebViewById(const std::string& id, | 37 Status GetWebViewById(const std::string& id, WebView** web_view) override; |
38 WebView** web_view) override; | 38 Status CloseWebView(const std::string& id) override; |
39 virtual Status CloseWebView(const std::string& id) override; | 39 Status ActivateWebView(const std::string& id) override; |
40 virtual Status ActivateWebView(const std::string& id) override; | 40 bool IsMobileEmulationEnabled() const override; |
41 virtual bool IsMobileEmulationEnabled() const override; | 41 Status Quit() override; |
42 virtual Status Quit() override; | |
43 | 42 |
44 protected: | 43 protected: |
45 ChromeImpl( | 44 ChromeImpl( |
46 scoped_ptr<DevToolsHttpClient> http_client, | 45 scoped_ptr<DevToolsHttpClient> http_client, |
47 scoped_ptr<DevToolsClient> websocket_client, | 46 scoped_ptr<DevToolsClient> websocket_client, |
48 ScopedVector<DevToolsEventListener>& devtools_event_listeners, | 47 ScopedVector<DevToolsEventListener>& devtools_event_listeners, |
49 scoped_ptr<PortReservation> port_reservation); | 48 scoped_ptr<PortReservation> port_reservation); |
50 | 49 |
51 virtual Status QuitImpl() = 0; | 50 virtual Status QuitImpl() = 0; |
52 | 51 |
53 bool quit_; | 52 bool quit_; |
54 scoped_ptr<DevToolsHttpClient> devtools_http_client_; | 53 scoped_ptr<DevToolsHttpClient> devtools_http_client_; |
55 scoped_ptr<DevToolsClient> devtools_websocket_client_; | 54 scoped_ptr<DevToolsClient> devtools_websocket_client_; |
56 | 55 |
57 private: | 56 private: |
58 typedef std::list<linked_ptr<WebViewImpl> > WebViewList; | 57 typedef std::list<linked_ptr<WebViewImpl> > WebViewList; |
59 | 58 |
60 // Web views in this list are in the same order as they are opened. | 59 // Web views in this list are in the same order as they are opened. |
61 WebViewList web_views_; | 60 WebViewList web_views_; |
62 ScopedVector<DevToolsEventListener> devtools_event_listeners_; | 61 ScopedVector<DevToolsEventListener> devtools_event_listeners_; |
63 scoped_ptr<PortReservation> port_reservation_; | 62 scoped_ptr<PortReservation> port_reservation_; |
64 }; | 63 }; |
65 | 64 |
66 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_IMPL_H_ | 65 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_IMPL_H_ |
OLD | NEW |