OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 view_->SetViewport(position.x(), position.y(), | 106 view_->SetViewport(position.x(), position.y(), |
107 position.width(), position.height()); | 107 position.width(), position.height()); |
108 view_->Paint(); | 108 view_->Paint(); |
109 } | 109 } |
110 | 110 |
111 bool ChromotingInstance::CurrentlyOnPluginThread() const { | 111 bool ChromotingInstance::CurrentlyOnPluginThread() const { |
112 return pepper_main_loop_dont_post_to_me_ == MessageLoop::current(); | 112 return pepper_main_loop_dont_post_to_me_ == MessageLoop::current(); |
113 } | 113 } |
114 | 114 |
115 bool ChromotingInstance::HandleEvent(const PP_InputEvent& event) { | 115 bool ChromotingInstance::HandleInputEvent(const PP_InputEvent& event) { |
116 DCHECK(CurrentlyOnPluginThread()); | 116 DCHECK(CurrentlyOnPluginThread()); |
117 | 117 |
118 PepperInputHandler* pih | 118 PepperInputHandler* pih |
119 = static_cast<PepperInputHandler*>(input_handler_.get()); | 119 = static_cast<PepperInputHandler*>(input_handler_.get()); |
120 | 120 |
121 switch (event.type) { | 121 switch (event.type) { |
122 case PP_INPUTEVENT_TYPE_MOUSEDOWN: | 122 case PP_INPUTEVENT_TYPE_MOUSEDOWN: |
123 pih->HandleMouseButtonEvent(true, event.u.mouse); | 123 pih->HandleMouseButtonEvent(true, event.u.mouse); |
124 return true; | 124 return true; |
125 | 125 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 LOG(ERROR) << "Object initted."; | 159 LOG(ERROR) << "Object initted."; |
160 // The pp::Var takes ownership of object here. | 160 // The pp::Var takes ownership of object here. |
161 instance_object_ = pp::Var(object); | 161 instance_object_ = pp::Var(object); |
162 } | 162 } |
163 | 163 |
164 return instance_object_; | 164 return instance_object_; |
165 } | 165 } |
166 | 166 |
167 } // namespace remoting | 167 } // namespace remoting |
OLD | NEW |