| 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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 const gfx::Point& press_pt, | 948 const gfx::Point& press_pt, |
| 949 ui::OSExchangeData* data) { | 949 ui::OSExchangeData* data) { |
| 950 content::RecordAction(UserMetricsAction("BookmarkBar_DragButton")); | 950 content::RecordAction(UserMetricsAction("BookmarkBar_DragButton")); |
| 951 | 951 |
| 952 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { | 952 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { |
| 953 if (sender == GetBookmarkButton(i)) { | 953 if (sender == GetBookmarkButton(i)) { |
| 954 views::TextButton* button = GetBookmarkButton(i); | 954 views::TextButton* button = GetBookmarkButton(i); |
| 955 scoped_ptr<gfx::Canvas> canvas( | 955 scoped_ptr<gfx::Canvas> canvas( |
| 956 views::GetCanvasForDragImage(button->GetWidget(), button->size())); | 956 views::GetCanvasForDragImage(button->GetWidget(), button->size())); |
| 957 button->PaintButton(canvas.get(), views::TextButton::PB_FOR_DRAG); | 957 button->PaintButton(canvas.get(), views::TextButton::PB_FOR_DRAG); |
| 958 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), press_pt, | 958 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), |
| 959 press_pt.DistanceFromOrigin(), |
| 959 data); | 960 data); |
| 960 WriteBookmarkDragData(model_->bookmark_bar_node()->GetChild(i), data); | 961 WriteBookmarkDragData(model_->bookmark_bar_node()->GetChild(i), data); |
| 961 return; | 962 return; |
| 962 } | 963 } |
| 963 } | 964 } |
| 964 NOTREACHED(); | 965 NOTREACHED(); |
| 965 } | 966 } |
| 966 | 967 |
| 967 int BookmarkBarView::GetDragOperationsForView(View* sender, | 968 int BookmarkBarView::GetDragOperationsForView(View* sender, |
| 968 const gfx::Point& p) { | 969 const gfx::Point& p) { |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 (1 - size_animation_->GetCurrentValue()))); | 1686 (1 - size_animation_->GetCurrentValue()))); |
| 1686 } else { | 1687 } else { |
| 1687 prefsize.set_height( | 1688 prefsize.set_height( |
| 1688 static_cast<int>( | 1689 static_cast<int>( |
| 1689 browser_defaults::kBookmarkBarHeight * | 1690 browser_defaults::kBookmarkBarHeight * |
| 1690 size_animation_->GetCurrentValue())); | 1691 size_animation_->GetCurrentValue())); |
| 1691 } | 1692 } |
| 1692 } | 1693 } |
| 1693 return prefsize; | 1694 return prefsize; |
| 1694 } | 1695 } |
| OLD | NEW |