| 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 "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 | 8 |
| 9 #include "ui/gfx/screen.h" | 9 #include "ui/gfx/screen.h" |
| 10 #include "ui/views/bubble/bubble_border.h" | 10 #include "ui/views/bubble/bubble_border.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 if (GetOffScreenLength(monitor_rect, window_bounds, vertical) > 0) { | 110 if (GetOffScreenLength(monitor_rect, window_bounds, vertical) > 0) { |
| 111 BubbleBorder::ArrowLocation arrow = bubble_border()->arrow_location(); | 111 BubbleBorder::ArrowLocation arrow = bubble_border()->arrow_location(); |
| 112 // Mirror the arrow and get the new bounds. | 112 // Mirror the arrow and get the new bounds. |
| 113 bubble_border_->set_arrow_location( | 113 bubble_border_->set_arrow_location( |
| 114 vertical ? BubbleBorder::vertical_mirror(arrow) : | 114 vertical ? BubbleBorder::vertical_mirror(arrow) : |
| 115 BubbleBorder::horizontal_mirror(arrow)); | 115 BubbleBorder::horizontal_mirror(arrow)); |
| 116 gfx::Rect mirror_bounds = | 116 gfx::Rect mirror_bounds = |
| 117 bubble_border_->GetBounds(anchor_rect, client_size); | 117 bubble_border_->GetBounds(anchor_rect, client_size); |
| 118 // Restore the original arrow if mirroring doesn't show more of the bubble. | 118 // Restore the original arrow if mirroring doesn't show more of the bubble. |
| 119 if (GetOffScreenLength(monitor_rect, mirror_bounds, vertical) >= | 119 if (GetOffScreenLength(monitor_rect, mirror_bounds, vertical) >= |
| 120 GetOffScreenLength(monitor_rect, window_bounds, vertical)) { | 120 GetOffScreenLength(monitor_rect, window_bounds, vertical)) |
| 121 bubble_border_->set_arrow_location(arrow); | 121 bubble_border_->set_arrow_location(arrow); |
| 122 } | 122 else |
| 123 SchedulePaint(); |
| 123 } | 124 } |
| 124 } | 125 } |
| 125 | 126 |
| 126 } // namespace views | 127 } // namespace views |
| OLD | NEW |