| 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 <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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |