summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/testing_automation_provider_win.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 22:35:18 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 22:35:18 +0000
commit7256dabd02eaafcfdae1e20253cc8eeb25e677cc (patch)
tree4707da93349bc4de18e1ac7c0933075e31af59cc /chrome/browser/automation/testing_automation_provider_win.cc
parent6928c77fd5827419081b8b010c729419d6cd8e5a (diff)
downloadchromium_src-7256dabd02eaafcfdae1e20253cc8eeb25e677cc.zip
chromium_src-7256dabd02eaafcfdae1e20253cc8eeb25e677cc.tar.gz
chromium_src-7256dabd02eaafcfdae1e20253cc8eeb25e677cc.tar.bz2
GTTF: next batch of automation separation.
TEST=none BUG=52097 Review URL: http://codereview.chromium.org/3191015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/testing_automation_provider_win.cc')
-rw-r--r--chrome/browser/automation/testing_automation_provider_win.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome/browser/automation/testing_automation_provider_win.cc b/chrome/browser/automation/testing_automation_provider_win.cc
new file mode 100644
index 0000000..dcb8b1c
--- /dev/null
+++ b/chrome/browser/automation/testing_automation_provider_win.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/automation/testing_automation_provider.h"
+
+#include <windows.h>
+
+#include "chrome/browser/automation/automation_window_tracker.h"
+
+void TestingAutomationProvider::ActivateWindow(int handle) {
+ if (window_tracker_->ContainsHandle(handle)) {
+ ::SetActiveWindow(window_tracker_->GetResource(handle));
+ }
+}
+
+void TestingAutomationProvider::IsWindowMaximized(int handle,
+ bool* is_maximized,
+ bool* success) {
+ *success = false;
+
+ HWND hwnd = window_tracker_->GetResource(handle);
+ if (hwnd) {
+ *success = true;
+ WINDOWPLACEMENT window_placement;
+ GetWindowPlacement(hwnd, &window_placement);
+ *is_maximized = (window_placement.showCmd == SW_MAXIMIZE);
+ }
+}
+