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 // Launches an app with the specified id.
31 Status
LaunchApp(std::string id
);
33 // Gets the position of the current window.
34 Status
GetWindowPosition(int* x
, int* y
);
36 // Sets the position of the current window.
37 Status
SetWindowPosition(int x
, int y
);
39 // Gets the size of the current window.
40 Status
GetWindowSize(int* width
, int* height
);
42 // Sets the size of the current window.
43 Status
SetWindowSize(int width
, int height
);
45 // Maximizes the current window.
46 Status
MaximizeWindow();
49 Status
GetWindowInfo(int* x
, int* y
, int* width
, int* height
);
50 Status
UpdateWindow(const base::DictionaryValue
& update_info
);
52 scoped_ptr
<WebView
> web_view_
;
54 DISALLOW_COPY_AND_ASSIGN(AutomationExtension
);
57 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_AUTOMATION_EXTENSION_H_