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

Unified Diff: mojo/aura/window_tree_host_mojo.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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
« no previous file with comments | « mojo/aura/window_tree_host_mojo.h ('k') | mojo/services/view_manager/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/aura/window_tree_host_mojo.cc
diff --git a/mojo/aura/window_tree_host_mojo.cc b/mojo/aura/window_tree_host_mojo.cc
deleted file mode 100644
index ddb316f878995cd624dae4986259f5fb372343ed..0000000000000000000000000000000000000000
--- a/mojo/aura/window_tree_host_mojo.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2014 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 "mojo/aura/window_tree_host_mojo.h"
-
-#include "mojo/aura/surface_context_factory.h"
-#include "mojo/converters/geometry/geometry_type_converters.h"
-#include "mojo/public/interfaces/application/shell.mojom.h"
-#include "mojo/services/view_manager/public/cpp/view_manager.h"
-#include "ui/aura/env.h"
-#include "ui/aura/window.h"
-#include "ui/aura/window_event_dispatcher.h"
-#include "ui/events/event.h"
-#include "ui/events/event_constants.h"
-
-namespace mojo {
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowTreeHostMojo, public:
-
-WindowTreeHostMojo::WindowTreeHostMojo(Shell* shell, View* view)
- : view_(view), bounds_(view->bounds().To<gfx::Rect>()) {
- view_->AddObserver(this);
-
- context_factory_.reset(new SurfaceContextFactory(shell, view_));
- // WindowTreeHost creates the compositor using the ContextFactory from
- // aura::Env. Install |context_factory_| there so that |context_factory_| is
- // picked up.
- ui::ContextFactory* default_context_factory =
- aura::Env::GetInstance()->context_factory();
- aura::Env::GetInstance()->set_context_factory(context_factory_.get());
- CreateCompositor(GetAcceleratedWidget());
- aura::Env::GetInstance()->set_context_factory(default_context_factory);
- DCHECK_EQ(context_factory_.get(), compositor()->context_factory());
-}
-
-WindowTreeHostMojo::~WindowTreeHostMojo() {
- view_->RemoveObserver(this);
- DestroyCompositor();
- DestroyDispatcher();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowTreeHostMojo, aura::WindowTreeHost implementation:
-
-ui::EventSource* WindowTreeHostMojo::GetEventSource() {
- return this;
-}
-
-gfx::AcceleratedWidget WindowTreeHostMojo::GetAcceleratedWidget() {
- return gfx::kNullAcceleratedWidget;
-}
-
-void WindowTreeHostMojo::Show() {
- window()->Show();
-}
-
-void WindowTreeHostMojo::Hide() {
-}
-
-gfx::Rect WindowTreeHostMojo::GetBounds() const {
- return bounds_;
-}
-
-void WindowTreeHostMojo::SetBounds(const gfx::Rect& bounds) {
- window()->SetBounds(gfx::Rect(bounds.size()));
-}
-
-gfx::Point WindowTreeHostMojo::GetLocationOnNativeScreen() const {
- return gfx::Point(0, 0);
-}
-
-void WindowTreeHostMojo::SetCapture() {
- NOTIMPLEMENTED();
-}
-
-void WindowTreeHostMojo::ReleaseCapture() {
- NOTIMPLEMENTED();
-}
-
-void WindowTreeHostMojo::PostNativeEvent(
- const base::NativeEvent& native_event) {
- NOTIMPLEMENTED();
-}
-
-void WindowTreeHostMojo::SetCursorNative(gfx::NativeCursor cursor) {
- NOTIMPLEMENTED();
-}
-
-void WindowTreeHostMojo::MoveCursorToNative(const gfx::Point& location) {
- NOTIMPLEMENTED();
-}
-
-void WindowTreeHostMojo::OnCursorVisibilityChangedNative(bool show) {
- NOTIMPLEMENTED();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowTreeHostMojo, ui::EventSource implementation:
-
-ui::EventProcessor* WindowTreeHostMojo::GetEventProcessor() {
- return dispatcher();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowTreeHostMojo, ViewObserver implementation:
-
-void WindowTreeHostMojo::OnViewBoundsChanged(
- View* view,
- const Rect& old_bounds,
- const Rect& new_bounds) {
- gfx::Rect old_bounds2 = old_bounds.To<gfx::Rect>();
- gfx::Rect new_bounds2 = new_bounds.To<gfx::Rect>();
- bounds_ = new_bounds2;
- if (old_bounds2.origin() != new_bounds2.origin())
- OnHostMoved(bounds_.origin());
- if (old_bounds2.size() != new_bounds2.size())
- OnHostResized(bounds_.size());
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/aura/window_tree_host_mojo.h ('k') | mojo/services/view_manager/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698