| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/automation/automation_window_tracker.h" | 8 #include "chrome/browser/automation/automation_window_tracker.h" |
| 9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 #include "ui/aura_shell/window_util.h" | |
| 12 #include "ui/base/ui_base_types.h" | 11 #include "ui/base/ui_base_types.h" |
| 13 | 12 |
| 14 void TestingAutomationProvider::ActivateWindow(int handle) { | 13 void TestingAutomationProvider::ActivateWindow(int handle) { |
| 15 aura::Window* window = window_tracker_->GetResource(handle); | 14 aura::Window* window = window_tracker_->GetResource(handle); |
| 16 if (window) { | 15 if (window) { |
| 17 aura_shell::ActivateWindow(window); | 16 window->Activate(); |
| 18 } | 17 } |
| 19 } | 18 } |
| 20 | 19 |
| 21 void TestingAutomationProvider::IsWindowMaximized(int handle, | 20 void TestingAutomationProvider::IsWindowMaximized(int handle, |
| 22 bool* is_maximized, | 21 bool* is_maximized, |
| 23 bool* success) { | 22 bool* success) { |
| 24 aura::Window* window = window_tracker_->GetResource(handle); | 23 aura::Window* window = window_tracker_->GetResource(handle); |
| 25 if (window) { | 24 if (window) { |
| 26 int show_state = window->GetIntProperty(aura::kShowStateKey); | 25 int show_state = window->GetIntProperty(aura::kShowStateKey); |
| 27 *is_maximized = (show_state == ui::SHOW_STATE_MAXIMIZED); | 26 *is_maximized = (show_state == ui::SHOW_STATE_MAXIMIZED); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 *result = false; | 76 *result = false; |
| 78 } | 77 } |
| 79 } | 78 } |
| 80 | 79 |
| 81 void TestingAutomationProvider::GetWindowTitle(int handle, string16* text) { | 80 void TestingAutomationProvider::GetWindowTitle(int handle, string16* text) { |
| 82 const aura::Window* window = window_tracker_->GetResource(handle); | 81 const aura::Window* window = window_tracker_->GetResource(handle); |
| 83 DCHECK(window); | 82 DCHECK(window); |
| 84 *text = window->title(); | 83 *text = window->title(); |
| 85 } | 84 } |
| 86 | 85 |
| OLD | NEW |