| 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_frame_view.h" | 5 #include "ui/views/bubble/bubble_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 content_margins_.top(), 0)); | 400 content_margins_.top(), 0)); |
| 401 footnote_container_->set_background( | 401 footnote_container_->set_background( |
| 402 Background::CreateSolidBackground(kFootnoteBackgroundColor)); | 402 Background::CreateSolidBackground(kFootnoteBackgroundColor)); |
| 403 footnote_container_->SetBorder( | 403 footnote_container_->SetBorder( |
| 404 CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor)); | 404 CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor)); |
| 405 footnote_container_->AddChildView(view); | 405 footnote_container_->AddChildView(view); |
| 406 AddChildView(footnote_container_); | 406 AddChildView(footnote_container_); |
| 407 } | 407 } |
| 408 | 408 |
| 409 gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, | 409 gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, |
| 410 gfx::Size client_size, | 410 const gfx::Size& client_size, |
| 411 bool adjust_if_offscreen) { | 411 bool adjust_if_offscreen) { |
| 412 gfx::Size size(GetSizeForClientSize(client_size)); | 412 gfx::Size size(GetSizeForClientSize(client_size)); |
| 413 | 413 |
| 414 const BubbleBorder::Arrow arrow = bubble_border_->arrow(); | 414 const BubbleBorder::Arrow arrow = bubble_border_->arrow(); |
| 415 if (adjust_if_offscreen && BubbleBorder::has_arrow(arrow)) { | 415 if (adjust_if_offscreen && BubbleBorder::has_arrow(arrow)) { |
| 416 // Try to mirror the anchoring if the bubble does not fit on the screen. | 416 // Try to mirror the anchoring if the bubble does not fit on the screen. |
| 417 if (!bubble_border_->is_arrow_at_center(arrow)) { | 417 if (!bubble_border_->is_arrow_at_center(arrow)) { |
| 418 MirrorArrowIfOffScreen(true, anchor_rect, size); | 418 MirrorArrowIfOffScreen(true, anchor_rect, size); |
| 419 MirrorArrowIfOffScreen(false, anchor_rect, size); | 419 MirrorArrowIfOffScreen(false, anchor_rect, size); |
| 420 } else { | 420 } else { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 size.Enlarge(client_insets.width(), client_insets.height()); | 528 size.Enlarge(client_insets.width(), client_insets.height()); |
| 529 size.SetToMax(gfx::Size(title_bar_width, 0)); | 529 size.SetToMax(gfx::Size(title_bar_width, 0)); |
| 530 | 530 |
| 531 if (footnote_container_) | 531 if (footnote_container_) |
| 532 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); | 532 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); |
| 533 | 533 |
| 534 return size; | 534 return size; |
| 535 } | 535 } |
| 536 | 536 |
| 537 } // namespace views | 537 } // namespace views |
| OLD | NEW |