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

Unified Diff: chrome/test/chromedriver/chrome/chrome_desktop_impl.h

Issue 2826393002: use devtools command to do window management (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/chrome/chrome_desktop_impl.h
diff --git a/chrome/test/chromedriver/chrome/chrome_desktop_impl.h b/chrome/test/chromedriver/chrome/chrome_desktop_impl.h
index a5a8cccefdfdde7e0e66c1ea79565d1149c29074..4308c0d5e3c8b74a94fa447ff5d6cc45d47705b1 100644
--- a/chrome/test/chromedriver/chrome/chrome_desktop_impl.h
+++ b/chrome/test/chromedriver/chrome/chrome_desktop_impl.h
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "base/files/scoped_temp_dir.h"
#include "base/process/process.h"
+#include "base/values.h"
#include "chrome/test/chromedriver/chrome/chrome_impl.h"
namespace base {
@@ -66,7 +67,29 @@ class ChromeDesktopImpl : public ChromeImpl {
int GetNetworkConnection() const;
void SetNetworkConnection(int network_connection);
+ 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.
+ Status GetWindowSize(std::string target_id, int* width, int* height);
+ Status SetWindowPosition(std::string target_id, int x, int y);
+ Status SetWindowSize(std::string target_id, int width, int height);
+ Status MaximizeWindow(std::string target_id);
+
private:
+ struct Window {
+ int id;
+ std::string state;
+ int left;
+ int top;
+ int width;
+ int height;
+ };
+ Status ParseWindow(std::unique_ptr<base::DictionaryValue> params,
+ Window* window);
+
+ Status GetWindow(std::string target_id, Window* window);
+ Status SetWindowState(int window_id, std::string window_state);
+ Status SetWindowBounds(std::string target_id,
+ std::unique_ptr<base::DictionaryValue>);
+
base::Process process_;
base::CommandLine command_;
base::ScopedTempDir user_data_dir_;

Powered by Google App Engine
This is Rietveld 408576698