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

Unified Diff: mojo/services/native_viewport/native_viewport_service.cc

Issue 275363002: Internalize ServiceConnector<> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 6 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: mojo/services/native_viewport/native_viewport_service.cc
diff --git a/mojo/services/native_viewport/native_viewport_service.cc b/mojo/services/native_viewport/native_viewport_service.cc
index faba57876f497c2be035bc5f85166834f9ca244d..fbb6325eb0d186fc4c8b118d209be541ad8f2b64 100644
--- a/mojo/services/native_viewport/native_viewport_service.cc
+++ b/mojo/services/native_viewport/native_viewport_service.cc
@@ -28,13 +28,12 @@ bool IsRateLimitedEventType(ui::Event* event) {
}
class NativeViewportImpl
- : public ServiceConnection<mojo::NativeViewport,
- NativeViewportImpl,
- shell::Context>,
+ : public InterfaceImpl<mojo::NativeViewport>,
public NativeViewportDelegate {
public:
- NativeViewportImpl()
- : client_(NULL),
+ NativeViewportImpl(shell::Context* context)
+ : context_(context),
+ client_(NULL),
widget_(gfx::kNullAcceleratedWidget),
waiting_for_event_ack_(false) {}
virtual ~NativeViewportImpl() {
@@ -43,13 +42,15 @@ class NativeViewportImpl
native_viewport_.reset();
}
+ virtual void OnConnectionError() OVERRIDE {}
+
virtual void SetClient(NativeViewportClient* client) OVERRIDE {
client_ = client;
}
virtual void Create(const Rect& bounds) OVERRIDE {
native_viewport_ =
- services::NativeViewport::Create(context(), this);
+ services::NativeViewport::Create(context_, this);
native_viewport_->Init(bounds);
client_->OnCreated();
OnBoundsChanged(bounds);
@@ -179,6 +180,7 @@ class NativeViewportImpl
}
private:
+ shell::Context* context_;
NativeViewportClient* client_;
gfx::AcceleratedWidget widget_;
scoped_ptr<services::NativeViewport> native_viewport_;
@@ -195,9 +197,7 @@ MOJO_NATIVE_VIEWPORT_EXPORT mojo::Application*
CreateNativeViewportService(mojo::shell::Context* context,
mojo::ScopedMessagePipeHandle shell_handle) {
mojo::Application* app = new mojo::Application(shell_handle.Pass());
- app->AddServiceConnector(
- new mojo::ServiceConnector<mojo::services::NativeViewportImpl,
- mojo::shell::Context>(context));
+ app->AddService<mojo::services::NativeViewportImpl>(context);
return app;
}

Powered by Google App Engine
This is Rietveld 408576698