Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 328993002: Ensure that the size passed down to the SetDragImageOnDataObject function called from drag_utils::S… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed parentheses and fixed alignment Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « ash/drag_drop/drag_drop_controller_unittest.cc ('k') | chrome/browser/ui/views/toolbar/browser_actions_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698