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

Unified Diff: components/mus/mus_app.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 | « components/mus/mus_app.h ('k') | components/mus/public/cpp/lib/window_tree_client_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/mus_app.cc
diff --git a/components/mus/mus_app.cc b/components/mus/mus_app.cc
index 003507546d45596bf1bb39da25f8fec83eb69a8b..b7ffa4dd074dcdf64bd7552203c21b828a034154 100644
--- a/components/mus/mus_app.cc
+++ b/components/mus/mus_app.cc
@@ -17,8 +17,7 @@
#include "mojo/public/c/system/main.h"
#include "mojo/services/tracing/public/cpp/tracing_impl.h"
#include "mojo/shell/public/cpp/application_connection.h"
-#include "mojo/shell/public/cpp/application_impl.h"
-#include "mojo/shell/public/cpp/application_runner.h"
+#include "mojo/shell/public/cpp/shell.h"
#include "ui/events/event_switches.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gl/gl_surface.h"
@@ -32,7 +31,6 @@
#endif
using mojo::ApplicationConnection;
-using mojo::ApplicationImpl;
using mojo::InterfaceRequest;
using mus::mojom::WindowTreeHostFactory;
using mus::mojom::Gpu;
@@ -46,7 +44,7 @@ struct MandolineUIServicesApp::PendingRequest {
};
MandolineUIServicesApp::MandolineUIServicesApp()
- : app_impl_(nullptr) {}
+ : shell_(nullptr) {}
MandolineUIServicesApp::~MandolineUIServicesApp() {
if (gpu_state_)
@@ -55,8 +53,10 @@ MandolineUIServicesApp::~MandolineUIServicesApp() {
connection_manager_.reset();
}
-void MandolineUIServicesApp::Initialize(ApplicationImpl* app) {
- app_impl_ = app;
+void MandolineUIServicesApp::Initialize(mojo::Shell* shell,
+ const std::string& url,
+ uint32_t id) {
+ shell_ = shell;
surfaces_state_ = new SurfacesState;
#if defined(USE_X11)
@@ -87,7 +87,7 @@ void MandolineUIServicesApp::Initialize(ApplicationImpl* app) {
gpu_state_ = new GpuState(hardware_rendering_available);
connection_manager_.reset(new ws::ConnectionManager(this, surfaces_state_));
- tracing_.Initialize(app);
+ tracing_.Initialize(shell, url);
}
bool MandolineUIServicesApp::AcceptConnection(
@@ -112,7 +112,7 @@ void MandolineUIServicesApp::OnFirstRootConnectionCreated() {
}
void MandolineUIServicesApp::OnNoMoreRootConnections() {
- app_impl_->Quit();
+ shell_->Quit();
}
ws::ClientConnection*
@@ -186,7 +186,7 @@ void MandolineUIServicesApp::CreateWindowTreeHost(
// TODO(fsamuel): We need to make sure that only the window manager can create
// new roots.
ws::WindowTreeHostImpl* host_impl = new ws::WindowTreeHostImpl(
- connection_manager_.get(), app_impl_, gpu_state_, surfaces_state_);
+ connection_manager_.get(), shell_, gpu_state_, surfaces_state_);
// WindowTreeHostConnection manages its own lifetime.
host_impl->Init(new ws::WindowTreeHostConnectionImpl(
« no previous file with comments | « components/mus/mus_app.h ('k') | components/mus/public/cpp/lib/window_tree_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698