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

Unified Diff: ui/views/mus/window_tree_host_mus.cc

Issue 2611773002: Removes code using mus client lib (Closed)
Patch Set: dont run on linux Created 3 years, 12 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 | « ui/views/mus/window_tree_host_mus.h ('k') | ui/views/test/native_widget_factory_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/window_tree_host_mus.cc
diff --git a/ui/views/mus/window_tree_host_mus.cc b/ui/views/mus/window_tree_host_mus.cc
deleted file mode 100644
index ffb4a827d2db2d8c8a6ae8907052b7bcb47b1062..0000000000000000000000000000000000000000
--- a/ui/views/mus/window_tree_host_mus.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2015 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/views/mus/window_tree_host_mus.h"
-
-#include "base/memory/ptr_util.h"
-#include "services/ui/public/cpp/window.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/gfx/geometry/dip_util.h"
-#include "ui/platform_window/stub/stub_window.h"
-#include "ui/views/mus/input_method_mus.h"
-#include "ui/views/mus/native_widget_mus.h"
-
-namespace views {
-
-namespace {
-static uint32_t accelerated_widget_count = 1;
-
-bool IsUsingTestContext() {
- return aura::Env::GetInstance()->context_factory()->DoesCreateTestContexts();
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowTreeHostMus, public:
-
-WindowTreeHostMus::WindowTreeHostMus(NativeWidgetMus* native_widget,
- ui::Window* window)
- : native_widget_(native_widget) {
- CreateCompositor();
- gfx::AcceleratedWidget accelerated_widget;
- if (IsUsingTestContext()) {
- accelerated_widget = gfx::kNullAcceleratedWidget;
- } else {
- // We need accelerated widget numbers to be different for each
- // window and fit in the smallest sizeof(AcceleratedWidget) uint32_t
- // has this property.
-#if defined(OS_WIN) || defined(OS_ANDROID)
- accelerated_widget =
- reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
-#else
- accelerated_widget =
- static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
-#endif
- }
- // TODO(markdittmer): Use correct device-scale-factor from |window|.
- OnAcceleratedWidgetAvailable(accelerated_widget, 1.f);
-
- SetPlatformWindow(base::MakeUnique<ui::StubWindow>(
- this,
- false)); // Do not advertise accelerated widget; already set manually.
-
- compositor()->SetWindow(window);
-
- // Initialize the stub platform window bounds to those of the ui::Window.
- platform_window()->SetBounds(gfx::ConvertRectToPixel(
- compositor()->device_scale_factor(), window->bounds()));
-
- compositor()->SetHostHasTransparentBackground(true);
-}
-
-WindowTreeHostMus::~WindowTreeHostMus() {
- DestroyCompositor();
- DestroyDispatcher();
-}
-
-void WindowTreeHostMus::DispatchEvent(ui::Event* event) {
- // Key events are sent to InputMethodMus directly from NativeWidgetMus.
- DCHECK(!event->IsKeyEvent());
- WindowTreeHostPlatform::DispatchEvent(event);
-}
-
-void WindowTreeHostMus::OnClosed() {
- if (native_widget_)
- native_widget_->OnPlatformWindowClosed();
-}
-
-void WindowTreeHostMus::OnActivationChanged(bool active) {
- if (active)
- GetInputMethod()->OnFocus();
- else
- GetInputMethod()->OnBlur();
- if (native_widget_)
- native_widget_->OnActivationChanged(active);
- WindowTreeHostPlatform::OnActivationChanged(active);
-}
-
-void WindowTreeHostMus::OnCloseRequest() {
- OnHostCloseRequested();
-}
-
-gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() {
- // TODO: This should read the profile from mus. crbug.com/647510
- return gfx::ICCProfile();
-}
-
-} // namespace views
« no previous file with comments | « ui/views/mus/window_tree_host_mus.h ('k') | ui/views/test/native_widget_factory_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698