summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 23:56:48 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 23:56:48 +0000
commit3d4ff9f575c787e3d4d837a983720bc725636ef4 (patch)
tree2983c74c18c38154cd253ca352f7f433c8fca8ec /chrome/browser/views
parentef025165839be0bd42ce65e35ee8afa70315527d (diff)
downloadchromium_src-3d4ff9f575c787e3d4d837a983720bc725636ef4.zip
chromium_src-3d4ff9f575c787e3d4d837a983720bc725636ef4.tar.gz
chromium_src-3d4ff9f575c787e3d4d837a983720bc725636ef4.tar.bz2
Disallows dragging from the bookmark bar when the bookmark bar is
closed or animating. This fixes a case where clicking on a bookmark bar, then hitting control-b triggers a drag. BUG=8674 TEST=see bug Review URL: http://codereview.chromium.org/46066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index f73b777..5c95b08 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -1167,6 +1167,14 @@ void BookmarkBarView::WriteDragData(BookmarkNode* node,
}
int BookmarkBarView::GetDragOperations(View* sender, int x, int y) {
+ if (size_animation_->IsAnimating() ||
+ size_animation_->GetCurrentValue() == 0) {
+ // Don't let the user drag while animating open or we're closed. This
+ // typically is only hit if the user does something to inadvertanty trigger
+ // dnd, such as pressing the mouse and hitting control-b.
+ return DragDropTypes::DRAG_NONE;
+ }
+
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
if (sender == GetBookmarkButton(i)) {
return bookmark_utils::BookmarkDragOperation(