| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/bookmark_bar_view.h" | 5 #include "chrome/browser/views/bookmark_bar_view.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/base_drag_source.h" | 10 #include "base/base_drag_source.h" |
| (...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 void BookmarkBarView::WriteDragData(BookmarkNode* node, | 1162 void BookmarkBarView::WriteDragData(BookmarkNode* node, |
| 1163 OSExchangeData* data) { | 1163 OSExchangeData* data) { |
| 1164 DCHECK(node && data); | 1164 DCHECK(node && data); |
| 1165 BookmarkDragData drag_data(node); | 1165 BookmarkDragData drag_data(node); |
| 1166 drag_data.Write(profile_, data); | 1166 drag_data.Write(profile_, data); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 int BookmarkBarView::GetDragOperations(View* sender, int x, int y) { | 1169 int BookmarkBarView::GetDragOperations(View* sender, int x, int y) { |
| 1170 if (size_animation_->IsAnimating() || |
| 1171 size_animation_->GetCurrentValue() == 0) { |
| 1172 // Don't let the user drag while animating open or we're closed. This |
| 1173 // typically is only hit if the user does something to inadvertanty trigger |
| 1174 // dnd, such as pressing the mouse and hitting control-b. |
| 1175 return DragDropTypes::DRAG_NONE; |
| 1176 } |
| 1177 |
| 1170 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { | 1178 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { |
| 1171 if (sender == GetBookmarkButton(i)) { | 1179 if (sender == GetBookmarkButton(i)) { |
| 1172 return bookmark_utils::BookmarkDragOperation( | 1180 return bookmark_utils::BookmarkDragOperation( |
| 1173 model_->GetBookmarkBarNode()->GetChild(i)); | 1181 model_->GetBookmarkBarNode()->GetChild(i)); |
| 1174 } | 1182 } |
| 1175 } | 1183 } |
| 1176 NOTREACHED(); | 1184 NOTREACHED(); |
| 1177 return DragDropTypes::DRAG_NONE; | 1185 return DragDropTypes::DRAG_NONE; |
| 1178 } | 1186 } |
| 1179 | 1187 |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 } | 1654 } |
| 1647 | 1655 |
| 1648 void BookmarkBarView::StopThrobbing(bool immediate) { | 1656 void BookmarkBarView::StopThrobbing(bool immediate) { |
| 1649 if (!throbbing_view_) | 1657 if (!throbbing_view_) |
| 1650 return; | 1658 return; |
| 1651 | 1659 |
| 1652 // If not immediate, cycle through 2 more complete cycles. | 1660 // If not immediate, cycle through 2 more complete cycles. |
| 1653 throbbing_view_->StartThrobbing(immediate ? 0 : 4); | 1661 throbbing_view_->StartThrobbing(immediate ? 0 : 4); |
| 1654 throbbing_view_ = NULL; | 1662 throbbing_view_ = NULL; |
| 1655 } | 1663 } |
| OLD | NEW |