summaryrefslogtreecommitdiffstats
path: root/ui/base/accelerators/accelerator_history.cc
blob: 3c8821d875851c1faaa50b1717c4b38b201c9b58 (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
// 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 "ui/base/accelerators/accelerator_history.h"
#include "ui/events/event_constants.h"

namespace ui {

// ----------------------------------------------------------------------
// Public Methods
// ----------------------------------------------------------------------

AcceleratorHistory::AcceleratorHistory()
  : current_accelerator_(),
    previous_accelerator_() {
}

AcceleratorHistory::~AcceleratorHistory() {
}

void AcceleratorHistory::StoreCurrentAccelerator(
                            const Accelerator& accelerator) {
  if (accelerator != current_accelerator_) {
    previous_accelerator_ = current_accelerator_;
    current_accelerator_ = accelerator;
  }
}

} // namespace ui