OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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. |
| 4 |
| 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 |
| 7 #include <windows.h> |
| 8 |
| 9 #include "chrome/browser/automation/automation_window_tracker.h" |
| 10 |
| 11 void TestingAutomationProvider::ActivateWindow(int handle) { |
| 12 if (window_tracker_->ContainsHandle(handle)) { |
| 13 ::SetActiveWindow(window_tracker_->GetResource(handle)); |
| 14 } |
| 15 } |
| 16 |
| 17 void TestingAutomationProvider::IsWindowMaximized(int handle, |
| 18 bool* is_maximized, |
| 19 bool* success) { |
| 20 *success = false; |
| 21 |
| 22 HWND hwnd = window_tracker_->GetResource(handle); |
| 23 if (hwnd) { |
| 24 *success = true; |
| 25 WINDOWPLACEMENT window_placement; |
| 26 GetWindowPlacement(hwnd, &window_placement); |
| 27 *is_maximized = (window_placement.showCmd == SW_MAXIMIZE); |
| 28 } |
| 29 } |
| 30 |
OLD | NEW |