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

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

Issue 2018823002: Eliminate WindowTreeConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection
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
Index: ui/views/mus/window_manager_connection.cc
diff --git a/ui/views/mus/window_manager_connection.cc b/ui/views/mus/window_manager_connection.cc
index e6280123a8e1d489bc6fcdba777f3c5bacfb0b0a..12c5f5fbb44af26ce98f104d45d784d0a70e8d53 100644
--- a/ui/views/mus/window_manager_connection.cc
+++ b/ui/views/mus/window_manager_connection.cc
@@ -11,7 +11,7 @@
#include "components/mus/public/cpp/property_type_converters.h"
#include "components/mus/public/cpp/window.h"
#include "components/mus/public/cpp/window_property.h"
-#include "components/mus/public/cpp/window_tree_connection.h"
+#include "components/mus/public/cpp/window_tree_client.h"
#include "components/mus/public/interfaces/event_matcher.mojom.h"
#include "components/mus/public/interfaces/window_tree.mojom.h"
#include "services/shell/public/cpp/connection.h"
@@ -62,7 +62,7 @@ void WindowManagerConnection::Reset() {
mus::Window* WindowManagerConnection::NewWindow(
const std::map<std::string, std::vector<uint8_t>>& properties) {
- return window_tree_connection_->NewTopLevelWindow(&properties);
+ return client_->NewTopLevelWindow(&properties);
}
NativeWidget* WindowManagerConnection::CreateNativeWidgetMus(
@@ -86,7 +86,7 @@ void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) {
mus::mojom::EventMatcherPtr matcher = mus::mojom::EventMatcher::New();
matcher->type_matcher = mus::mojom::EventTypeMatcher::New();
matcher->type_matcher->type = mus::mojom::EventType::POINTER_DOWN;
- window_tree_connection_->SetEventObserver(std::move(matcher));
+ client_->SetEventObserver(std::move(matcher));
}
}
@@ -94,7 +94,7 @@ void WindowManagerConnection::RemovePointerWatcher(PointerWatcher* watcher) {
pointer_watchers_.RemoveObserver(watcher);
if (!HasPointerWatcher()) {
// Last PointerWatcher removed, stop the event observer.
- window_tree_connection_->SetEventObserver(nullptr);
+ client_->SetEventObserver(nullptr);
}
}
@@ -103,9 +103,9 @@ WindowManagerConnection::WindowManagerConnection(
const shell::Identity& identity)
: connector_(connector),
identity_(identity),
- window_tree_connection_(nullptr) {
- window_tree_connection_.reset(
- mus::WindowTreeConnection::Create(this, connector_));
+ client_(nullptr) {
+ client_.reset(new mus::WindowTreeClient(this, nullptr, nullptr));
+ client_->ConnectViaWindowTreeFactory(connector_);
screen_.reset(new ScreenMus(this));
screen_->Init(connector);
@@ -122,9 +122,9 @@ WindowManagerConnection::WindowManagerConnection(
}
WindowManagerConnection::~WindowManagerConnection() {
- // ~WindowTreeConnection calls back to us (we're the WindowTreeDelegate),
- // destroy it while we are still valid.
- window_tree_connection_.reset();
+ // ~WindowTreeClient calls back to us (we're its delegate), destroy it while
+ // we are still valid.
+ client_.reset();
ui::DeviceDataManager::DeleteInstance();
}
@@ -139,8 +139,8 @@ bool WindowManagerConnection::HasPointerWatcher() {
void WindowManagerConnection::OnEmbed(mus::Window* root) {}
-void WindowManagerConnection::OnConnectionLost(
- mus::WindowTreeConnection* connection) {}
+void WindowManagerConnection::OnWindowTreeClientDestroyed(
+ mus::WindowTreeClient* client) {}
void WindowManagerConnection::OnEventObserved(const ui::Event& event,
mus::Window* target) {
@@ -168,12 +168,12 @@ void WindowManagerConnection::OnEventObserved(const ui::Event& event,
}
void WindowManagerConnection::OnWindowManagerFrameValuesChanged() {
- if (window_tree_connection_)
- NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get());
+ if (client_)
+ NativeWidgetMus::NotifyFrameChanged(client_.get());
}
gfx::Point WindowManagerConnection::GetCursorScreenPoint() {
- return window_tree_connection_->GetCursorScreenPoint();
+ return client_->GetCursorScreenPoint();
}
} // namespace views
« components/mus/public/cpp/lib/window.cc ('K') | « ui/views/mus/window_manager_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698