summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/accelerators_gtk.h
blob: de08f9141d50b230613e0ae7ea2dfb50c90cb88b (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
37
38
// Copyright (c) 2010 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 CHROME_BROWSER_GTK_ACCELERATORS_GTK_H_
#define CHROME_BROWSER_GTK_ACCELERATORS_GTK_H_
#pragma once

#include "app/menus/accelerator_gtk.h"
#include "base/hash_tables.h"

class AcceleratorsGtk {
 public:
  AcceleratorsGtk();
  ~AcceleratorsGtk() { }

  typedef std::vector<std::pair<int, menus::AcceleratorGtk> >
      AcceleratorGtkList;
  typedef AcceleratorGtkList::const_iterator const_iterator;

  const_iterator const begin() {
    return all_accelerators_.begin();
  }

  const_iterator const end() {
    return all_accelerators_.end();
  }

  // Returns NULL if there is no accelerator for the command.
  const menus::AcceleratorGtk* GetPrimaryAcceleratorForCommand(int command_id);

 private:
  base::hash_map<int, menus::AcceleratorGtk> primary_accelerators_;

  AcceleratorGtkList all_accelerators_;
};

#endif  // CHROME_BROWSER_GTK_ACCELERATORS_GTK_H_