Index: chrome/browser/automation/testing_automation_provider_win.cc |
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 0000000000000000000000000000000000000000..dcb8b1c76c0e0c1bae8bd0ffd95dfd206c2622dd |
--- /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); |
+ } |
+} |
+ |