| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/wrench_menu.h" | 5 #include "chrome/browser/ui/views/wrench_menu.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 | 922 |
| 923 MenuItemView* menu_item = parent->AppendMenuItemFromModel(model, index, id); | 923 MenuItemView* menu_item = parent->AppendMenuItemFromModel(model, index, id); |
| 924 | 924 |
| 925 if (menu_item) { | 925 if (menu_item) { |
| 926 // Flush all buttons to the right side of the menu for touch menus. | 926 // Flush all buttons to the right side of the menu for touch menus. |
| 927 menu_item->set_use_right_margin( | 927 menu_item->set_use_right_margin( |
| 928 ui::GetDisplayLayout() != ui::LAYOUT_TOUCH); | 928 ui::GetDisplayLayout() != ui::LAYOUT_TOUCH); |
| 929 menu_item->SetVisible(model->IsVisibleAt(index)); | 929 menu_item->SetVisible(model->IsVisibleAt(index)); |
| 930 | 930 |
| 931 if (menu_type == MenuModel::TYPE_COMMAND && model->HasIcons()) { | 931 if (menu_type == MenuModel::TYPE_COMMAND && model->HasIcons()) { |
| 932 SkBitmap icon; | 932 gfx::ImageSkia icon; |
| 933 if (model->GetIconAt(index, &icon)) | 933 if (model->GetIconAt(index, &icon)) |
| 934 menu_item->SetIcon(icon); | 934 menu_item->SetIcon(icon); |
| 935 } | 935 } |
| 936 } | 936 } |
| 937 | 937 |
| 938 return menu_item; | 938 return menu_item; |
| 939 } | 939 } |
| 940 | 940 |
| 941 void WrenchMenu::CancelAndEvaluate(MenuModel* model, int index) { | 941 void WrenchMenu::CancelAndEvaluate(MenuModel* model, int index) { |
| 942 selected_menu_model_ = model; | 942 selected_menu_model_ = model; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 960 bookmark_menu_delegate_.reset( | 960 bookmark_menu_delegate_.reset( |
| 961 new BookmarkMenuDelegate(browser_->profile(), | 961 new BookmarkMenuDelegate(browser_->profile(), |
| 962 NULL, | 962 NULL, |
| 963 parent, | 963 parent, |
| 964 first_bookmark_command_id_)); | 964 first_bookmark_command_id_)); |
| 965 bookmark_menu_delegate_->Init( | 965 bookmark_menu_delegate_->Init( |
| 966 this, bookmark_menu_, model->bookmark_bar_node(), 0, | 966 this, bookmark_menu_, model->bookmark_bar_node(), 0, |
| 967 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 967 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
| 968 bookmark_utils::LAUNCH_WRENCH_MENU); | 968 bookmark_utils::LAUNCH_WRENCH_MENU); |
| 969 } | 969 } |
| OLD | NEW |