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

Unified Diff: ui/views/mus/platform_window_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/platform_window_mus.h ('k') | ui/views/mus/window_tree_host_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/platform_window_mus.cc
diff --git a/ui/views/mus/platform_window_mus.cc b/ui/views/mus/platform_window_mus.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bacc15d22b65f3d306e822e028cf5b282422d779
--- /dev/null
+++ b/ui/views/mus/platform_window_mus.cc
@@ -0,0 +1,109 @@
+// 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/platform_window_mus.h"
+
+#include "build/build_config.h"
+#include "components/bitmap_uploader/bitmap_uploader.h"
+#include "components/mus/public/cpp/property_type_converters.h"
+#include "components/mus/public/cpp/window_property.h"
+#include "components/mus/public/interfaces/window_manager.mojom.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
+#include "ui/base/view_prop.h"
+#include "ui/platform_window/platform_window_delegate.h"
+#include "ui/views/mus/window_manager_connection.h"
+
+using mus::mojom::EventResult;
+
+namespace views {
+
+namespace {
+
+static uint32_t accelerated_widget_count = 1;
+
+} // namespace
+
+PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate,
+ shell::Connector* connector,
+ mus::Window* mus_window)
+ : delegate_(delegate),
+ mus_window_(mus_window),
+ mus_window_destroyed_(false) {
+ DCHECK(delegate_);
+ DCHECK(mus_window_);
+
+ // 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
+ delegate_->OnAcceleratedWidgetAvailable(
+ accelerated_widget, mus_window_->viewport_metrics().device_pixel_ratio);
+
+ if (connector) {
+ bitmap_uploader_.reset(new bitmap_uploader::BitmapUploader(mus_window_));
+ bitmap_uploader_->Init(connector);
+ prop_.reset(
+ new ui::ViewProp(accelerated_widget,
+ bitmap_uploader::kBitmapUploaderForAcceleratedWidget,
+ bitmap_uploader_.get()));
+ }
+}
+
+PlatformWindowMus::~PlatformWindowMus() {}
+
+void PlatformWindowMus::Show() {}
+
+void PlatformWindowMus::Hide() {}
+
+void PlatformWindowMus::Close() {
+ NOTIMPLEMENTED();
+}
+
+void PlatformWindowMus::SetBounds(const gfx::Rect& bounds) {}
+
+gfx::Rect PlatformWindowMus::GetBounds() {
+ return mus_window_->bounds();
+}
+
+void PlatformWindowMus::SetTitle(const base::string16& title) {
+ NOTIMPLEMENTED();
+}
+
+void PlatformWindowMus::SetCapture() {}
+
+void PlatformWindowMus::ReleaseCapture() {}
+
+void PlatformWindowMus::ToggleFullscreen() {
+ NOTIMPLEMENTED();
+}
+
+void PlatformWindowMus::Maximize() {}
+
+void PlatformWindowMus::Minimize() {}
+
+void PlatformWindowMus::Restore() {}
+
+void PlatformWindowMus::SetCursor(ui::PlatformCursor cursor) {
+ NOTIMPLEMENTED();
+}
+
+void PlatformWindowMus::MoveCursorTo(const gfx::Point& location) {
+ NOTIMPLEMENTED();
+}
+
+void PlatformWindowMus::ConfineCursorToBounds(const gfx::Rect& bounds) {
+ NOTIMPLEMENTED();
+}
+
+ui::PlatformImeController* PlatformWindowMus::GetPlatformImeController() {
+ return nullptr;
+}
+
+} // namespace views
« no previous file with comments | « ui/views/mus/platform_window_mus.h ('k') | ui/views/mus/window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698