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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 826 |
827 bool WrenchMenu::CanDrop(MenuItemView* menu, | 827 bool WrenchMenu::CanDrop(MenuItemView* menu, |
828 const ui::OSExchangeData& data) { | 828 const ui::OSExchangeData& data) { |
829 CreateBookmarkMenu(); | 829 CreateBookmarkMenu(); |
830 return bookmark_menu_delegate_.get() && | 830 return bookmark_menu_delegate_.get() && |
831 bookmark_menu_delegate_->CanDrop(menu, data); | 831 bookmark_menu_delegate_->CanDrop(menu, data); |
832 } | 832 } |
833 | 833 |
834 int WrenchMenu::GetDropOperation( | 834 int WrenchMenu::GetDropOperation( |
835 MenuItemView* item, | 835 MenuItemView* item, |
836 const views::DropTargetEvent& event, | 836 const ui::DropTargetEvent& event, |
837 DropPosition* position) { | 837 DropPosition* position) { |
838 return is_bookmark_command(item->GetCommand()) ? | 838 return is_bookmark_command(item->GetCommand()) ? |
839 bookmark_menu_delegate_->GetDropOperation(item, event, position) : | 839 bookmark_menu_delegate_->GetDropOperation(item, event, position) : |
840 ui::DragDropTypes::DRAG_NONE; | 840 ui::DragDropTypes::DRAG_NONE; |
841 } | 841 } |
842 | 842 |
843 int WrenchMenu::OnPerformDrop(MenuItemView* menu, | 843 int WrenchMenu::OnPerformDrop(MenuItemView* menu, |
844 DropPosition position, | 844 DropPosition position, |
845 const views::DropTargetEvent& event) { | 845 const ui::DropTargetEvent& event) { |
846 if (!is_bookmark_command(menu->GetCommand())) | 846 if (!is_bookmark_command(menu->GetCommand())) |
847 return ui::DragDropTypes::DRAG_NONE; | 847 return ui::DragDropTypes::DRAG_NONE; |
848 | 848 |
849 int result = bookmark_menu_delegate_->OnPerformDrop(menu, position, event); | 849 int result = bookmark_menu_delegate_->OnPerformDrop(menu, position, event); |
850 return result; | 850 return result; |
851 } | 851 } |
852 | 852 |
853 bool WrenchMenu::ShowContextMenu(MenuItemView* source, | 853 bool WrenchMenu::ShowContextMenu(MenuItemView* source, |
854 int id, | 854 int id, |
855 const gfx::Point& p, | 855 const gfx::Point& p, |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 bookmark_menu_delegate_.reset( | 1113 bookmark_menu_delegate_.reset( |
1114 new BookmarkMenuDelegate(browser_, | 1114 new BookmarkMenuDelegate(browser_, |
1115 browser_, | 1115 browser_, |
1116 parent, | 1116 parent, |
1117 first_bookmark_command_id_)); | 1117 first_bookmark_command_id_)); |
1118 bookmark_menu_delegate_->Init( | 1118 bookmark_menu_delegate_->Init( |
1119 this, bookmark_menu_, model->bookmark_bar_node(), 0, | 1119 this, bookmark_menu_, model->bookmark_bar_node(), 0, |
1120 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1120 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
1121 bookmark_utils::LAUNCH_WRENCH_MENU); | 1121 bookmark_utils::LAUNCH_WRENCH_MENU); |
1122 } | 1122 } |
OLD | NEW |