• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
15 namespace ui {
16 
TestWindow(PlatformWindowDelegate * delegate,TestWindowManager * manager,const gfx::Rect & bounds)17 TestWindow::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 
~TestWindow()25 TestWindow::~TestWindow() {
26   manager_->RemoveWindow(widget_, this);
27 }
28 
path()29 base::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 
GetBounds()38 gfx::Rect TestWindow::GetBounds() {
39   return bounds_;
40 }
41 
SetBounds(const gfx::Rect & bounds)42 void TestWindow::SetBounds(const gfx::Rect& bounds) {
43   bounds_ = bounds;
44   delegate_->OnBoundsChanged(bounds);
45 }
46 
Show()47 void TestWindow::Show() {
48 }
49 
Hide()50 void TestWindow::Hide() {
51 }
52 
Close()53 void TestWindow::Close() {
54 }
55 
SetCapture()56 void TestWindow::SetCapture() {
57 }
58 
ReleaseCapture()59 void TestWindow::ReleaseCapture() {
60 }
61 
ToggleFullscreen()62 void TestWindow::ToggleFullscreen() {
63 }
64 
Maximize()65 void TestWindow::Maximize() {
66 }
67 
Minimize()68 void TestWindow::Minimize() {
69 }
70 
Restore()71 void TestWindow::Restore() {
72 }
73 
SetCursor(PlatformCursor cursor)74 void TestWindow::SetCursor(PlatformCursor cursor) {
75 }
76 
MoveCursorTo(const gfx::Point & location)77 void TestWindow::MoveCursorTo(const gfx::Point& location) {
78 }
79 
80 }  // namespace ui
81