blob: dcb8b1c76c0e0c1bae8bd0ffd95dfd206c2622dd [file] [log] [blame]
// 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);
}
}