| 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 VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| 6 #define VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 MenuItemView* AppendMenuItemImpl(int item_id, | 192 MenuItemView* AppendMenuItemImpl(int item_id, |
| 193 const std::wstring& label, | 193 const std::wstring& label, |
| 194 const SkBitmap& icon, | 194 const SkBitmap& icon, |
| 195 Type type); | 195 Type type); |
| 196 | 196 |
| 197 // Returns the view that contains child menu items. If the submenu has | 197 // Returns the view that contains child menu items. If the submenu has |
| 198 // not been creates, this creates it. | 198 // not been creates, this creates it. |
| 199 virtual SubmenuView* CreateSubmenu(); | 199 virtual SubmenuView* CreateSubmenu(); |
| 200 | 200 |
| 201 // Returns true if this menu item has a submenu. | 201 // Returns true if this menu item has a submenu. |
| 202 virtual bool HasSubmenu() const { return (submenu_ != NULL); } | 202 virtual bool HasSubmenu() const; |
| 203 | 203 |
| 204 // Returns the view containing child menu items. | 204 // Returns the view containing child menu items. |
| 205 virtual SubmenuView* GetSubmenu() const { return submenu_; } | 205 virtual SubmenuView* GetSubmenu() const; |
| 206 | 206 |
| 207 // Returns the parent menu item. | 207 // Returns the parent menu item. |
| 208 MenuItemView* GetParentMenuItem() const { return parent_menu_item_; } | 208 MenuItemView* GetParentMenuItem() const { return parent_menu_item_; } |
| 209 | 209 |
| 210 // Sets the title | 210 // Sets the title |
| 211 void SetTitle(const std::wstring& title); | 211 void SetTitle(const std::wstring& title); |
| 212 | 212 |
| 213 // Returns the title. | 213 // Returns the title. |
| 214 // TODO(avi): switch back to returning a const reference. | 214 // TODO(avi): switch back to returning a const reference. |
| 215 const std::wstring GetTitle() const { return UTF16ToWideHack(title_); } | 215 const std::wstring GetTitle() const { return UTF16ToWideHack(title_); } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // Previously calculated preferred size to reduce GetStringWidth calls in | 418 // Previously calculated preferred size to reduce GetStringWidth calls in |
| 419 // GetPreferredSize. | 419 // GetPreferredSize. |
| 420 gfx::Size pref_size_; | 420 gfx::Size pref_size_; |
| 421 | 421 |
| 422 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 422 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
| 423 }; | 423 }; |
| 424 | 424 |
| 425 } // namespace views | 425 } // namespace views |
| 426 | 426 |
| 427 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 427 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| OLD | NEW |