blob: 67027c8072256a542d3643623eddb9115448edf8 (
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
47
48
49
50
51
|
// 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_CHROMEOS_DOM_UI_NETWORK_MENU_UI_H_
#define CHROME_BROWSER_CHROMEOS_DOM_UI_NETWORK_MENU_UI_H_
#pragma once
#include "chrome/browser/chromeos/dom_ui/menu_ui.h"
namespace views {
class Menu2;
} // namespace views
namespace menus {
class MenuModel;
} // namespace menus
namespace chromeos {
class NetworkMenuUI : public MenuUI {
public:
explicit NetworkMenuUI(TabContents* contents);
// A callback method that is invoked when the JavaScript wants
// to invoke an action in the model.
// By convention the first member of 'values' describes the action.
// Returns true if the menu should be closed.
bool ModelAction(const menus::MenuModel* model,
const ListValue* values);
// MenuUI overrides
virtual DictionaryValue* CreateMenuItem(const menus::MenuModel* model,
int index,
const char* type,
int* max_icon_width,
bool* has_accel) const;
virtual void AddCustomConfigValues(DictionaryValue* config) const;
virtual void AddLocalizedStrings(DictionaryValue* localized_strings) const;
// A convenient factory method to create Menu2 for the network menu.
static views::Menu2* CreateMenu2(menus::MenuModel* model);
private:
DISALLOW_COPY_AND_ASSIGN(NetworkMenuUI);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_DOM_UI_NETWORK_MENU_UI_H_
|