Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3253)

Unified Diff: headless/lib/browser/headless_window_tree_host.cc

Issue 1991953002: Implement a runtime headless mode for Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: headless/lib/browser/headless_window_tree_host.cc
diff --git a/headless/lib/browser/headless_window_tree_host.cc b/headless/lib/browser/headless_window_tree_host.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eddedcd60954deaf9a810d7bf08b3ecfb2fed909
--- /dev/null
+++ b/headless/lib/browser/headless_window_tree_host.cc
@@ -0,0 +1,68 @@
+// Copyright 2016 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 "headless/lib/browser/headless_window_tree_host.h"
+
+#include "ui/gfx/icc_profile.h"
+
+namespace headless {
+
+HeadlessWindowTreeHost::HeadlessWindowTreeHost(const gfx::Rect& bounds)
+ : bounds_(bounds) {
+ CreateCompositor();
+ OnAcceleratedWidgetAvailable();
+}
+
+HeadlessWindowTreeHost::~HeadlessWindowTreeHost() {
+ DestroyCompositor();
+ DestroyDispatcher();
+}
+
+bool HeadlessWindowTreeHost::CanDispatchEvent(const ui::PlatformEvent& event) {
+ return false;
+}
+
+uint32_t HeadlessWindowTreeHost::DispatchEvent(const ui::PlatformEvent& event) {
+ return 0;
+}
+
+ui::EventSource* HeadlessWindowTreeHost::GetEventSource() {
+ return this;
+}
+
+gfx::AcceleratedWidget HeadlessWindowTreeHost::GetAcceleratedWidget() {
+ return gfx::AcceleratedWidget();
+}
+
+gfx::Rect HeadlessWindowTreeHost::GetBounds() const {
+ return bounds_;
+}
+
+void HeadlessWindowTreeHost::SetBounds(const gfx::Rect& bounds) {
+ bounds_ = bounds;
Eric Seckler 2016/11/28 15:51:48 You might want to call OnHostMoved() / OnHostResiz
Sami 2016/11/28 18:00:36 Thanks, done!
+}
+
+void HeadlessWindowTreeHost::ShowImpl() {}
+
+void HeadlessWindowTreeHost::HideImpl() {}
+
+gfx::Point HeadlessWindowTreeHost::GetLocationOnNativeScreen() const {
+ return gfx::Point();
+}
+
+void HeadlessWindowTreeHost::SetCapture() {}
+
+void HeadlessWindowTreeHost::ReleaseCapture() {}
+
+void HeadlessWindowTreeHost::SetCursorNative(gfx::NativeCursor cursor_type) {}
+
+void HeadlessWindowTreeHost::MoveCursorToNative(const gfx::Point& location) {}
+
+void HeadlessWindowTreeHost::OnCursorVisibilityChangedNative(bool show) {}
+
+gfx::ICCProfile HeadlessWindowTreeHost::GetICCProfileForCurrentDisplay() {
+ return gfx::ICCProfile();
+}
+
+} // namespace headless

Powered by Google App Engine
This is Rietveld 408576698