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
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_AUTOMATION_EXTENSION_H_
6 #define CHROME_TEST_CHROMEDRIVER_CHROME_AUTOMATION_EXTENSION_H_
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
14 class DictionaryValue;
20 // Automates Chrome through the extension APIs.
21 class AutomationExtension {
23 explicit AutomationExtension(scoped_ptr<WebView> web_view);
24 ~AutomationExtension();
26 // Captures the visible part of the current tab as a base64-encoded PNG.
27 // Returns |kForbidden| for security restricted pages.
28 Status CaptureScreenshot(std::string* screenshot);
30 // Gets the position of the current window.
31 Status GetWindowPosition(int* x, int* y);
33 // Sets the position of the current window.
34 Status SetWindowPosition(int x, int y);
36 // Gets the size of the current window.
37 Status GetWindowSize(int* width, int* height);
39 // Sets the size of the current window.
40 Status SetWindowSize(int width, int height);
42 // Maximizes the current window.
43 Status MaximizeWindow();
46 Status GetWindowInfo(int* x, int* y, int* width, int* height);
47 Status UpdateWindow(const base::DictionaryValue& update_info);
49 scoped_ptr<WebView> web_view_;
51 DISALLOW_COPY_AND_ASSIGN(AutomationExtension);
54 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_AUTOMATION_EXTENSION_H_