| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/client/plugin/pepper_view_proxy.h" | 5 #include "remoting/client/plugin/pepper_view_proxy.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "remoting/base/tracer.h" | 8 #include "remoting/base/tracer.h" |
| 9 #include "remoting/client/client_context.h" | 9 #include "remoting/client/client_context.h" |
| 10 #include "remoting/client/plugin/chromoting_instance.h" | 10 #include "remoting/client/plugin/chromoting_instance.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (instance_ && !CurrentlyOnPluginThread()) { | 96 if (instance_ && !CurrentlyOnPluginThread()) { |
| 97 RunTaskOnPluginThread(NewTracedMethod(this, &PepperViewProxy::SetViewport, | 97 RunTaskOnPluginThread(NewTracedMethod(this, &PepperViewProxy::SetViewport, |
| 98 x, y, width, height)); | 98 x, y, width, height)); |
| 99 return; | 99 return; |
| 100 } | 100 } |
| 101 | 101 |
| 102 if (view_) | 102 if (view_) |
| 103 view_->SetViewport(x, y, width, height); | 103 view_->SetViewport(x, y, width, height); |
| 104 } | 104 } |
| 105 | 105 |
| 106 gfx::Point PepperViewProxy::ConvertScreenToHost(const gfx::Point& p) const { | 106 pp::Point PepperViewProxy::ConvertScreenToHost(const pp::Point& p) const { |
| 107 // This method returns a value, so must run synchronously, so must be | 107 // This method returns a value, so must run synchronously, so must be |
| 108 // called only on the pepper thread. | 108 // called only on the pepper thread. |
| 109 DCHECK(CurrentlyOnPluginThread()); | 109 DCHECK(CurrentlyOnPluginThread()); |
| 110 | 110 |
| 111 if (view_) | 111 if (view_) |
| 112 return view_->ConvertScreenToHost(p); | 112 return view_->ConvertScreenToHost(p); |
| 113 return gfx::Point(); | 113 return pp::Point(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void PepperViewProxy::AllocateFrame( | 116 void PepperViewProxy::AllocateFrame( |
| 117 media::VideoFrame::Format format, | 117 media::VideoFrame::Format format, |
| 118 size_t width, | 118 size_t width, |
| 119 size_t height, | 119 size_t height, |
| 120 base::TimeDelta timestamp, | 120 base::TimeDelta timestamp, |
| 121 base::TimeDelta duration, | 121 base::TimeDelta duration, |
| 122 scoped_refptr<media::VideoFrame>* frame_out, | 122 scoped_refptr<media::VideoFrame>* frame_out, |
| 123 Task* done) { | 123 Task* done) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 view_->SetScaleToFit(scale_to_fit); | 171 view_->SetScaleToFit(scale_to_fit); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void PepperViewProxy::Detach() { | 174 void PepperViewProxy::Detach() { |
| 175 DCHECK(CurrentlyOnPluginThread()); | 175 DCHECK(CurrentlyOnPluginThread()); |
| 176 instance_ = NULL; | 176 instance_ = NULL; |
| 177 view_ = NULL; | 177 view_ = NULL; |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace remoting | 180 } // namespace remoting |
| OLD | NEW |