1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "ui/ozone/platform/test/test_window.h" 6 7#include <string> 8 9#include "base/files/file_path.h" 10#include "base/strings/string_number_conversions.h" 11#include "ui/events/platform/platform_event_source.h" 12#include "ui/ozone/platform/test/test_window_manager.h" 13#include "ui/platform_window/platform_window_delegate.h" 14 15namespace ui { 16 17TestWindow::TestWindow(PlatformWindowDelegate* delegate, 18 TestWindowManager* manager, 19 const gfx::Rect& bounds) 20 : delegate_(delegate), manager_(manager), bounds_(bounds) { 21 widget_ = manager_->AddWindow(this); 22 delegate_->OnAcceleratedWidgetAvailable(widget_); 23} 24 25TestWindow::~TestWindow() { 26 manager_->RemoveWindow(widget_, this); 27} 28 29base::FilePath TestWindow::path() { 30 base::FilePath base_path = manager_->base_path(); 31 if (base_path.empty() || base_path == base::FilePath("/dev/null")) 32 return base_path; 33 34 // Disambiguate multiple window output files with the window id. 35 return base_path.Append(base::IntToString(widget_)); 36} 37 38gfx::Rect TestWindow::GetBounds() { 39 return bounds_; 40} 41 42void TestWindow::SetBounds(const gfx::Rect& bounds) { 43 bounds_ = bounds; 44 delegate_->OnBoundsChanged(bounds); 45} 46 47void TestWindow::Show() { 48} 49 50void TestWindow::Hide() { 51} 52 53void TestWindow::Close() { 54} 55 56void TestWindow::SetCapture() { 57} 58 59void TestWindow::ReleaseCapture() { 60} 61 62void TestWindow::ToggleFullscreen() { 63} 64 65void TestWindow::Maximize() { 66} 67 68void TestWindow::Minimize() { 69} 70 71void TestWindow::Restore() { 72} 73 74void TestWindow::SetCursor(PlatformCursor cursor) { 75} 76 77void TestWindow::MoveCursorTo(const gfx::Point& location) { 78} 79 80} // namespace ui 81