summaryrefslogtreecommitdiff
path: root/chromium/ui/views/drag_utils.cc
blob: 723c2677376435445f7276f2b6f80992305f4fb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/drag_utils.h"

#include "ui/base/layout.h"
#include "ui/views/widget/widget.h"

namespace views {

float ScaleFactorForDragFromWidget(const Widget* widget) {
  float device_scale = 1.0f;
  if (widget && widget->GetNativeView()) {
    gfx::NativeView view = widget->GetNativeView();
    device_scale = ui::GetScaleFactorForNativeView(view);
  }
  return device_scale;
}

}  // namespace views