OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 | 647 |
648 // Since the drop indicator is painted directly onto the canvas, we must | 648 // Since the drop indicator is painted directly onto the canvas, we must |
649 // make sure it is painted in the right location if the locale is RTL. | 649 // make sure it is painted in the right location if the locale is RTL. |
650 gfx::Rect indicator_bounds(x - kDropIndicatorWidth / 2, | 650 gfx::Rect indicator_bounds(x - kDropIndicatorWidth / 2, |
651 y, | 651 y, |
652 kDropIndicatorWidth, | 652 kDropIndicatorWidth, |
653 h); | 653 h); |
654 indicator_bounds.set_x(GetMirroredXForRect(indicator_bounds)); | 654 indicator_bounds.set_x(GetMirroredXForRect(indicator_bounds)); |
655 | 655 |
656 // TODO(sky/glen): make me pretty! | 656 // TODO(sky/glen): make me pretty! |
657 canvas->FillRectInt(kDropIndicatorColor, indicator_bounds.x(), | 657 canvas->FillRect(kDropIndicatorColor, indicator_bounds); |
658 indicator_bounds.y(), indicator_bounds.width(), | |
659 indicator_bounds.height()); | |
660 } | 658 } |
661 } | 659 } |
662 | 660 |
663 bool BookmarkBarView::GetDropFormats( | 661 bool BookmarkBarView::GetDropFormats( |
664 int* formats, | 662 int* formats, |
665 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { | 663 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { |
666 if (!model_ || !model_->IsLoaded()) | 664 if (!model_ || !model_->IsLoaded()) |
667 return false; | 665 return false; |
668 *formats = ui::OSExchangeData::URL; | 666 *formats = ui::OSExchangeData::URL; |
669 custom_formats->insert(BookmarkNodeData::GetBookmarkCustomFormat()); | 667 custom_formats->insert(BookmarkNodeData::GetBookmarkCustomFormat()); |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 (1 - size_animation_->GetCurrentValue()))); | 1659 (1 - size_animation_->GetCurrentValue()))); |
1662 } else { | 1660 } else { |
1663 prefsize.set_height( | 1661 prefsize.set_height( |
1664 static_cast<int>( | 1662 static_cast<int>( |
1665 browser_defaults::kBookmarkBarHeight * | 1663 browser_defaults::kBookmarkBarHeight * |
1666 size_animation_->GetCurrentValue())); | 1664 size_animation_->GetCurrentValue())); |
1667 } | 1665 } |
1668 } | 1666 } |
1669 return prefsize; | 1667 return prefsize; |
1670 } | 1668 } |
OLD | NEW |