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/renderer/disambiguation_popup_helper.h" | 5 #include "content/renderer/disambiguation_popup_helper.h" |
6 | 6 |
7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 7 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
8 #include "ui/gfx/size_conversions.h" | 8 #include "ui/gfx/size_conversions.h" |
9 | 9 |
10 using WebKit::WebRect; | 10 using WebKit::WebRect; |
11 using WebKit::WebVector; | 11 using WebKit::WebVector; |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // The amount of padding to add to the disambiguation popup to show | 15 // The amount of padding to add to the disambiguation popup to show |
16 // content around the possible elements, adding some context. | 16 // content around the possible elements, adding some context. |
17 const int kDisambiguationPopupPadding = 8; | 17 const int kDisambiguationPopupPadding = 8; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 zoom_rect->Intersect(gfx::Rect(viewport_size)); | 97 zoom_rect->Intersect(gfx::Rect(viewport_size)); |
98 | 98 |
99 float scale = FindOptimalScaleFactor(target_rects); | 99 float scale = FindOptimalScaleFactor(target_rects); |
100 *zoom_rect = CropZoomArea( | 100 *zoom_rect = CropZoomArea( |
101 *zoom_rect, viewport_size, tap_rect.CenterPoint(), scale); | 101 *zoom_rect, viewport_size, tap_rect.CenterPoint(), scale); |
102 | 102 |
103 return scale; | 103 return scale; |
104 } | 104 } |
105 | 105 |
106 } // namespace content | 106 } // namespace content |
OLD | NEW |