Make BaseView et al. take an ApplicationConnector instead of an ApplicationImpl.
In general, it's a bit of a layering violation to pass around
ApplicationImpl*'s, and it also poses some lifetime issues. (Using
ApplicationConnectors resolves any potential lifetime issues.)
Mostly though, I want to rework the way ApplicationImpl, etc. work, and
this gets in the way.
R=jeffbrown@google.com
Review URL: https://codereview.chromium.org/1991853003 .
diff --git a/mojo/ui/ganesh_view.cc b/mojo/ui/ganesh_view.cc
index 95b1170..857840d 100644
--- a/mojo/ui/ganesh_view.cc
+++ b/mojo/ui/ganesh_view.cc
@@ -5,23 +5,18 @@
#include "mojo/ui/ganesh_view.h"
#include "base/logging.h"
-#include "mojo/public/cpp/application/connect.h"
#include "mojo/skia/ganesh_texture_surface.h"
#include "third_party/skia/include/core/SkCanvas.h"
namespace mojo {
namespace ui {
-GaneshView::GaneshView(
- mojo::ApplicationImpl* app_impl,
- mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
- const std::string& label)
- : BaseView(app_impl, view_owner_request.Pass(), label),
- ganesh_renderer_(
- new mojo::skia::GaneshContext(mojo::GLContext::CreateOffscreen(
- mojo::ApplicationConnectorPtr::Create(
- mojo::CreateApplicationConnector(app_impl->shell()))
- .get()))) {}
+GaneshView::GaneshView(InterfaceHandle<ApplicationConnector> app_connector,
+ InterfaceRequest<ViewOwner> view_owner_request,
+ const std::string& label)
+ : BaseView(app_connector.Pass(), view_owner_request.Pass(), label),
+ ganesh_renderer_(new skia::GaneshContext(
+ GLContext::CreateOffscreen(BaseView::app_connector()))) {}
GaneshView::~GaneshView() {}