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

Side by Side Diff: chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc

Issue 399143004: Open the WrenchMenu on mouseover when dragging a browser action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Win/Test Fix Created 6 years, 5 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
OLDNEW
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/extensions/browser_action_overflow_menu_contro ller.h" 5 #include "chrome/browser/ui/views/extensions/browser_action_overflow_menu_contro ller.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/extensions/extension_action.h" 9 #include "chrome/browser/extensions/extension_action.h"
10 #include "chrome/browser/extensions/extension_action_manager.h" 10 #include "chrome/browser/extensions/extension_action_manager.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 void BrowserActionOverflowMenuController::DropMenuClosed( 175 void BrowserActionOverflowMenuController::DropMenuClosed(
176 views::MenuItemView* menu) { 176 views::MenuItemView* menu) {
177 delete this; 177 delete this;
178 } 178 }
179 179
180 bool BrowserActionOverflowMenuController::GetDropFormats( 180 bool BrowserActionOverflowMenuController::GetDropFormats(
181 views::MenuItemView* menu, 181 views::MenuItemView* menu,
182 int* formats, 182 int* formats,
183 std::set<OSExchangeData::CustomFormat>* custom_formats) { 183 std::set<OSExchangeData::CustomFormat>* custom_formats) {
184 custom_formats->insert(BrowserActionDragData::GetBrowserActionCustomFormat()); 184 return BrowserActionDragData::GetDropFormats(custom_formats);
185 return true;
186 } 185 }
187 186
188 bool BrowserActionOverflowMenuController::AreDropTypesRequired( 187 bool BrowserActionOverflowMenuController::AreDropTypesRequired(
189 views::MenuItemView* menu) { 188 views::MenuItemView* menu) {
190 return true; 189 return BrowserActionDragData::AreDropTypesRequired();
191 } 190 }
192 191
193 bool BrowserActionOverflowMenuController::CanDrop( 192 bool BrowserActionOverflowMenuController::CanDrop(
194 views::MenuItemView* menu, const OSExchangeData& data) { 193 views::MenuItemView* menu, const OSExchangeData& data) {
195 BrowserActionDragData drop_data; 194 return BrowserActionDragData::CanDrop(data, owner_->profile());
196 if (!drop_data.Read(data))
197 return false;
198 return drop_data.IsFromProfile(owner_->profile());
199 } 195 }
200 196
201 int BrowserActionOverflowMenuController::GetDropOperation( 197 int BrowserActionOverflowMenuController::GetDropOperation(
202 views::MenuItemView* item, 198 views::MenuItemView* item,
203 const ui::DropTargetEvent& event, 199 const ui::DropTargetEvent& event,
204 DropPosition* position) { 200 DropPosition* position) {
205 // Don't allow dropping from the BrowserActionContainer into slot 0 of the 201 // Don't allow dropping from the BrowserActionContainer into slot 0 of the
206 // overflow menu since once the move has taken place the item you are dragging 202 // overflow menu since once the move has taken place the item you are dragging
207 // falls right out of the menu again once the user releases the button 203 // falls right out of the menu again once the user releases the button
208 // (because we don't shrink the BrowserActionContainer when you do this). 204 // (because we don't shrink the BrowserActionContainer when you do this).
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 259
264 BrowserActionView* BrowserActionOverflowMenuController::ViewForId( 260 BrowserActionView* BrowserActionOverflowMenuController::ViewForId(
265 int id, size_t* index) { 261 int id, size_t* index) {
266 // The index of the view being dragged (GetCommand gives a 1-based index into 262 // The index of the view being dragged (GetCommand gives a 1-based index into
267 // the overflow menu). 263 // the overflow menu).
268 size_t view_index = owner_->VisibleBrowserActions() + id - 1; 264 size_t view_index = owner_->VisibleBrowserActions() + id - 1;
269 if (index) 265 if (index)
270 *index = view_index; 266 *index = view_index;
271 return owner_->GetBrowserActionViewAt(view_index); 267 return owner_->GetBrowserActionViewAt(view_index);
272 } 268 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/browser_action_drag_data.cc ('k') | chrome/browser/ui/views/menu_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698