summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/testing_automation_provider_aura.cc
blob: 95e02c68004aa163c33ca5903e673183acd04d58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2012 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 "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"

#if defined(USE_ASH)
#include "ash/wm/window_util.h"
#endif

void TestingAutomationProvider::TerminateSession(int handle, bool* success) {
  *success = false;
}

void TestingAutomationProvider::SetWindowBounds(int handle,
                                                const gfx::Rect& bounds,
                                                bool* success) {
  aura::Window* window = window_tracker_->GetResource(handle);
  if (window) {
    window->SetBounds(bounds);
    *success = true;
  } else {
    *success = false;
  }
}