| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/bubble/border_contents_view.h" | 5 #include "views/bubble/border_contents_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/gfx/screen.h" | 9 #include "ui/gfx/screen.h" |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 BorderContentsView::~BorderContentsView() {} | 71 BorderContentsView::~BorderContentsView() {} |
| 72 | 72 |
| 73 void BorderContentsView::Init() { | 73 void BorderContentsView::Init() { |
| 74 // Default arrow location. | 74 // Default arrow location. |
| 75 BubbleBorder::ArrowLocation arrow_location = | 75 BubbleBorder::ArrowLocation arrow_location = |
| 76 BubbleBorder::TOP_LEFT; | 76 BubbleBorder::TOP_LEFT; |
| 77 if (base::i18n::IsRTL()) | 77 if (base::i18n::IsRTL()) |
| 78 arrow_location = BubbleBorder::horizontal_mirror(arrow_location); | 78 arrow_location = BubbleBorder::horizontal_mirror(arrow_location); |
| 79 DCHECK(!bubble_border_); | 79 DCHECK(!bubble_border_); |
| 80 | 80 |
| 81 bubble_border_ = new BubbleBorder(arrow_location); | 81 bubble_border_ = new BubbleBorder(arrow_location, |
| 82 views::BubbleBorder::NO_SHADOW); |
| 82 set_border(bubble_border_); | 83 set_border(bubble_border_); |
| 83 set_background(new BubbleBackground(bubble_border_)); | 84 set_background(new BubbleBackground(bubble_border_)); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void BorderContentsView::SetBackgroundColor(SkColor color) { | 87 void BorderContentsView::SetBackgroundColor(SkColor color) { |
| 87 bubble_border_->set_background_color(color); | 88 bubble_border_->set_background_color(color); |
| 88 } | 89 } |
| 89 | 90 |
| 90 void BorderContentsView::SetAlignment( | 91 void BorderContentsView::SetAlignment( |
| 91 views::BubbleBorder::BubbleAlignment alignment) { | 92 views::BubbleBorder::BubbleAlignment alignment) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 GetInsetsLength(offscreen_insets, vertical)) { | 174 GetInsetsLength(offscreen_insets, vertical)) { |
| 174 *arrow_location = original_arrow_location; | 175 *arrow_location = original_arrow_location; |
| 175 bubble_border_->set_arrow_location(*arrow_location); | 176 bubble_border_->set_arrow_location(*arrow_location); |
| 176 *window_bounds = bubble_border_->GetBounds(position_relative_to, | 177 *window_bounds = bubble_border_->GetBounds(position_relative_to, |
| 177 local_contents_size); | 178 local_contents_size); |
| 178 } | 179 } |
| 179 } | 180 } |
| 180 } | 181 } |
| 181 | 182 |
| 182 } // namespace views | 183 } // namespace views |
| OLD | NEW |