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

Unified Diff: ui/aura/window_tree_host_android.cc

Issue 1284343005: NOT FOR REVIEW: Aura on Android - content shell compiles Base URL: https://chromium.googlesource.com/chromium/src.git@build_ALL_patch
Patch Set: Created 5 years, 4 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/window_tree_host_android.cc
diff --git a/ui/aura/window_tree_host_android.cc b/ui/aura/window_tree_host_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8bd5b2b5e4b344c0d94dd9463f6a649b01842596
--- /dev/null
+++ b/ui/aura/window_tree_host_android.cc
@@ -0,0 +1,125 @@
+// Copyright 2013 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/window_tree_host_android.h"
+
+#include "base/trace_event/trace_event.h"
+#include "ui/aura/window_event_dispatcher.h"
+//#include "ui/ozone/public/ozone_platform.h"
+//#include "ui/platform_window/platform_window.h"
+#include "ui/platform_window/android/platform_window_android.h"
+
+namespace aura {
+
+WindowTreeHostAndroid::WindowTreeHostAndroid(const gfx::Rect& bounds)
+ : widget_(gfx::kNullAcceleratedWidget), current_cursor_(ui::kCursorNull) {
+ platform_window_.reset(new ui::PlatformWindowAndroid(this));
+ platform_window_->SetBounds(bounds);
+}
+
+WindowTreeHostAndroid::~WindowTreeHostAndroid() {
+ DestroyCompositor();
+ DestroyDispatcher();
+}
+
+ui::EventSource* WindowTreeHostAndroid::GetEventSource() {
+ return this;
+}
+
+gfx::AcceleratedWidget WindowTreeHostAndroid::GetAcceleratedWidget() {
+ return widget_;
+}
+
+void WindowTreeHostAndroid::ShowImpl() {
+ platform_window_->Show();
+}
+
+void WindowTreeHostAndroid::HideImpl() {
+ platform_window_->Hide();
+}
+
+gfx::Rect WindowTreeHostAndroid::GetBounds() const {
+ return platform_window_->GetBounds();
+}
+
+void WindowTreeHostAndroid::SetBounds(const gfx::Rect& bounds) {
+ platform_window_->SetBounds(bounds);
+}
+
+gfx::Point WindowTreeHostAndroid::GetLocationOnNativeScreen() const {
+ return platform_window_->GetBounds().origin();
+}
+
+void WindowTreeHostAndroid::SetCapture() {
+ platform_window_->SetCapture();
+}
+
+void WindowTreeHostAndroid::ReleaseCapture() {
+ platform_window_->ReleaseCapture();
+}
+
+void WindowTreeHostAndroid::SetCursorNative(gfx::NativeCursor cursor) {
+ if (cursor == current_cursor_)
+ return;
+ current_cursor_ = cursor;
+ platform_window_->SetCursor(cursor.platform());
+}
+
+void WindowTreeHostAndroid::MoveCursorToNative(const gfx::Point& location) {
+ platform_window_->MoveCursorTo(location);
+}
+
+void WindowTreeHostAndroid::OnCursorVisibilityChangedNative(bool show) {
+}
+
+void WindowTreeHostAndroid::OnBoundsChanged(const gfx::Rect& new_bounds) {
+ // TOOD(spang): Should we determine which parts changed?
+ OnHostResized(new_bounds.size());
+ OnHostMoved(new_bounds.origin());
+}
+
+void WindowTreeHostAndroid::OnDamageRect(const gfx::Rect& damaged_region) {
+}
+
+void WindowTreeHostAndroid::DispatchEvent(ui::Event* event) {
+ TRACE_EVENT0("input", "WindowTreeHostAndroid::DispatchEvent");
+ SendEventToProcessor(event);
+}
+
+void WindowTreeHostAndroid::OnCloseRequest() {
+ OnHostCloseRequested();
+}
+
+void WindowTreeHostAndroid::OnClosed() {
+}
+
+void WindowTreeHostAndroid::OnWindowStateChanged(
+ ui::PlatformWindowState new_state) {
+}
+
+void WindowTreeHostAndroid::OnLostCapture() {
+}
+
+void WindowTreeHostAndroid::OnAcceleratedWidgetAvailable(
+ gfx::AcceleratedWidget widget,
+ float device_pixel_ratio) {
+ widget_ = widget;
+ CreateCompositor(widget_);
no sievers 2015/08/15 01:21:40 Generally this might be good enough to get you goi
+}
+
+void WindowTreeHostAndroid::OnActivationChanged(bool active) {
+}
+
+// static
+WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
+ return new WindowTreeHostAndroid(bounds);
+}
+
+// static
+gfx::Size WindowTreeHost::GetNativeScreenSize() {
+ NOTIMPLEMENTED();
+ return gfx::Size();
+}
+
+} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698