Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: ui/views/bubble/bubble_frame_view.cc

Issue 10021029: Propagate OnNativeWidgetMove to delegate/observers, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use |move_loop_widget_| and GetAttachedBrowserView, etc. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698