Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/test/chromedriver/chrome/chrome_desktop_impl.h

Issue 2826393002: use devtools command to do window management (Closed)
Patch Set: nit change Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/chromedriver/chrome/chrome_desktop_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(const std::string& target_id, int* x, int* y);
71 Status GetWindowSize(const std::string& target_id, int* width, int* height);
72 Status SetWindowPosition(const std::string& target_id, int x, int y);
73 Status SetWindowSize(const std::string& target_id, int width, int height);
74 Status MaximizeWindow(const 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(const std::string& target_id, Window* window);
89 Status SetWindowState(int window_id, const std::string& window_state);
90 Status SetWindowBounds(const std::string& target_id,
91 std::unique_ptr<base::DictionaryValue> bounds);
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/test/chromedriver/chrome/chrome_desktop_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698