| 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_bar_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 const gfx::Point& press_pt, | 998 const gfx::Point& press_pt, |
| 999 ui::OSExchangeData* data) { | 999 ui::OSExchangeData* data) { |
| 1000 content::RecordAction(UserMetricsAction("BookmarkBar_DragButton")); | 1000 content::RecordAction(UserMetricsAction("BookmarkBar_DragButton")); |
| 1001 | 1001 |
| 1002 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { | 1002 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { |
| 1003 if (sender == GetBookmarkButton(i)) { | 1003 if (sender == GetBookmarkButton(i)) { |
| 1004 views::TextButton* button = GetBookmarkButton(i); | 1004 views::TextButton* button = GetBookmarkButton(i); |
| 1005 scoped_ptr<gfx::Canvas> canvas( | 1005 scoped_ptr<gfx::Canvas> canvas( |
| 1006 views::GetCanvasForDragImage(button->GetWidget(), button->size())); | 1006 views::GetCanvasForDragImage(button->GetWidget(), button->size())); |
| 1007 button->PaintButton(canvas.get(), views::TextButton::PB_FOR_DRAG); | 1007 button->PaintButton(canvas.get(), views::TextButton::PB_FOR_DRAG); |
| 1008 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), press_pt, | 1008 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), |
| 1009 press_pt.OffsetFromOrigin(), |
| 1009 data); | 1010 data); |
| 1010 WriteBookmarkDragData(model_->bookmark_bar_node()->GetChild(i), data); | 1011 WriteBookmarkDragData(model_->bookmark_bar_node()->GetChild(i), data); |
| 1011 return; | 1012 return; |
| 1012 } | 1013 } |
| 1013 } | 1014 } |
| 1014 NOTREACHED(); | 1015 NOTREACHED(); |
| 1015 } | 1016 } |
| 1016 | 1017 |
| 1017 int BookmarkBarView::GetDragOperationsForView(View* sender, | 1018 int BookmarkBarView::GetDragOperationsForView(View* sender, |
| 1018 const gfx::Point& p) { | 1019 const gfx::Point& p) { |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1737 (1 - size_animation_->GetCurrentValue()))); | 1738 (1 - size_animation_->GetCurrentValue()))); |
| 1738 } else { | 1739 } else { |
| 1739 prefsize.set_height( | 1740 prefsize.set_height( |
| 1740 static_cast<int>( | 1741 static_cast<int>( |
| 1741 browser_defaults::kBookmarkBarHeight * | 1742 browser_defaults::kBookmarkBarHeight * |
| 1742 size_animation_->GetCurrentValue())); | 1743 size_animation_->GetCurrentValue())); |
| 1743 } | 1744 } |
| 1744 } | 1745 } |
| 1745 return prefsize; | 1746 return prefsize; |
| 1746 } | 1747 } |
| OLD | NEW |