summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/password_menu_model.h
blob: 19b6e20f21f5676b28325df1f3be9754cb7bf01f (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
39
40
41
42
43
44
45
46
// Copyright 2013 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_UI_VIEWS_PASSWORD_MENU_MODEL_H_
#define CHROME_BROWSER_UI_VIEWS_PASSWORD_MENU_MODEL_H_

#include <map>
#include <string>

#include "ui/base/models/simple_menu_model.h"

class ContentSettingBubbleModel;
class ContentSettingBubbleContents;

// A menu model that builds the contents of the password menu in the content
// setting bubble.
class PasswordMenuModel : public ui::SimpleMenuModel,
                          public ui::SimpleMenuModel::Delegate {
 public:
  PasswordMenuModel(
      ContentSettingBubbleModel* bubble_model,
      ContentSettingBubbleContents* bubble_contents);
  virtual ~PasswordMenuModel();

  // ui::SimpleMenuModel::Delegate:
  virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
  virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
  virtual bool GetAcceleratorForCommandId(
      int command_id,
      ui::Accelerator* accelerator) OVERRIDE;
  virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;

 private:
  enum CommandID {
    COMMAND_ID_NOPE,
    COMMAND_ID_NEVER_FOR_THIS_SITE,
  };

  ContentSettingBubbleModel* media_bubble_model_;        // Weak.
  ContentSettingBubbleContents* media_bubble_contents_;  // Weak.

  DISALLOW_COPY_AND_ASSIGN(PasswordMenuModel);
};

#endif  // CHROME_BROWSER_UI_VIEWS_PASSWORD_MENU_MODEL_H_