| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 mouse_locked_ = true; | 733 mouse_locked_ = true; |
| 734 } | 734 } |
| 735 | 735 |
| 736 void BrowserPluginGuest::OnResizeGuest( | 736 void BrowserPluginGuest::OnResizeGuest( |
| 737 int browser_plugin_instance_id, | 737 int browser_plugin_instance_id, |
| 738 const BrowserPluginHostMsg_ResizeGuest_Params& params) { | 738 const BrowserPluginHostMsg_ResizeGuest_Params& params) { |
| 739 // If we are setting the size for the first time before navigating then | 739 // If we are setting the size for the first time before navigating then |
| 740 // BrowserPluginGuest does not yet have a RenderViewHost. | 740 // BrowserPluginGuest does not yet have a RenderViewHost. |
| 741 if (guest_device_scale_factor_ != params.scale_factor && | 741 if (guest_device_scale_factor_ != params.scale_factor && |
| 742 GetWebContents()->GetRenderViewHost()) { | 742 GetWebContents()->GetRenderViewHost()) { |
| 743 RenderWidgetHostImpl* render_widget_host = | 743 auto render_widget_host = |
| 744 RenderWidgetHostImpl::From(GetWebContents()->GetRenderViewHost()); | 744 RenderWidgetHostImpl::From(GetWebContents()->GetRenderViewHost()); |
| 745 guest_device_scale_factor_ = params.scale_factor; | 745 guest_device_scale_factor_ = params.scale_factor; |
| 746 render_widget_host->NotifyScreenInfoChanged(); | 746 render_widget_host->NotifyScreenInfoChanged(); |
| 747 } | 747 } |
| 748 | 748 |
| 749 if (last_seen_browser_plugin_size_ != params.view_size) { | 749 if (last_seen_browser_plugin_size_ != params.view_size) { |
| 750 delegate_->ElementSizeChanged(params.view_size); | 750 delegate_->ElementSizeChanged(params.view_size); |
| 751 last_seen_browser_plugin_size_ = params.view_size; | 751 last_seen_browser_plugin_size_ = params.view_size; |
| 752 } | 752 } |
| 753 | 753 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 863 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
| 864 const gfx::Range& range, | 864 const gfx::Range& range, |
| 865 const std::vector<gfx::Rect>& character_bounds) { | 865 const std::vector<gfx::Rect>& character_bounds) { |
| 866 static_cast<RenderWidgetHostViewBase*>( | 866 static_cast<RenderWidgetHostViewBase*>( |
| 867 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 867 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
| 868 range, character_bounds); | 868 range, character_bounds); |
| 869 } | 869 } |
| 870 #endif | 870 #endif |
| 871 | 871 |
| 872 } // namespace content | 872 } // namespace content |
| OLD | NEW |