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

Side by Side Diff: ui/views/bubble/bubble_border.cc

Issue 2637383003: Change Painter factory functions to unique_ptr (Closed)
Patch Set: msw review Created 3 years, 11 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 | « ui/views/background.cc ('k') | ui/views/controls/button/label_button_border.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) 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 "ui/views/bubble/bubble_border.h" 5 #include "ui/views/bubble/bubble_border.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 24 matching lines...) Expand all
35 int corner_radius) 35 int corner_radius)
36 : border_thickness(border_interior_thickness), 36 : border_thickness(border_interior_thickness),
37 border_interior_thickness(border_interior_thickness), 37 border_interior_thickness(border_interior_thickness),
38 arrow_thickness(arrow_interior_thickness), 38 arrow_thickness(arrow_interior_thickness),
39 arrow_interior_thickness(arrow_interior_thickness), 39 arrow_interior_thickness(arrow_interior_thickness),
40 arrow_width(2 * arrow_interior_thickness), 40 arrow_width(2 * arrow_interior_thickness),
41 corner_radius(corner_radius) { 41 corner_radius(corner_radius) {
42 if (!border_image_ids) 42 if (!border_image_ids)
43 return; 43 return;
44 44
45 border_painter.reset(Painter::CreateImageGridPainter(border_image_ids)); 45 border_painter = Painter::CreateImageGridPainter(border_image_ids);
46 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 46 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
47 border_thickness = rb.GetImageSkiaNamed(border_image_ids[0])->width(); 47 border_thickness = rb.GetImageSkiaNamed(border_image_ids[0])->width();
48 48
49 if (arrow_image_ids[0] != 0) { 49 if (arrow_image_ids[0] != 0) {
50 left_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[0]); 50 left_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[0]);
51 top_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[1]); 51 top_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[1]);
52 right_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[2]); 52 right_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[2]);
53 bottom_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[3]); 53 bottom_arrow = *rb.GetImageSkiaNamed(arrow_image_ids[3]);
54 arrow_width = top_arrow.width(); 54 arrow_width = top_arrow.width();
55 arrow_thickness = top_arrow.height(); 55 arrow_thickness = top_arrow.height();
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 paint.setStyle(SkPaint::kFill_Style); 575 paint.setStyle(SkPaint::kFill_Style);
576 paint.setColor(border_->background_color()); 576 paint.setColor(border_->background_color());
577 SkPath path; 577 SkPath path;
578 gfx::RectF bounds(view->GetLocalBounds()); 578 gfx::RectF bounds(view->GetLocalBounds());
579 bounds.Inset(gfx::InsetsF(border_->GetInsets())); 579 bounds.Inset(gfx::InsetsF(border_->GetInsets()));
580 580
581 canvas->DrawRoundRect(bounds, border_->GetBorderCornerRadius(), paint); 581 canvas->DrawRoundRect(bounds, border_->GetBorderCornerRadius(), paint);
582 } 582 }
583 583
584 } // namespace views 584 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/background.cc ('k') | ui/views/controls/button/label_button_border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698