| 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/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/bind.h" |   10 #include "base/bind.h" | 
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  200   input_handler_.reset(); |  200   input_handler_.reset(); | 
|  201   host_connection_.reset(); |  201   host_connection_.reset(); | 
|  202  |  202  | 
|  203   GetScriptableObject()->SetConnectionInfo(STATUS_CLOSED, QUALITY_UNKNOWN); |  203   GetScriptableObject()->SetConnectionInfo(STATUS_CLOSED, QUALITY_UNKNOWN); | 
|  204 } |  204 } | 
|  205  |  205  | 
|  206 void ChromotingInstance::DidChangeView(const pp::Rect& position, |  206 void ChromotingInstance::DidChangeView(const pp::Rect& position, | 
|  207                                        const pp::Rect& clip) { |  207                                        const pp::Rect& clip) { | 
|  208   DCHECK(plugin_message_loop_->BelongsToCurrentThread()); |  208   DCHECK(plugin_message_loop_->BelongsToCurrentThread()); | 
|  209  |  209  | 
|  210   view_->SetPluginSize(gfx::Size(position.width(), position.height())); |  210   view_->SetPluginSize(SkISize::Make(position.width(), position.height())); | 
|  211  |  211  | 
|  212   // TODO(wez): Pass the dimensions of the plugin to the RectangleDecoder |  212   // TODO(wez): Pass the dimensions of the plugin to the RectangleDecoder | 
|  213   //            and let it generate the necessary refresh events. |  213   //            and let it generate the necessary refresh events. | 
|  214   // If scale-to-fit is enabled then update the scaling ratios. |  214   // If scale-to-fit is enabled then update the scaling ratios. | 
|  215   // We also force a full-frame refresh, in case the ratios changed. |  215   // We also force a full-frame refresh, in case the ratios changed. | 
|  216   if (scale_to_fit_) { |  216   if (scale_to_fit_) { | 
|  217     rectangle_decoder_->SetScaleRatios(view_->GetHorizontalScaleRatio(), |  217     rectangle_decoder_->SetScaleRatios(view_->GetHorizontalScaleRatio(), | 
|  218                                        view_->GetVerticalScaleRatio()); |  218                                        view_->GetVerticalScaleRatio()); | 
|  219     rectangle_decoder_->RefreshFullFrame(); |  219     rectangle_decoder_->RefreshFullFrame(); | 
|  220   } |  220   } | 
|  221  |  221  | 
|  222   // Notify the RectangleDecoder of the new clip rect. |  222   // Notify the RectangleDecoder of the new clip rect. | 
|  223   rectangle_decoder_->UpdateClipRect( |  223   rectangle_decoder_->UpdateClipRect( | 
|  224       gfx::Rect(clip.x(), clip.y(), clip.width(), clip.height())); |  224       SkIRect::MakeXYWH(clip.x(), clip.y(), clip.width(), clip.height())); | 
|  225 } |  225 } | 
|  226  |  226  | 
|  227 bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) { |  227 bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) { | 
|  228   DCHECK(plugin_message_loop_->BelongsToCurrentThread()); |  228   DCHECK(plugin_message_loop_->BelongsToCurrentThread()); | 
|  229   if (!input_handler_.get()) { |  229   if (!input_handler_.get()) { | 
|  230     return false; |  230     return false; | 
|  231   } |  231   } | 
|  232  |  232  | 
|  233   PepperInputHandler* pih |  233   PepperInputHandler* pih | 
|  234       = static_cast<PepperInputHandler*>(input_handler_.get()); |  234       = static_cast<PepperInputHandler*>(input_handler_.get()); | 
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  511   } |  511   } | 
|  512  |  512  | 
|  513   initial_policy_received_ = true; |  513   initial_policy_received_ = true; | 
|  514   enable_client_nat_traversal_ = traversal_policy; |  514   enable_client_nat_traversal_ = traversal_policy; | 
|  515  |  515  | 
|  516   if (delayed_connect_.get()) |  516   if (delayed_connect_.get()) | 
|  517     plugin_message_loop_->PostTask(FROM_HERE, delayed_connect_.release()); |  517     plugin_message_loop_->PostTask(FROM_HERE, delayed_connect_.release()); | 
|  518 } |  518 } | 
|  519  |  519  | 
|  520 }  // namespace remoting |  520 }  // namespace remoting | 
| OLD | NEW |