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/bookmarks/bookmark_menu_controller_views.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return menu_delegate_->AreDropTypesRequired(menu); | 112 return menu_delegate_->AreDropTypesRequired(menu); |
113 } | 113 } |
114 | 114 |
115 bool BookmarkMenuController::CanDrop(MenuItemView* menu, | 115 bool BookmarkMenuController::CanDrop(MenuItemView* menu, |
116 const ui::OSExchangeData& data) { | 116 const ui::OSExchangeData& data) { |
117 return menu_delegate_->CanDrop(menu, data); | 117 return menu_delegate_->CanDrop(menu, data); |
118 } | 118 } |
119 | 119 |
120 int BookmarkMenuController::GetDropOperation( | 120 int BookmarkMenuController::GetDropOperation( |
121 MenuItemView* item, | 121 MenuItemView* item, |
122 const views::DropTargetEvent& event, | 122 const ui::DropTargetEvent& event, |
123 DropPosition* position) { | 123 DropPosition* position) { |
124 return menu_delegate_->GetDropOperation(item, event, position); | 124 return menu_delegate_->GetDropOperation(item, event, position); |
125 } | 125 } |
126 | 126 |
127 int BookmarkMenuController::OnPerformDrop(MenuItemView* menu, | 127 int BookmarkMenuController::OnPerformDrop(MenuItemView* menu, |
128 DropPosition position, | 128 DropPosition position, |
129 const views::DropTargetEvent& event) { | 129 const ui::DropTargetEvent& event) { |
130 int result = menu_delegate_->OnPerformDrop(menu, position, event); | 130 int result = menu_delegate_->OnPerformDrop(menu, position, event); |
131 if (for_drop_) | 131 if (for_drop_) |
132 delete this; | 132 delete this; |
133 return result; | 133 return result; |
134 } | 134 } |
135 | 135 |
136 bool BookmarkMenuController::ShowContextMenu(MenuItemView* source, | 136 bool BookmarkMenuController::ShowContextMenu(MenuItemView* source, |
137 int id, | 137 int id, |
138 const gfx::Point& p, | 138 const gfx::Point& p, |
139 bool is_mouse_gesture) { | 139 bool is_mouse_gesture) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 if (!menu_delegate_->is_mutating_model()) | 188 if (!menu_delegate_->is_mutating_model()) |
189 menu()->Cancel(); | 189 menu()->Cancel(); |
190 } | 190 } |
191 | 191 |
192 BookmarkMenuController::~BookmarkMenuController() { | 192 BookmarkMenuController::~BookmarkMenuController() { |
193 BookmarkModelFactory::GetForProfile( | 193 BookmarkModelFactory::GetForProfile( |
194 menu_delegate_->profile())->RemoveObserver(this); | 194 menu_delegate_->profile())->RemoveObserver(this); |
195 if (observer_) | 195 if (observer_) |
196 observer_->BookmarkMenuDeleted(this); | 196 observer_->BookmarkMenuDeleted(this); |
197 } | 197 } |
OLD | NEW |