OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DESKTOP_IMPL_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_ |
6 #define CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
16 #include "base/values.h" | |
16 #include "chrome/test/chromedriver/chrome/chrome_impl.h" | 17 #include "chrome/test/chromedriver/chrome/chrome_impl.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class TimeDelta; | 20 class TimeDelta; |
20 } | 21 } |
21 | 22 |
22 class AutomationExtension; | 23 class AutomationExtension; |
23 class DevToolsClient; | 24 class DevToolsClient; |
24 class DevToolsHttpClient; | 25 class DevToolsHttpClient; |
25 class Status; | 26 class Status; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 bool IsMobileEmulationEnabled() const override; | 60 bool IsMobileEmulationEnabled() const override; |
60 bool HasTouchScreen() const override; | 61 bool HasTouchScreen() const override; |
61 Status QuitImpl() override; | 62 Status QuitImpl() override; |
62 | 63 |
63 const base::CommandLine& command() const; | 64 const base::CommandLine& command() const; |
64 bool IsNetworkConnectionEnabled() const; | 65 bool IsNetworkConnectionEnabled() const; |
65 | 66 |
66 int GetNetworkConnection() const; | 67 int GetNetworkConnection() const; |
67 void SetNetworkConnection(int network_connection); | 68 void SetNetworkConnection(int network_connection); |
68 | 69 |
70 Status GetWindowPosition(std::string target_id, int* x, int* y); | |
stgao
2017/04/21 05:06:31
const std::string & target_id ?
same for below.
jzfeng
2017/04/21 07:25:54
Done.
| |
71 Status GetWindowSize(std::string target_id, int* width, int* height); | |
72 Status SetWindowPosition(std::string target_id, int x, int y); | |
73 Status SetWindowSize(std::string target_id, int width, int height); | |
74 Status MaximizeWindow(std::string target_id); | |
75 | |
69 private: | 76 private: |
77 struct Window { | |
78 int id; | |
79 std::string state; | |
80 int left; | |
81 int top; | |
82 int width; | |
83 int height; | |
84 }; | |
85 Status ParseWindow(std::unique_ptr<base::DictionaryValue> params, | |
86 Window* window); | |
87 | |
88 Status GetWindow(std::string target_id, Window* window); | |
89 Status SetWindowState(int window_id, std::string window_state); | |
90 Status SetWindowBounds(std::string target_id, | |
91 std::unique_ptr<base::DictionaryValue>); | |
92 | |
70 base::Process process_; | 93 base::Process process_; |
71 base::CommandLine command_; | 94 base::CommandLine command_; |
72 base::ScopedTempDir user_data_dir_; | 95 base::ScopedTempDir user_data_dir_; |
73 base::ScopedTempDir extension_dir_; | 96 base::ScopedTempDir extension_dir_; |
74 bool network_connection_enabled_; | 97 bool network_connection_enabled_; |
75 int network_connection_; | 98 int network_connection_; |
76 | 99 |
77 // Lazily initialized, may be null. | 100 // Lazily initialized, may be null. |
78 std::unique_ptr<AutomationExtension> automation_extension_; | 101 std::unique_ptr<AutomationExtension> automation_extension_; |
79 }; | 102 }; |
80 | 103 |
81 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_ | 104 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_CHROME_DESKTOP_IMPL_H_ |
OLD | NEW |