Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
|
Sami
2015/10/26 16:47:07
2015
altimin
2015/10/26 17:24:21
Done.
| |
| 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/headless/headless_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/headless/headless_window_manager.h" | |
| 13 #include "ui/platform_window/platform_window_delegate.h" | |
| 14 | |
| 15 namespace ui { | |
| 16 | |
| 17 HeadlessWindow::HeadlessWindow(PlatformWindowDelegate* delegate, | |
| 18 HeadlessWindowManager* manager, | |
| 19 const gfx::Rect& bounds) | |
| 20 : delegate_(delegate), manager_(manager), bounds_(bounds) { | |
| 21 widget_ = manager_->AddWindow(this); | |
| 22 delegate_->OnAcceleratedWidgetAvailable(widget_, 1.f); | |
| 23 } | |
| 24 | |
| 25 HeadlessWindow::~HeadlessWindow() { | |
| 26 manager_->RemoveWindow(widget_, this); | |
| 27 } | |
| 28 | |
| 29 base::FilePath HeadlessWindow::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 HeadlessWindow::GetBounds() { | |
| 39 return bounds_; | |
| 40 } | |
| 41 | |
| 42 void HeadlessWindow::SetBounds(const gfx::Rect& bounds) { | |
| 43 bounds_ = bounds; | |
| 44 delegate_->OnBoundsChanged(bounds); | |
| 45 } | |
| 46 | |
| 47 void HeadlessWindow::SetTitle(const base::string16& title) {} | |
| 48 | |
| 49 void HeadlessWindow::Show() {} | |
| 50 | |
| 51 void HeadlessWindow::Hide() {} | |
| 52 | |
| 53 void HeadlessWindow::Close() {} | |
| 54 | |
| 55 void HeadlessWindow::SetCapture() {} | |
| 56 | |
| 57 void HeadlessWindow::ReleaseCapture() {} | |
| 58 | |
| 59 void HeadlessWindow::ToggleFullscreen() {} | |
| 60 | |
| 61 void HeadlessWindow::Maximize() {} | |
| 62 | |
| 63 void HeadlessWindow::Minimize() {} | |
| 64 | |
| 65 void HeadlessWindow::Restore() {} | |
| 66 | |
| 67 void HeadlessWindow::SetCursor(PlatformCursor cursor) {} | |
| 68 | |
| 69 void HeadlessWindow::MoveCursorTo(const gfx::Point& location) {} | |
| 70 | |
| 71 void HeadlessWindow::ConfineCursorToBounds(const gfx::Rect& bounds) {} | |
| 72 | |
| 73 PlatformImeController* HeadlessWindow::GetPlatformImeController() { | |
| 74 return nullptr; | |
| 75 } | |
| 76 | |
| 77 } // namespace ui | |
| OLD | NEW |