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

Side by Side Diff: chrome/browser/views/bubble_border.cc

Issue 259065: Add an BubbleBorder to BrowserAction popups and fix positioning of the (Closed)
Patch Set: cleanup Created 11 years, 2 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 | « chrome/browser/views/bubble_border.h ('k') | chrome/browser/views/extensions/extension_popup.h » ('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) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "chrome/browser/views/bubble_border.h" 5 #include "chrome/browser/views/bubble_border.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/path.h" 8 #include "app/gfx/path.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 canvas->TileImageInt(*top_, tl_width, border_top, 258 canvas->TileImageInt(*top_, tl_width, border_top,
259 width - tl_width - tr_width, t_height); 259 width - tl_width - tr_width, t_height);
260 } 260 }
261 261
262 // Bottom edge, if not already drawn 262 // Bottom edge, if not already drawn
263 if (should_draw_bottom_edge) { 263 if (should_draw_bottom_edge) {
264 canvas->TileImageInt(*bottom_, bl_width, bottom, 264 canvas->TileImageInt(*bottom_, bl_width, bottom,
265 width - bl_width - br_width, b_height); 265 width - bl_width - br_width, b_height);
266 } 266 }
267 } 267 }
268
269 /////////////////////////
270
271 void BubbleBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
272 // The border of this view creates an anti-aliased round-rect region for the
273 // contents, which we need to fill with the background color.
274 SkPaint paint;
275 paint.setAntiAlias(true);
276 paint.setStyle(SkPaint::kFill_Style);
277 paint.setColor(border_->background_color());
278 gfx::Path path;
279 gfx::Rect bounds(view->GetLocalBounds(false));
280 SkRect rect;
281 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()),
282 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
283 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius());
284 path.addRoundRect(rect, radius, radius);
285 canvas->drawPath(path, paint);
286 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bubble_border.h ('k') | chrome/browser/views/extensions/extension_popup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698