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

Unified Diff: chrome/browser/views/bookmark_bar_view.cc

Issue 467017: Downward drag after mouse-down is now causing bookmark bar folders to open, r... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.h ('k') | chrome/browser/views/toolbar_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bookmark_bar_view.cc
===================================================================
--- chrome/browser/views/bookmark_bar_view.cc (revision 33794)
+++ chrome/browser/views/bookmark_bar_view.cc (working copy)
@@ -1116,6 +1116,31 @@
drag_data.Write(profile_, data);
}
+bool BookmarkBarView::CanStartDrag(views::View* sender,
+ int press_x,
+ int press_y,
+ int x,
+ int y) {
+ // Check if we have not moved enough horizontally but we have moved downward
+ // vertically - downward drag.
+ if (!View::ExceededDragThreshold(press_x - x, 0) && press_y < y) {
+ for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
+ if (sender == GetBookmarkButton(i)) {
+ const BookmarkNode* node = model_->GetBookmarkBarNode()->GetChild(i);
+ // If the folder button was dragged, show the menu instead.
+ if (node && node->is_folder()) {
+ views::MenuButton* menu_button =
+ static_cast<views::MenuButton*>(sender);
+ menu_button->Activate();
+ return false;
+ }
+ break;
+ }
+ }
+ }
+ return true;
+}
+
int BookmarkBarView::GetDragOperations(View* sender, int x, int y) {
if (size_animation_->IsAnimating() ||
(size_animation_->GetCurrentValue() == 0 && !OnNewTabPage())) {
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.h ('k') | chrome/browser/views/toolbar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698