OLD | NEW |
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_2.h" | 5 #include "ui/views/bubble/bubble_border_2.h" |
6 | 6 |
7 #include <algorithm> // for std::max | 7 #include <algorithm> // for std::max |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 arrow_height_, | 185 arrow_height_, |
186 arrow_width_); | 186 arrow_width_); |
187 } | 187 } |
188 | 188 |
189 void BubbleBorder2::SetShadow(gfx::ShadowValue shadow) { | 189 void BubbleBorder2::SetShadow(gfx::ShadowValue shadow) { |
190 shadows_.clear(); | 190 shadows_.clear(); |
191 shadows_.push_back(shadow); | 191 shadows_.push_back(shadow); |
192 } | 192 } |
193 | 193 |
194 int BubbleBorder2::GetBorderThickness() const { | 194 int BubbleBorder2::GetBorderThickness() const { |
195 return 0; | 195 return border_size_; |
196 } | 196 } |
197 | 197 |
198 void BubbleBorder2::PaintBackground(gfx::Canvas* canvas, | 198 void BubbleBorder2::PaintBackground(gfx::Canvas* canvas, |
199 const gfx::Rect& bounds) const { | 199 const gfx::Rect& bounds) const { |
200 canvas->FillRect(bounds, background_color_); | 200 canvas->FillRect(bounds, background_color_); |
201 } | 201 } |
202 | 202 |
203 int BubbleBorder2::GetArrowOffset() const { | 203 int BubbleBorder2::GetArrowOffset() const { |
204 if (has_arrow(arrow_location())) { | 204 if (has_arrow(arrow_location())) { |
205 if (is_arrow_on_horizontal(arrow_location())) { | 205 if (is_arrow_on_horizontal(arrow_location())) { |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 canvas->ClipPath(path); | 390 canvas->ClipPath(path); |
391 | 391 |
392 // Use full bounds so that arrow is also painted. | 392 // Use full bounds so that arrow is also painted. |
393 const gfx::Rect& bounds = view.bounds(); | 393 const gfx::Rect& bounds = view.bounds(); |
394 PaintBackground(canvas, bounds); | 394 PaintBackground(canvas, bounds); |
395 | 395 |
396 canvas->Restore(); | 396 canvas->Restore(); |
397 } | 397 } |
398 | 398 |
399 } // namespace views | 399 } // namespace views |
OLD | NEW |