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

Unified Diff: ui/aura/root_window_host_linux.cc

Issue 13886018: Add a factory and defines for native Linux surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get {base,ui,aura}_unittests working with native linux surface Created 7 years, 8 months 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: ui/aura/root_window_host_linux.cc
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a1d64479e81afcc77dd082d3796ce55235ad8e07
--- /dev/null
+++ b/ui/aura/root_window_host_linux.cc
@@ -0,0 +1,150 @@
+// Copyright (c) 2012 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 "ui/aura/root_window_host_linux.h"
+
+#include "ui/aura/root_window.h"
+
+namespace aura {
+
+RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds)
+ : delegate_(NULL),
+ bounds_(bounds),
+ factory_(new ui::EventFactoryEvdev()) {
+ factory_->CreateEvdevWatchers();
+ base::MessagePumpLinux::Current()->AddDispatcherForRootWindow(this);
+}
+
+RootWindowHostLinux::~RootWindowHostLinux() {
+ // base::MessagePumpCroid::Current()->SetDefaultDispatcher(0);
+}
+
+bool RootWindowHostLinux::Dispatch(const base::NativeEvent& ne) {
+ ui::TouchEvent* touchev = static_cast<ui::TouchEvent*>(ne);
+ delegate_->OnHostTouchEvent(touchev);
+ return true;
+}
+
+void RootWindowHostLinux::SetDelegate(RootWindowHostDelegate* delegate) {
+ delegate_ = delegate;
+}
+
+RootWindow* RootWindowHostLinux::GetRootWindow() {
+ return delegate_->AsRootWindow();
+}
+
+gfx::AcceleratedWidget RootWindowHostLinux::GetAcceleratedWidget() {
+ return static_cast<gfx::AcceleratedWidget>(1);
+}
+
+void RootWindowHostLinux::Show() {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::Hide() {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::ToggleFullScreen() {
+ NOTIMPLEMENTED();
+}
+
+gfx::Rect RootWindowHostLinux::GetBounds() const {
+ return bounds_;
+}
+
+void RootWindowHostLinux::SetBounds(const gfx::Rect& bounds) {
+ NOTIMPLEMENTED();
+}
+
+gfx::Insets RootWindowHostLinux::GetInsets() const {
+ return gfx::Insets();
+}
+
+void RootWindowHostLinux::SetInsets(const gfx::Insets& insets) {
+ NOTIMPLEMENTED();
+}
+
+gfx::Point RootWindowHostLinux::GetLocationOnNativeScreen() const {
+ return bounds_.origin();
+}
+
+void RootWindowHostLinux::SetCapture() {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::ReleaseCapture() {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) {
+ NOTIMPLEMENTED();
+}
+
+bool RootWindowHostLinux::QueryMouseLocation(gfx::Point* location_return) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool RootWindowHostLinux::ConfineCursorToRootWindow() {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void RootWindowHostLinux::UnConfineCursor() {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::OnCursorVisibilityChanged(bool show) {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::MoveCursorTo(const gfx::Point& location) {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) {
+ NOTIMPLEMENTED();
+}
+
+bool RootWindowHostLinux::CopyAreaToSkCanvas(const gfx::Rect& source_bounds,
+ const gfx::Point& dest_offset,
+ SkCanvas* canvas) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool RootWindowHostLinux::GrabSnapshot(
+ const gfx::Rect& snapshot_bounds,
+ std::vector<unsigned char>* png_representation) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void RootWindowHostLinux::PostNativeEvent(
+ const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::OnDeviceScaleFactorChanged(
+ float device_scale_factor) {
+ NOTIMPLEMENTED();
+}
+
+void RootWindowHostLinux::PrepareForShutdown() {
+ NOTIMPLEMENTED();
+}
+
+// static
+RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) {
+ return new RootWindowHostLinux(bounds);
+}
+
+// static
+gfx::Size RootWindowHost::GetNativeScreenSize() {
+ NOTIMPLEMENTED();
+ return gfx::Size();
+}
+
+} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698