OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include <vector> | 10 #include <vector> |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 | 386 |
387 // Used by MenuController to cache the menu position in use by the | 387 // Used by MenuController to cache the menu position in use by the |
388 // active menu. | 388 // active menu. |
389 MenuPosition actual_menu_position() const { return actual_menu_position_; } | 389 MenuPosition actual_menu_position() const { return actual_menu_position_; } |
390 void set_actual_menu_position(MenuPosition actual_menu_position) { | 390 void set_actual_menu_position(MenuPosition actual_menu_position) { |
391 actual_menu_position_ = actual_menu_position; | 391 actual_menu_position_ = actual_menu_position; |
392 } | 392 } |
393 | 393 |
394 void set_controller(MenuController* controller) { controller_ = controller; } | 394 void set_controller(MenuController* controller) { controller_ = controller; } |
395 | 395 |
396 // Returns true when |this| itself has no content and the first child is | |
397 // responsible to show content. | |
dmazzoni
2011/11/10 06:30:49
responsible to show content -> responsible for sho
hashimoto
2011/11/10 07:24:23
Done.
| |
398 // (i.e. when the label is empty and there is only one child.) | |
399 bool IsFirstChildToTakeOver() const; | |
400 | |
396 // The delegate. This is only valid for the root menu item. You shouldn't | 401 // The delegate. This is only valid for the root menu item. You shouldn't |
397 // use this directly, instead use GetDelegate() which walks the tree as | 402 // use this directly, instead use GetDelegate() which walks the tree as |
398 // as necessary. | 403 // as necessary. |
399 MenuDelegate* delegate_; | 404 MenuDelegate* delegate_; |
400 | 405 |
401 // The controller for the run operation, or NULL if the menu isn't showing. | 406 // The controller for the run operation, or NULL if the menu isn't showing. |
402 MenuController* controller_; | 407 MenuController* controller_; |
403 | 408 |
404 // Used to detect when Cancel was invoked. | 409 // Used to detect when Cancel was invoked. |
405 bool canceled_; | 410 bool canceled_; |
(...skipping 10 matching lines...) Expand all Loading... | |
416 | 421 |
417 // Command id. | 422 // Command id. |
418 int command_; | 423 int command_; |
419 | 424 |
420 // Submenu, created via CreateSubmenu. | 425 // Submenu, created via CreateSubmenu. |
421 SubmenuView* submenu_; | 426 SubmenuView* submenu_; |
422 | 427 |
423 // Title. | 428 // Title. |
424 string16 title_; | 429 string16 title_; |
425 | 430 |
426 // Accessible name (doesn't include accelerators, etc.). | |
427 string16 accessible_name_; | |
428 | |
429 // Icon. | 431 // Icon. |
430 SkBitmap icon_; | 432 SkBitmap icon_; |
431 | 433 |
432 // Does the title have a mnemonic? Only useful on the root menu item. | 434 // Does the title have a mnemonic? Only useful on the root menu item. |
433 bool has_mnemonics_; | 435 bool has_mnemonics_; |
434 | 436 |
435 // Should we show the mnemonic? Mnemonics are shown if this is true or | 437 // Should we show the mnemonic? Mnemonics are shown if this is true or |
436 // MenuConfig says mnemonics should be shown. Only used on the root menu item. | 438 // MenuConfig says mnemonics should be shown. Only used on the root menu item. |
437 bool show_mnemonics_; | 439 bool show_mnemonics_; |
438 | 440 |
(...skipping 27 matching lines...) Expand all Loading... | |
466 // position of the menu being shown. | 468 // position of the menu being shown. |
467 MenuPosition requested_menu_position_; | 469 MenuPosition requested_menu_position_; |
468 MenuPosition actual_menu_position_; | 470 MenuPosition actual_menu_position_; |
469 | 471 |
470 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 472 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
471 }; | 473 }; |
472 | 474 |
473 } // namespace views | 475 } // namespace views |
474 | 476 |
475 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 477 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
OLD | NEW |