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