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

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

Issue 2897533003: Change default ink drop center points to center of contents bounds (Closed)
Patch Set: fix compile Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_header_painter_ash.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 } else { 1072 } else {
1073 x = GetBookmarkButton(index)->x(); 1073 x = GetBookmarkButton(index)->x();
1074 } 1074 }
1075 if (GetBookmarkButtonCount() > 0 && GetBookmarkButton(0)->visible()) { 1075 if (GetBookmarkButtonCount() > 0 && GetBookmarkButton(0)->visible()) {
1076 y = GetBookmarkButton(0)->y(); 1076 y = GetBookmarkButton(0)->y();
1077 h = GetBookmarkButton(0)->height(); 1077 h = GetBookmarkButton(0)->height();
1078 } 1078 }
1079 1079
1080 // Since the drop indicator is painted directly onto the canvas, we must 1080 // Since the drop indicator is painted directly onto the canvas, we must
1081 // make sure it is painted in the right location if the locale is RTL. 1081 // make sure it is painted in the right location if the locale is RTL.
1082 gfx::Rect indicator_bounds(x - kDropIndicatorWidth / 2, 1082 gfx::Rect indicator_bounds = GetMirroredRect(
1083 y, 1083 gfx::Rect(x - kDropIndicatorWidth / 2, y, kDropIndicatorWidth, h));
1084 kDropIndicatorWidth,
1085 h);
1086 indicator_bounds.set_x(GetMirroredXForRect(indicator_bounds));
1087 1084
1088 ui::PaintRecorder recorder(context, size()); 1085 ui::PaintRecorder recorder(context, size());
1089 // TODO(sky/glen): make me pretty! 1086 // TODO(sky/glen): make me pretty!
1090 recorder.canvas()->FillRect( 1087 recorder.canvas()->FillRect(
1091 indicator_bounds, 1088 indicator_bounds,
1092 GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT)); 1089 GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT));
1093 } 1090 }
1094 } 1091 }
1095 1092
1096 bool BookmarkBarView::GetDropFormats( 1093 bool BookmarkBarView::GetDropFormats(
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 return; 2162 return;
2166 apps_page_shortcut_->SetVisible(visible); 2163 apps_page_shortcut_->SetVisible(visible);
2167 UpdateBookmarksSeparatorVisibility(); 2164 UpdateBookmarksSeparatorVisibility();
2168 LayoutAndPaint(); 2165 LayoutAndPaint();
2169 } 2166 }
2170 2167
2171 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2168 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2172 if (UpdateOtherAndManagedButtonsVisibility()) 2169 if (UpdateOtherAndManagedButtonsVisibility())
2173 LayoutAndPaint(); 2170 LayoutAndPaint();
2174 } 2171 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_header_painter_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698