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

Unified Diff: chrome/browser/views/bookmark_bar_view.cc

Issue 204022: ExtensionShelf now uses the BookmarkExtensionBackground, just like the Bookma... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.h ('k') | chrome/browser/views/extensions/extension_shelf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bookmark_bar_view.cc
===================================================================
--- chrome/browser/views/bookmark_bar_view.cc (revision 26222)
+++ 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();
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.h ('k') | chrome/browser/views/extensions/extension_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698