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

Side by Side Diff: chrome/browser/views/wrench_menu.cc

Issue 3289001: Adds support for invisible menu items to bookmark menus and wires it (Closed)
Patch Set: Created 10 years, 3 months 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
« no previous file with comments | « no previous file | views/controls/menu/submenu_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) 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 #include "chrome/browser/views/wrench_menu.h" 5 #include "chrome/browser/views/wrench_menu.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 NOTREACHED(); 699 NOTREACHED();
700 type = MenuItemView::NORMAL; 700 type = MenuItemView::NORMAL;
701 break; 701 break;
702 } 702 }
703 703
704 id_to_entry_[id].first = model; 704 id_to_entry_[id].first = model;
705 id_to_entry_[id].second = index; 705 id_to_entry_[id].second = index;
706 706
707 MenuItemView* menu_item = parent->AppendMenuItemImpl(id, label, icon, type); 707 MenuItemView* menu_item = parent->AppendMenuItemImpl(id, label, icon, type);
708 708
709 if (menu_item)
710 menu_item->SetVisible(model->IsVisibleAt(index));
711
709 if (menu_type == MenuModel::TYPE_COMMAND && model->HasIcons()) { 712 if (menu_type == MenuModel::TYPE_COMMAND && model->HasIcons()) {
710 SkBitmap icon; 713 SkBitmap icon;
711 if (model->GetIconAt(index, &icon)) 714 if (model->GetIconAt(index, &icon))
712 menu_item->SetIcon(icon); 715 menu_item->SetIcon(icon);
713 } 716 }
714 717
715 return menu_item; 718 return menu_item;
716 } 719 }
717 720
718 void WrenchMenu::CancelAndEvaluate(MenuModel* model, int index) { 721 void WrenchMenu::CancelAndEvaluate(MenuModel* model, int index) {
719 selected_menu_model_ = model; 722 selected_menu_model_ = model;
720 selected_index_ = index; 723 selected_index_ = index;
721 root_->Cancel(); 724 root_->Cancel();
722 } 725 }
OLDNEW
« no previous file with comments | « no previous file | views/controls/menu/submenu_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698