summaryrefslogtreecommitdiffstats
path: root/ui/ozone/platform/test/test_window.cc
blob: 2890ccf31d77f9baa4c826bf916abf35d172919c (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright 2014 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 "ui/ozone/platform/test/test_window.h"

#include <string>

#include "base/files/file_path.h"
#include "base/strings/string_number_conversions.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/ozone/platform/test/test_window_manager.h"
#include "ui/platform_window/platform_window_delegate.h"

namespace ui {

TestWindow::TestWindow(PlatformWindowDelegate* delegate,
                       TestWindowManager* manager,
                       const gfx::Rect& bounds)
    : delegate_(delegate), manager_(manager), bounds_(bounds) {
  widget_ = manager_->AddWindow(this);
  delegate_->OnAcceleratedWidgetAvailable(widget_);
}

TestWindow::~TestWindow() {
  manager_->RemoveWindow(widget_, this);
}

base::FilePath TestWindow::path() {
  base::FilePath base_path = manager_->base_path();
  if (base_path.empty() || base_path == base::FilePath("/dev/null"))
    return base_path;

  // Disambiguate multiple window output files with the window id.
  return base_path.Append(base::IntToString(widget_));
}

gfx::Rect TestWindow::GetBounds() {
  return bounds_;
}

void TestWindow::SetBounds(const gfx::Rect& bounds) {
  bounds_ = bounds;
  delegate_->OnBoundsChanged(bounds);
}

void TestWindow::Show() {
}

void TestWindow::Hide() {
}

void TestWindow::Close() {
}

void TestWindow::SetCapture() {
}

void TestWindow::ReleaseCapture() {
}

void TestWindow::ToggleFullscreen() {
}

void TestWindow::Maximize() {
}

void TestWindow::Minimize() {
}

void TestWindow::Restore() {
}

void TestWindow::SetCursor(PlatformCursor cursor) {
}

void TestWindow::MoveCursorTo(const gfx::Point& location) {
}

void TestWindow::ConfineCursorToBounds(const gfx::Rect& bounds) {
}

}  // namespace ui