summaryrefslogtreecommitdiffstats
path: root/content/renderer/webscrollbarbehavior_impl_mac.mm
blob: 9f83f8a3de325f7fa9e04001d264f47a893c1f10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2014 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.

#include "content/renderer/webscrollbarbehavior_impl_mac.h"

namespace content {

WebScrollbarBehaviorImpl::WebScrollbarBehaviorImpl()
    : jump_on_track_click_(false) {
}

bool WebScrollbarBehaviorImpl::shouldCenterOnThumb(
      blink::WebScrollbarBehavior::Button mouseButton,
      bool shiftKeyPressed,
      bool altKeyPressed) {
  return (mouseButton == blink::WebScrollbarBehavior::ButtonLeft) &&
      (jump_on_track_click_ != altKeyPressed);
}

}  // namespace content