| 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 731 |
| 732 if (height() > 0) { | 732 if (height() > 0) { |
| 733 // We only layout while parented. When we become parented, if our bounds | 733 // We only layout while parented. When we become parented, if our bounds |
| 734 // haven't changed, OnBoundsChanged() won't get invoked and we won't | 734 // haven't changed, OnBoundsChanged() won't get invoked and we won't |
| 735 // layout. Therefore we always force a layout when added. | 735 // layout. Therefore we always force a layout when added. |
| 736 Layout(); | 736 Layout(); |
| 737 } | 737 } |
| 738 } | 738 } |
| 739 } | 739 } |
| 740 | 740 |
| 741 void BookmarkBarView::PaintChildren(gfx::Canvas* canvas) { | 741 void BookmarkBarView::PaintChildren(gfx::Canvas* canvas, |
| 742 View::PaintChildren(canvas); | 742 const views::CullSet& cull_set) { |
| 743 View::PaintChildren(canvas, cull_set); |
| 743 | 744 |
| 744 if (drop_info_.get() && drop_info_->valid && | 745 if (drop_info_.get() && drop_info_->valid && |
| 745 drop_info_->location.operation != 0 && drop_info_->location.index != -1 && | 746 drop_info_->location.operation != 0 && drop_info_->location.index != -1 && |
| 746 drop_info_->location.button_type != DROP_OVERFLOW && | 747 drop_info_->location.button_type != DROP_OVERFLOW && |
| 747 !drop_info_->location.on) { | 748 !drop_info_->location.on) { |
| 748 int index = drop_info_->location.index; | 749 int index = drop_info_->location.index; |
| 749 DCHECK(index <= GetBookmarkButtonCount()); | 750 DCHECK(index <= GetBookmarkButtonCount()); |
| 750 int x = 0; | 751 int x = 0; |
| 751 int y = 0; | 752 int y = 0; |
| 752 int h = height(); | 753 int h = height(); |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1853 DCHECK(apps_page_shortcut_); | 1854 DCHECK(apps_page_shortcut_); |
| 1854 // Only perform layout if required. | 1855 // Only perform layout if required. |
| 1855 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar( | 1856 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar( |
| 1856 browser_->profile(), browser_->host_desktop_type()); | 1857 browser_->profile(), browser_->host_desktop_type()); |
| 1857 if (apps_page_shortcut_->visible() == visible) | 1858 if (apps_page_shortcut_->visible() == visible) |
| 1858 return; | 1859 return; |
| 1859 apps_page_shortcut_->SetVisible(visible); | 1860 apps_page_shortcut_->SetVisible(visible); |
| 1860 UpdateBookmarksSeparatorVisibility(); | 1861 UpdateBookmarksSeparatorVisibility(); |
| 1861 Layout(); | 1862 Layout(); |
| 1862 } | 1863 } |
| OLD | NEW |