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

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

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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_manager_connection.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/window_manager_connection.cc
diff --git a/ui/views/mus/window_manager_connection.cc b/ui/views/mus/window_manager_connection.cc
index 49ddec69b3b0168ca7ad3ccb25ca61f74a541416..04e0db788b140b6654a546c651aa8f0d52c483f8 100644
--- a/ui/views/mus/window_manager_connection.cc
+++ b/ui/views/mus/window_manager_connection.cc
@@ -13,7 +13,7 @@
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/converters/network/network_type_converters.h"
#include "mojo/shell/public/cpp/application_connection.h"
-#include "mojo/shell/public/cpp/application_impl.h"
+#include "mojo/shell/public/cpp/shell.h"
#include "ui/views/mus/native_widget_mus.h"
#include "ui/views/mus/screen_mus.h"
#include "ui/views/views_delegate.h"
@@ -31,9 +31,9 @@ base::LazyInstance<WindowManagerConnectionPtr>::Leaky lazy_tls_ptr =
} // namespace
// static
-void WindowManagerConnection::Create(mojo::ApplicationImpl* app) {
+void WindowManagerConnection::Create(mojo::Shell* shell) {
DCHECK(!lazy_tls_ptr.Pointer()->Get());
- lazy_tls_ptr.Pointer()->Set(new WindowManagerConnection(app));
+ lazy_tls_ptr.Pointer()->Set(new WindowManagerConnection(shell));
}
// static
@@ -48,12 +48,13 @@ mus::Window* WindowManagerConnection::NewWindow(
return window_tree_connection_->NewTopLevelWindow(&properties);
}
-WindowManagerConnection::WindowManagerConnection(mojo::ApplicationImpl* app)
- : app_(app), window_tree_connection_(nullptr) {
- window_tree_connection_.reset(mus::WindowTreeConnection::Create(this, app_));
+WindowManagerConnection::WindowManagerConnection(mojo::Shell* shell)
+ : shell_(shell), window_tree_connection_(nullptr) {
+ window_tree_connection_.reset(
+ mus::WindowTreeConnection::Create(this, shell_));
screen_.reset(new ScreenMus(this));
- screen_->Init(app);
+ screen_->Init(shell);
ViewsDelegate::GetInstance()->set_native_widget_factory(
base::Bind(&WindowManagerConnection::CreateNativeWidget,
@@ -81,7 +82,7 @@ NativeWidget* WindowManagerConnection::CreateNativeWidget(
internal::NativeWidgetDelegate* delegate) {
std::map<std::string, std::vector<uint8_t>> properties;
NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties);
- return new NativeWidgetMus(delegate, app_->shell(), NewWindow(properties),
+ return new NativeWidgetMus(delegate, shell_, NewWindow(properties),
mus::mojom::SurfaceType::DEFAULT);
}
« no previous file with comments | « ui/views/mus/window_manager_connection.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