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

Unified Diff: chrome/browser/ui/cocoa/status_bubble_mac.mm

Issue 1917973002: mac: Remove IsOSLion(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/status_bubble_mac.mm
diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm
index a688b6d21ea04721df6d6b43e61e317c7cb138e0..c4bcd3ee9a1b2611bd37faf8db4b219eaf70c157 100644
--- a/chrome/browser/ui/cocoa/status_bubble_mac.mm
+++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm
@@ -750,12 +750,11 @@ void StatusBubbleMac::ExpandBubble() {
return;
// Get the current corner flags and see what needs to change based on the
- // expansion. This is only needed on Lion, which has rounded window bottoms.
- if (base::mac::IsOSLionOrLater()) {
- unsigned long corner_flags = [[window_ contentView] cornerFlags];
- corner_flags |= OSDependentCornerFlags(actual_window_frame);
- [[window_ contentView] setCornerFlags:corner_flags];
- }
+ // expansion.
+ unsigned long corner_flags = [[window_ contentView] cornerFlags];
+ corner_flags |= OSDependentCornerFlags(actual_window_frame);
+ [[window_ contentView] setCornerFlags:corner_flags];
+
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:kExpansionDurationSeconds];
@@ -833,27 +832,25 @@ NSRect StatusBubbleMac::CalculateWindowFrame(bool expanded_width) {
unsigned long StatusBubbleMac::OSDependentCornerFlags(NSRect window_frame) {
unsigned long corner_flags = 0;
- if (base::mac::IsOSLionOrLater()) {
- NSRect parent_frame = [parent_ frame];
-
- // Round the bottom corners when they're right up against the
- // corresponding edge of the parent window, or when below the parent
- // window.
- if (NSMinY(window_frame) <= NSMinY(parent_frame)) {
- if (NSMinX(window_frame) == NSMinX(parent_frame)) {
- corner_flags |= kRoundedBottomLeftCorner;
- }
+ NSRect parent_frame = [parent_ frame];
- if (NSMaxX(window_frame) == NSMaxX(parent_frame)) {
- corner_flags |= kRoundedBottomRightCorner;
- }
+ // Round the bottom corners when they're right up against the
+ // corresponding edge of the parent window, or when below the parent
+ // window.
+ if (NSMinY(window_frame) <= NSMinY(parent_frame)) {
+ if (NSMinX(window_frame) == NSMinX(parent_frame)) {
+ corner_flags |= kRoundedBottomLeftCorner;
}
- // Round the top corners when the bubble is below the parent window.
- if (NSMinY(window_frame) < NSMinY(parent_frame)) {
- corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner;
+ if (NSMaxX(window_frame) == NSMaxX(parent_frame)) {
+ corner_flags |= kRoundedBottomRightCorner;
}
}
+ // Round the top corners when the bubble is below the parent window.
+ if (NSMinY(window_frame) < NSMinY(parent_frame)) {
+ corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner;
+ }
+
return corner_flags;
}

Powered by Google App Engine
This is Rietveld 408576698