summaryrefslogtreecommitdiffstats
path: root/chrome/browser/event_disposition.cc
blob: 64d979d14e3227b3d1ff7d75a4b34481a0ee3130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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.

#include "chrome/browser/event_disposition.h"

#include "chrome/browser/disposition_utils.h"
#include "ui/base/events/event_constants.h"

namespace chrome {

WindowOpenDisposition DispositionFromEventFlags(int event_flags) {
  return disposition_utils::DispositionFromClick(
      (event_flags & ui::EF_MIDDLE_MOUSE_BUTTON) != 0,
      (event_flags & ui::EF_ALT_DOWN) != 0,
      (event_flags & ui::EF_CONTROL_DOWN) != 0,
      (event_flags & ui::EF_COMMAND_DOWN) != 0,
      (event_flags & ui::EF_SHIFT_DOWN) != 0);
}

}  // namespace chrome