| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/automation/automation_browser_tracker.h" | 11 #include "chrome/browser/automation/automation_browser_tracker.h" |
| 12 #include "chrome/browser/automation/automation_window_tracker.h" | 12 #include "chrome/browser/automation/automation_window_tracker.h" |
| 13 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
| 14 | 15 |
| 15 void TestingAutomationProvider::ActivateWindow(int handle) { | 16 void TestingAutomationProvider::ActivateWindow(int handle) { |
| 16 if (window_tracker_->ContainsHandle(handle)) { | 17 if (window_tracker_->ContainsHandle(handle)) { |
| 17 ::SetActiveWindow(window_tracker_->GetResource(handle)); | 18 ::SetActiveWindow(window_tracker_->GetResource(handle)); |
| 18 } | 19 } |
| 19 } | 20 } |
| 20 | 21 |
| 21 void TestingAutomationProvider::IsWindowMaximized(int handle, | 22 void TestingAutomationProvider::IsWindowMaximized(int handle, |
| 22 bool* is_maximized, | 23 bool* is_maximized, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 87 |
| 87 void TestingAutomationProvider::GetWindowTitle(int handle, string16* text) { | 88 void TestingAutomationProvider::GetWindowTitle(int handle, string16* text) { |
| 88 gfx::NativeWindow window = window_tracker_->GetResource(handle); | 89 gfx::NativeWindow window = window_tracker_->GetResource(handle); |
| 89 int length = ::GetWindowTextLength(window) + 1; | 90 int length = ::GetWindowTextLength(window) + 1; |
| 90 if (length > 1) | 91 if (length > 1) |
| 91 ::GetWindowText(window, WriteInto(text, length), length); | 92 ::GetWindowText(window, WriteInto(text, length), length); |
| 92 else | 93 else |
| 93 text->clear(); | 94 text->clear(); |
| 94 } | 95 } |
| 95 | 96 |
| OLD | NEW |