Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: chrome/browser/automation/testing_automation_provider_aura.cc

Issue 8506034: Implement some functions in testing_automation_provider_aura.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fit nit and fix build (oops) Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/testing_automation_provider_aura.cc
diff --git a/chrome/browser/automation/testing_automation_provider_aura.cc b/chrome/browser/automation/testing_automation_provider_aura.cc
index 191dbbbb1da905ed855d70f08224de5f199bd2d6..e246d58744975d3eca0d669a3f3dba74284b8c00 100644
--- a/chrome/browser/automation/testing_automation_provider_aura.cc
+++ b/chrome/browser/automation/testing_automation_provider_aura.cc
@@ -5,47 +5,81 @@
#include "chrome/browser/automation/testing_automation_provider.h"
#include "base/logging.h"
+#include "chrome/browser/automation/automation_window_tracker.h"
+#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/window.h"
+#include "ui/base/ui_base_types.h"
void TestingAutomationProvider::ActivateWindow(int handle) {
- // TODO(beng):
- NOTIMPLEMENTED();
+ aura::Window* window = window_tracker_->GetResource(handle);
+ if (window) {
+ window->Activate();
+ }
}
void TestingAutomationProvider::IsWindowMaximized(int handle,
bool* is_maximized,
bool* success) {
- // TODO(beng):
- NOTIMPLEMENTED();
+ aura::Window* window = window_tracker_->GetResource(handle);
+ if (window) {
+ int show_state = window->GetIntProperty(aura::kShowStateKey);
+ *is_maximized = (show_state == ui::SHOW_STATE_MAXIMIZED);
+ *success = true;
+ } else {
+ *success = false;
+ }
}
void TestingAutomationProvider::TerminateSession(int handle, bool* success) {
- // TODO(beng):
+ // TODO(benrg): what should this do in aura? It's
+ // currently unimplemented in most other providers.
+ *success = false;
NOTIMPLEMENTED();
}
void TestingAutomationProvider::GetWindowBounds(int handle,
gfx::Rect* bounds,
bool* success) {
- // TODO(beng):
- NOTIMPLEMENTED();
+ const aura::Window* window = window_tracker_->GetResource(handle);
+ if (window) {
+ *bounds = window->bounds();
+ *success = true;
+ } else {
+ *success = false;
+ }
}
void TestingAutomationProvider::SetWindowBounds(int handle,
const gfx::Rect& bounds,
bool* success) {
- // TODO(beng):
- NOTIMPLEMENTED();
+ aura::Window* window = window_tracker_->GetResource(handle);
+ if (window) {
+ window->SetBounds(bounds);
+ *success = true;
+ } else {
+ *success = false;
+ }
}
void TestingAutomationProvider::SetWindowVisible(int handle,
bool visible,
bool* result) {
- // TODO(beng):
- NOTIMPLEMENTED();
+ aura::Window* window = window_tracker_->GetResource(handle);
+ if (window) {
+ if (visible) {
+ window->Show();
+ } else {
+ window->Hide();
+ }
+ *result = true;
+ } else {
+ *result = false;
+ }
}
void TestingAutomationProvider::GetWindowTitle(int handle, string16* text) {
- // TODO(beng):
- NOTIMPLEMENTED();
+ const aura::Window* window = window_tracker_->GetResource(handle);
+ DCHECK(window);
+ *text = window->title();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698