summaryrefslogtreecommitdiffstats
path: root/content/renderer/disambiguation_popup_helper.h
blob: 0238f8a562ceda7027c25240c31c5bfed0f48246 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_RENDERER_DISAMBIGUATION_POPUP_HELPER_H_
#define CONTENT_RENDERER_DISAMBIGUATION_POPUP_HELPER_H_

#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebVector.h"

namespace gfx {
class Rect;
class Size;
}

namespace blink {
struct WebRect;
}

namespace content {

// Contains functions to calculate proper scaling factor and popup size
class DisambiguationPopupHelper {
 public:
  CONTENT_EXPORT static float ComputeZoomAreaAndScaleFactor(
      const gfx::Rect& tap_rect,
      const blink::WebVector<blink::WebRect>& target_rects,
      const gfx::Size& screen_size,
      const gfx::Size& visible_content_size,
      float total_scale,
      gfx::Rect* zoom_rect);
};

}  // namespace content

#endif  // CONTENT_RENDERER_DISAMBIGUATION_POPUP_HELPER_H_