| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_WEBUI_NETWORK_MENU_UI_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_WEBUI_NETWORK_MENU_UI_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/chromeos/webui/menu_ui.h" | |
| 10 | |
| 11 namespace ui { | |
| 12 class MenuModel; | |
| 13 } // namespace ui | |
| 14 | |
| 15 namespace views { | |
| 16 class Menu2; | |
| 17 } // namespace views | |
| 18 | |
| 19 namespace chromeos { | |
| 20 | |
| 21 class NetworkMenuUI : public MenuUI { | |
| 22 public: | |
| 23 explicit NetworkMenuUI(TabContents* contents); | |
| 24 | |
| 25 // A callback method that is invoked when the JavaScript wants | |
| 26 // to invoke an action in the model. | |
| 27 // By convention the first member of 'values' describes the action. | |
| 28 // Returns true if the menu should be closed. | |
| 29 bool ModelAction(const ui::MenuModel* model, | |
| 30 const ListValue* values); | |
| 31 | |
| 32 // MenuUI overrides | |
| 33 virtual DictionaryValue* CreateMenuItem(const ui::MenuModel* model, | |
| 34 int index, | |
| 35 const char* type, | |
| 36 int* max_icon_width, | |
| 37 bool* has_accel) const; | |
| 38 | |
| 39 // A convenient factory method to create Menu2 for the network menu. | |
| 40 static views::Menu2* CreateMenu2(ui::MenuModel* model); | |
| 41 | |
| 42 private: | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(NetworkMenuUI); | |
| 45 }; | |
| 46 | |
| 47 } // namespace chromeos | |
| 48 | |
| 49 #endif // CHROME_BROWSER_CHROMEOS_WEBUI_NETWORK_MENU_UI_H_ | |
| OLD | NEW |