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

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

Issue 2013713002: Revert of Finish eliminating PlatformWindowMus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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') | no next file » | 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
index 7aacf283586aadaefb9785852351cc9b82bd53d6..e360eb05b46ba0ed6769758e0e49a248ecd6b3d9 100644
--- a/ui/views/mus/window_tree_host_mus.cc
+++ b/ui/views/mus/window_tree_host_mus.cc
@@ -5,20 +5,14 @@
#include "ui/views/mus/window_tree_host_mus.h"
#include "base/memory/ptr_util.h"
-#include "components/bitmap_uploader/bitmap_uploader.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
-#include "ui/base/view_prop.h"
#include "ui/events/event.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"
+#include "ui/views/mus/platform_window_mus.h"
namespace views {
-
-namespace {
-static uint32_t accelerated_widget_count = 1;
-}
////////////////////////////////////////////////////////////////////////////////
// WindowTreeHostMus, public:
@@ -27,35 +21,8 @@
NativeWidgetMus* native_widget,
mus::Window* window)
: native_widget_(native_widget) {
- // 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)
- gfx::AcceleratedWidget accelerated_widget =
- reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
-#else
- gfx::AcceleratedWidget accelerated_widget =
- static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
-#endif
-
- // TODO(markdittmer): StubWindow will call |OnAcceleratedWidgetAvailable| with
- // device pixel ratio = 1. Really, this ratio should be consistent with that
- // of |window|.
- SetPlatformWindow(base::WrapUnique(
- new ui::StubWindow(this, accelerated_widget)));
-
- // If no connector was passed, then it's entirely possible that mojo has not
- // been initialized and BitmapUploader will not work. This occurs, for
- // example, in some unit test contexts.
- if (connector) {
- bitmap_uploader_.reset(new bitmap_uploader::BitmapUploader(window));
- bitmap_uploader_->Init(connector);
- prop_.reset(new ui::ViewProp(
- accelerated_widget,
- bitmap_uploader::kBitmapUploaderForAcceleratedWidget,
- bitmap_uploader_.get()));
- }
-
+ SetPlatformWindow(
+ base::WrapUnique(new PlatformWindowMus(this, connector, window)));
// The location of events is already transformed, and there is no way to
// correctly determine the reverse transform. So, don't attempt to transform
// event locations, else the root location is wrong.
@@ -70,6 +37,11 @@
WindowTreeHostMus::~WindowTreeHostMus() {
DestroyCompositor();
DestroyDispatcher();
+}
+
+PlatformWindowMus* WindowTreeHostMus::platform_window() {
+ return static_cast<PlatformWindowMus*>(
+ WindowTreeHostPlatform::platform_window());
}
void WindowTreeHostMus::DispatchEvent(ui::Event* event) {
« no previous file with comments | « ui/views/mus/window_tree_host_mus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698