| 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/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 return; | 1416 return; |
| 1417 | 1417 |
| 1418 // |target_rect| is provided in pixels, not DIPs. So we convert it to DIPs | 1418 // |target_rect| is provided in pixels, not DIPs. So we convert it to DIPs |
| 1419 // by scaling it by the inverse of the device scale factor. | 1419 // by scaling it by the inverse of the device scale factor. |
| 1420 gfx::RectF screen_target_rect_f(rect_pixels); | 1420 gfx::RectF screen_target_rect_f(rect_pixels); |
| 1421 screen_target_rect_f.Scale(1.0f / current_device_scale_factor_); | 1421 screen_target_rect_f.Scale(1.0f / current_device_scale_factor_); |
| 1422 disambiguation_target_rect_ = gfx::ToEnclosingRect(screen_target_rect_f); | 1422 disambiguation_target_rect_ = gfx::ToEnclosingRect(screen_target_rect_f); |
| 1423 | 1423 |
| 1424 float scale = static_cast<float>(zoomed_bitmap.width()) / | 1424 float scale = static_cast<float>(zoomed_bitmap.width()) / |
| 1425 static_cast<float>(rect_pixels.width()); | 1425 static_cast<float>(rect_pixels.width()); |
| 1426 gfx::Size zoomed_size(gfx::ToCeiledSize( | 1426 gfx::Size zoomed_size = |
| 1427 gfx::ScaleSize(disambiguation_target_rect_.size(), scale))); | 1427 gfx::ScaleToCeiledSize(disambiguation_target_rect_.size(), scale); |
| 1428 | 1428 |
| 1429 // Save of a copy of the |last_scroll_offset_| for comparison when the copy | 1429 // Save of a copy of the |last_scroll_offset_| for comparison when the copy |
| 1430 // callback fires, to ensure that we haven't scrolled. | 1430 // callback fires, to ensure that we haven't scrolled. |
| 1431 disambiguation_scroll_offset_ = last_scroll_offset_; | 1431 disambiguation_scroll_offset_ = last_scroll_offset_; |
| 1432 | 1432 |
| 1433 CopyFromCompositingSurface( | 1433 CopyFromCompositingSurface( |
| 1434 disambiguation_target_rect_, | 1434 disambiguation_target_rect_, |
| 1435 zoomed_size, | 1435 zoomed_size, |
| 1436 base::Bind(&RenderWidgetHostViewAura::DisambiguationPopupRendered, | 1436 base::Bind(&RenderWidgetHostViewAura::DisambiguationPopupRendered, |
| 1437 weak_ptr_factory_.GetWeakPtr()), | 1437 weak_ptr_factory_.GetWeakPtr()), |
| (...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2884 | 2884 |
| 2885 //////////////////////////////////////////////////////////////////////////////// | 2885 //////////////////////////////////////////////////////////////////////////////// |
| 2886 // RenderWidgetHostViewBase, public: | 2886 // RenderWidgetHostViewBase, public: |
| 2887 | 2887 |
| 2888 // static | 2888 // static |
| 2889 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2889 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2890 GetScreenInfoForWindow(results, NULL); | 2890 GetScreenInfoForWindow(results, NULL); |
| 2891 } | 2891 } |
| 2892 | 2892 |
| 2893 } // namespace content | 2893 } // namespace content |
| OLD | NEW |