| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 | 365 |
| 366 // Calculate the bounds with the arrow in its updated location and offset. | 366 // Calculate the bounds with the arrow in its updated location and offset. |
| 367 return bubble_border_->GetBounds(anchor_rect, size); | 367 return bubble_border_->GetBounds(anchor_rect, size); |
| 368 } | 368 } |
| 369 | 369 |
| 370 gfx::Rect BubbleFrameView::GetAvailableScreenBounds( | 370 gfx::Rect BubbleFrameView::GetAvailableScreenBounds( |
| 371 const gfx::Rect& rect) const { | 371 const gfx::Rect& rect) const { |
| 372 // The bubble attempts to fit within the current screen bounds. | 372 // The bubble attempts to fit within the current screen bounds. |
| 373 // TODO(scottmg): Native is wrong. http://crbug.com/133312 | 373 return gfx::Screen::GetScreen() |
| 374 return gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint( | 374 ->GetDisplayNearestPoint(rect.CenterPoint()) |
| 375 rect.CenterPoint()).work_area(); | 375 .work_area(); |
| 376 } | 376 } |
| 377 | 377 |
| 378 bool BubbleFrameView::IsCloseButtonVisible() const { | 378 bool BubbleFrameView::IsCloseButtonVisible() const { |
| 379 return close_->visible(); | 379 return close_->visible(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 gfx::Rect BubbleFrameView::GetCloseButtonMirroredBounds() const { | 382 gfx::Rect BubbleFrameView::GetCloseButtonMirroredBounds() const { |
| 383 return close_->GetMirroredBounds(); | 383 return close_->GetMirroredBounds(); |
| 384 } | 384 } |
| 385 | 385 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 if (titlebar_extra_view_ != NULL) | 467 if (titlebar_extra_view_ != NULL) |
| 468 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); | 468 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); |
| 469 gfx::Size size(client_size); | 469 gfx::Size size(client_size); |
| 470 size.SetToMax(gfx::Size(title_bar_width, 0)); | 470 size.SetToMax(gfx::Size(title_bar_width, 0)); |
| 471 const gfx::Insets insets(GetInsets()); | 471 const gfx::Insets insets(GetInsets()); |
| 472 size.Enlarge(insets.width(), insets.height()); | 472 size.Enlarge(insets.width(), insets.height()); |
| 473 return size; | 473 return size; |
| 474 } | 474 } |
| 475 | 475 |
| 476 } // namespace views | 476 } // namespace views |
| OLD | NEW |