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

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

Issue 3167027: Merge 56737 - Fix numerous alignment problems, both horizontal and vertical, ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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/detachable_toolbar_view.h ('k') | chrome/browser/views/dropdown_bar_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/detachable_toolbar_view.cc
===================================================================
--- chrome/browser/views/detachable_toolbar_view.cc (revision 56738)
+++ chrome/browser/views/detachable_toolbar_view.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,6 +11,7 @@
#include "grit/theme_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkShader.h"
+#include "views/window/non_client_view.h"
// How round the 'new tab' style bookmarks bar is.
static const int kNewtabBarRoundness = 5;
@@ -21,21 +22,18 @@
SkColorSetRGB(194, 205, 212);
// static
-void DetachableToolbarView::PaintBackgroundAttachedMode(gfx::Canvas* canvas,
- views::View* view) {
- gfx::Rect bounds =
- view->GetBounds(views::View::APPLY_MIRRORING_TRANSFORMATION);
-
+void DetachableToolbarView::PaintBackgroundAttachedMode(
+ gfx::Canvas* canvas,
+ views::View* view,
+ const gfx::Point& background_origin) {
ThemeProvider* tp = view->GetThemeProvider();
SkColor theme_toolbar_color =
tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR);
canvas->FillRectInt(theme_toolbar_color, 0, 0,
view->width(), view->height());
-
canvas->TileImageInt(*tp->GetBitmapNamed(IDR_THEME_TOOLBAR),
- view->GetParent()->GetBounds(
- views::View::APPLY_MIRRORING_TRANSFORMATION).x() + bounds.x(),
- bounds.y(), 0, 0, view->width(), view->height());
+ background_origin.x(), background_origin.y(), 0, 0,
+ view->width(), view->height());
}
// static
@@ -57,9 +55,10 @@
DetachableToolbarView* view) {
// Border can be at the top or at the bottom of the view depending on whether
// the view (bar/shelf) is attached or detached.
- int y = !view->IsDetached() ? view->height() - 1 : 0;
+ int thickness = views::NonClientFrameView::kClientEdgeThickness;
+ int y = view->IsDetached() ? 0 : (view->height() - thickness);
canvas->FillRectInt(ResourceBundle::toolbar_separator_color,
- 0, y, view->width(), 1);
+ 0, y, view->width(), thickness);
}
// static
« no previous file with comments | « chrome/browser/views/detachable_toolbar_view.h ('k') | chrome/browser/views/dropdown_bar_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698