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

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

Issue 280003003: Add SetClient method implementation to InterfaceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.cc ('k') | mojo/services/view_manager/view_manager_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0118208ce7349ace151d8899f48495c9eb461ff9 100644
--- a/mojo/services/native_viewport/native_viewport_service.cc
+++ b/mojo/services/native_viewport/native_viewport_service.cc
@@ -34,8 +34,7 @@ class NativeViewportImpl
public NativeViewportDelegate {
public:
NativeViewportImpl()
- : client_(NULL),
- widget_(gfx::kNullAcceleratedWidget),
+ : widget_(gfx::kNullAcceleratedWidget),
waiting_for_event_ack_(false) {}
virtual ~NativeViewportImpl() {
// Destroy the NativeViewport early on as it may call us back during
@@ -43,15 +42,11 @@ class NativeViewportImpl
native_viewport_.reset();
}
- virtual void SetClient(NativeViewportClient* client) OVERRIDE {
- client_ = client;
- }
-
virtual void Create(const Rect& bounds) OVERRIDE {
native_viewport_ =
services::NativeViewport::Create(context(), this);
native_viewport_->Init(bounds);
- client_->OnCreated();
+ client()->OnCreated();
OnBoundsChanged(bounds);
}
@@ -153,7 +148,7 @@ class NativeViewportImpl
event.set_key_data(key_data.Finish());
}
- client_->OnEvent(event.Finish(),
+ client()->OnEvent(event.Finish(),
base::Bind(&NativeViewportImpl::AckEvent,
base::Unretained(this)));
waiting_for_event_ack_ = true;
@@ -169,17 +164,16 @@ class NativeViewportImpl
virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE {
CreateCommandBufferIfNeeded();
AllocationScope scope;
- client_->OnBoundsChanged(bounds);
+ client()->OnBoundsChanged(bounds);
}
virtual void OnDestroyed() OVERRIDE {
command_buffer_.reset();
- client_->OnDestroyed();
+ client()->OnDestroyed();
base::MessageLoop::current()->Quit();
}
private:
- NativeViewportClient* client_;
gfx::AcceleratedWidget widget_;
scoped_ptr<services::NativeViewport> native_viewport_;
ScopedMessagePipeHandle command_buffer_handle_;
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.cc ('k') | mojo/services/view_manager/view_manager_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698