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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 const gfx::Point& press_pt, | 1117 const gfx::Point& press_pt, |
1118 ui::OSExchangeData* data) { | 1118 ui::OSExchangeData* data) { |
1119 content::RecordAction(UserMetricsAction("BookmarkBar_DragButton")); | 1119 content::RecordAction(UserMetricsAction("BookmarkBar_DragButton")); |
1120 | 1120 |
1121 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { | 1121 for (int i = 0; i < GetBookmarkButtonCount(); ++i) { |
1122 if (sender == GetBookmarkButton(i)) { | 1122 if (sender == GetBookmarkButton(i)) { |
1123 views::TextButton* button = GetBookmarkButton(i); | 1123 views::TextButton* button = GetBookmarkButton(i); |
1124 scoped_ptr<gfx::Canvas> canvas( | 1124 scoped_ptr<gfx::Canvas> canvas( |
1125 views::GetCanvasForDragImage(button->GetWidget(), button->size())); | 1125 views::GetCanvasForDragImage(button->GetWidget(), button->size())); |
1126 button->PaintButton(canvas.get(), views::TextButton::PB_FOR_DRAG); | 1126 button->PaintButton(canvas.get(), views::TextButton::PB_FOR_DRAG); |
1127 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), | 1127 drag_utils::SetDragImageOnDataObject(*canvas, |
1128 press_pt.OffsetFromOrigin(), | 1128 press_pt.OffsetFromOrigin(), |
1129 data); | 1129 data); |
1130 WriteBookmarkDragData(model()->bookmark_bar_node()->GetChild(i), data); | 1130 WriteBookmarkDragData(model()->bookmark_bar_node()->GetChild(i), data); |
1131 return; | 1131 return; |
1132 } | 1132 } |
1133 } | 1133 } |
1134 NOTREACHED(); | 1134 NOTREACHED(); |
1135 } | 1135 } |
1136 | 1136 |
1137 int BookmarkBarView::GetDragOperationsForView(View* sender, | 1137 int BookmarkBarView::GetDragOperationsForView(View* sender, |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1903 DCHECK(apps_page_shortcut_); | 1903 DCHECK(apps_page_shortcut_); |
1904 // Only perform layout if required. | 1904 // Only perform layout if required. |
1905 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar( | 1905 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar( |
1906 browser_->profile(), browser_->host_desktop_type()); | 1906 browser_->profile(), browser_->host_desktop_type()); |
1907 if (apps_page_shortcut_->visible() == visible) | 1907 if (apps_page_shortcut_->visible() == visible) |
1908 return; | 1908 return; |
1909 apps_page_shortcut_->SetVisible(visible); | 1909 apps_page_shortcut_->SetVisible(visible); |
1910 UpdateBookmarksSeparatorVisibility(); | 1910 UpdateBookmarksSeparatorVisibility(); |
1911 Layout(); | 1911 Layout(); |
1912 } | 1912 } |
OLD | NEW |