| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DOM_UI_MENU_UI_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DOM_UI_MENU_UI_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DOM_UI_MENU_UI_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DOM_UI_MENU_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Creates a menu item for the menu item at index in the model. | 32 // Creates a menu item for the menu item at index in the model. |
| 33 virtual DictionaryValue* CreateMenuItem(const menus::MenuModel* model, | 33 virtual DictionaryValue* CreateMenuItem(const menus::MenuModel* model, |
| 34 int index, | 34 int index, |
| 35 const char* type, | 35 const char* type, |
| 36 int* max_icon_width, | 36 int* max_icon_width, |
| 37 bool* has_accel) const; | 37 bool* has_accel) const; |
| 38 | 38 |
| 39 // Subclass can add extra parameters or replaces default configuration. | 39 // Subclass can add extra parameters or replaces default configuration. |
| 40 virtual void AddCustomConfigValues(DictionaryValue* config) const {}; | 40 virtual void AddCustomConfigValues(DictionaryValue* config) const {}; |
| 41 | 41 |
| 42 // Subclass can add their values to |localized_strings| and those values |
| 43 // are used by JS template builder and could be accessed via JS class |
| 44 // LocalStrings. |
| 45 virtual void AddLocalizedStrings(DictionaryValue* localized_strings) const {}; |
| 46 |
| 42 // A utility function which creates a concrete html file from | 47 // A utility function which creates a concrete html file from |
| 43 // template file |menu_resource_id| and |menu_css_id| for given |menu_class|. | 48 // template file |menu_resource_id| and |menu_css_id| for given |menu_class|. |
| 44 // The resource_name is the host part of DOMUI's url. | 49 // The resource_name is the host part of DOMUI's url. |
| 45 // Caution: This calls MenuUI::GetProfile() when creating the data source, | 50 // Caution: This calls MenuUI::GetProfile() when creating the data source, |
| 46 // thus, it has to be initialized. | 51 // thus, it has to be initialized. |
| 47 static ChromeURLDataManager::DataSource* CreateMenuUIHTMLSource( | 52 static ChromeURLDataManager::DataSource* CreateMenuUIHTMLSource( |
| 48 const MenuUI& menu_ui, | 53 const MenuUI& menu_ui, |
| 49 const std::string& source_name, | 54 const std::string& source_name, |
| 50 const std::string& menu_class, | 55 const std::string& menu_class, |
| 51 int menu_source_res_id, | 56 int menu_source_res_id, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 76 // This may return null when menu is being deleted. | 81 // This may return null when menu is being deleted. |
| 77 menus::MenuModel* GetMenuModel(); | 82 menus::MenuModel* GetMenuModel(); |
| 78 | 83 |
| 79 private: | 84 private: |
| 80 DISALLOW_COPY_AND_ASSIGN(MenuHandlerBase); | 85 DISALLOW_COPY_AND_ASSIGN(MenuHandlerBase); |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 } // namespace chromeos | 88 } // namespace chromeos |
| 84 | 89 |
| 85 #endif // CHROME_BROWSER_CHROMEOS_DOM_UI_MENU_UI_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_DOM_UI_MENU_UI_H_ |
| OLD | NEW |