Index: chrome/browser/views/bookmark_bar_view.cc |
=================================================================== |
--- chrome/browser/views/bookmark_bar_view.cc (revision 25988) |
+++ chrome/browser/views/bookmark_bar_view.cc (working copy) |
@@ -80,9 +80,6 @@ |
// Border colors for the BookmarBarView. |
static const SkColor kTopBorderColor = SkColorSetRGB(222, 234, 248); |
-// How round the 'new tab' style bookmarks bar is. |
-static const int kNewtabBarRoundness = 5; |
- |
// Offset for where the menu is shown relative to the bottom of the |
// BookmarkBarView. |
static const int kMenuOffset = 3; |
@@ -297,25 +294,10 @@ |
virtual ~ButtonSeparatorView() {} |
virtual void Paint(gfx::Canvas* canvas) { |
- SkPaint paint; |
- paint.setShader(skia::CreateGradientShader(0, |
- height() / 2, |
- kTopBorderColor, |
- kSeparatorColor))->safeUnref(); |
- SkRect rc = {SkIntToScalar(kSeparatorStartX), SkIntToScalar(0), |
- SkIntToScalar(1), SkIntToScalar(height() / 2) }; |
- canvas->drawRect(rc, paint); |
- |
- SkPaint paint_down; |
- paint_down.setShader(skia::CreateGradientShader(height() / 2, |
- height(), |
+ DetachableToolbarView::PaintVerticalDivider( |
+ canvas, kSeparatorStartX, height(), 1, kTopBorderColor, |
kSeparatorColor, |
- GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TOOLBAR) |
- ))->safeUnref(); |
- SkRect rc_down = { |
- SkIntToScalar(kSeparatorStartX), SkIntToScalar(height() / 2), |
- SkIntToScalar(1), SkIntToScalar(height() - 1) }; |
- canvas->drawRect(rc_down, paint_down); |
+ GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TOOLBAR)); |
} |
virtual gfx::Size GetPreferredSize() { |
@@ -736,8 +718,8 @@ |
// re-enter her password. If extension shelf appears along with the bookmark |
// shelf, it too needs to be layed out. Since both have the same parent, it is |
// enough to let the parent layout both of these children. |
- // TODO (sky): This should not require Layout() and SchedulePaint(). Needs |
- // some cleanup. |
+ // TODO(sky): This should not require Layout() and SchedulePaint(). Needs |
+ // some cleanup. |
PreferredSizeChanged(); |
Layout(); |
SchedulePaint(); |
@@ -751,15 +733,19 @@ |
size_animation_->Reset(0); |
} |
-bool BookmarkBarView::IsDetachedStyle() { |
+bool BookmarkBarView::IsDetached() const { |
return OnNewTabPage() && (size_animation_->GetCurrentValue() != 1); |
} |
-bool BookmarkBarView::IsAlwaysShown() { |
+bool BookmarkBarView::IsOnTop() const { |
+ return true; |
+} |
+ |
+bool BookmarkBarView::IsAlwaysShown() const { |
return profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); |
} |
-bool BookmarkBarView::OnNewTabPage() { |
+bool BookmarkBarView::OnNewTabPage() const { |
return (browser_ && browser_->GetSelectedTabContents() && |
browser_->GetSelectedTabContents()->IsBookmarkBarAlwaysVisible()); |
} |
@@ -1090,7 +1076,7 @@ |
int x = view->GetX(APPLY_MIRRORING_TRANSFORMATION); |
int bar_height = height() - kMenuOffset; |
- if (IsDetachedStyle()) |
+ if (IsDetached()) |
bar_height -= kNewtabVerticalPadding; |
int start_index = 0; |
@@ -1685,7 +1671,8 @@ |
if (should_show_sync_error_button) { |
x += kButtonPadding; |
if (!compute_bounds_only) { |
- sync_error_button_->SetBounds(x, y, sync_error_button_pref.width(), height); |
+ sync_error_button_->SetBounds( |
+ x, y, sync_error_button_pref.width(), height); |
sync_error_button_->SetVisible(true); |
} |
x += sync_error_button_pref.width(); |