| 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 "chrome/browser/ui/cocoa/status_bubble_mac.h" | 5 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } else { | 339 } else { |
| 340 [window_ setFrame:frame display:NO]; | 340 [window_ setFrame:frame display:NO]; |
| 341 } | 341 } |
| 342 | 342 |
| 343 [status_text_ release]; | 343 [status_text_ release]; |
| 344 status_text_ = nil; | 344 status_text_ = nil; |
| 345 [url_text_ release]; | 345 [url_text_ release]; |
| 346 url_text_ = nil; | 346 url_text_ = nil; |
| 347 } | 347 } |
| 348 | 348 |
| 349 void StatusBubbleMac::Reposition() {} |
| 350 |
| 349 void StatusBubbleMac::SetFrameAvoidingMouse( | 351 void StatusBubbleMac::SetFrameAvoidingMouse( |
| 350 NSRect window_frame, const gfx::Point& mouse_pos) { | 352 NSRect window_frame, const gfx::Point& mouse_pos) { |
| 351 if (!window_) | 353 if (!window_) |
| 352 return; | 354 return; |
| 353 | 355 |
| 354 // Bubble's base rect in |parent_| (window base) coordinates. | 356 // Bubble's base rect in |parent_| (window base) coordinates. |
| 355 NSRect base_rect; | 357 NSRect base_rect; |
| 356 if ([delegate_ respondsToSelector:@selector(statusBubbleBaseFrame)]) { | 358 if ([delegate_ respondsToSelector:@selector(statusBubbleBaseFrame)]) { |
| 357 base_rect = [delegate_ statusBubbleBaseFrame]; | 359 base_rect = [delegate_ statusBubbleBaseFrame]; |
| 358 } else { | 360 } else { |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 } | 849 } |
| 848 } | 850 } |
| 849 | 851 |
| 850 // Round the top corners when the bubble is below the parent window. | 852 // Round the top corners when the bubble is below the parent window. |
| 851 if (NSMinY(window_frame) < NSMinY(parent_frame)) { | 853 if (NSMinY(window_frame) < NSMinY(parent_frame)) { |
| 852 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; | 854 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; |
| 853 } | 855 } |
| 854 | 856 |
| 855 return corner_flags; | 857 return corner_flags; |
| 856 } | 858 } |
| OLD | NEW |