Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: views/controls/menu/menu_item_view.h

Issue 8511003: Fix to correctly set accessible name of menu item when there is only one child and title is empty (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed the method name from FirstChildTakesOver to IsContainer Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 if this MenuItemView contains a single child
397 // that is responsible for rendering the content.
398 bool IsContainer() const;
399
396 // The delegate. This is only valid for the root menu item. You shouldn't 400 // 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 401 // use this directly, instead use GetDelegate() which walks the tree as
398 // as necessary. 402 // as necessary.
399 MenuDelegate* delegate_; 403 MenuDelegate* delegate_;
400 404
401 // The controller for the run operation, or NULL if the menu isn't showing. 405 // The controller for the run operation, or NULL if the menu isn't showing.
402 MenuController* controller_; 406 MenuController* controller_;
403 407
404 // Used to detect when Cancel was invoked. 408 // Used to detect when Cancel was invoked.
405 bool canceled_; 409 bool canceled_;
(...skipping 10 matching lines...) Expand all
416 420
417 // Command id. 421 // Command id.
418 int command_; 422 int command_;
419 423
420 // Submenu, created via CreateSubmenu. 424 // Submenu, created via CreateSubmenu.
421 SubmenuView* submenu_; 425 SubmenuView* submenu_;
422 426
423 // Title. 427 // Title.
424 string16 title_; 428 string16 title_;
425 429
426 // Accessible name (doesn't include accelerators, etc.).
427 string16 accessible_name_;
428
429 // Icon. 430 // Icon.
430 SkBitmap icon_; 431 SkBitmap icon_;
431 432
432 // Does the title have a mnemonic? Only useful on the root menu item. 433 // Does the title have a mnemonic? Only useful on the root menu item.
433 bool has_mnemonics_; 434 bool has_mnemonics_;
434 435
435 // Should we show the mnemonic? Mnemonics are shown if this is true or 436 // 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. 437 // MenuConfig says mnemonics should be shown. Only used on the root menu item.
437 bool show_mnemonics_; 438 bool show_mnemonics_;
438 439
(...skipping 27 matching lines...) Expand all
466 // position of the menu being shown. 467 // position of the menu being shown.
467 MenuPosition requested_menu_position_; 468 MenuPosition requested_menu_position_;
468 MenuPosition actual_menu_position_; 469 MenuPosition actual_menu_position_;
469 470
470 DISALLOW_COPY_AND_ASSIGN(MenuItemView); 471 DISALLOW_COPY_AND_ASSIGN(MenuItemView);
471 }; 472 };
472 473
473 } // namespace views 474 } // namespace views
474 475
475 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ 476 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698