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

Side by Side Diff: chrome/browser/ui/cocoa/info_bubble_window.mm

Issue 2257553002: Fix OSX 10.12 compilation errors in chrome/browser/ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved 10.12 SDK defines to one header. Created 4 years, 4 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
OLDNEW
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 #import "chrome/browser/ui/cocoa/info_bubble_window.h" 5 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #import "base/mac/foundation_util.h" 10 #import "base/mac/foundation_util.h"
11 #import "base/mac/scoped_nsobject.h" 11 #import "base/mac/scoped_nsobject.h"
12 #import "base/mac/sdk_forward_declarations.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
14 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" 15 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
15 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
17 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
18 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h " 19 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h "
19 20
20 namespace { 21 namespace {
21 const CGFloat kOrderInSlideOffset = 10; 22 const CGFloat kOrderInSlideOffset = 10;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Used for registering to receive notifications and automatic clean up. 62 // Used for registering to receive notifications and automatic clean up.
62 content::NotificationRegistrar registrar_; 63 content::NotificationRegistrar registrar_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(AppNotificationBridge); 65 DISALLOW_COPY_AND_ASSIGN(AppNotificationBridge);
65 }; 66 };
66 67
67 // A delegate object for watching the alphaValue animation on InfoBubbleWindows. 68 // A delegate object for watching the alphaValue animation on InfoBubbleWindows.
68 // An InfoBubbleWindow instance cannot be the delegate for its own animation 69 // An InfoBubbleWindow instance cannot be the delegate for its own animation
69 // because CAAnimations retain their delegates, and since the InfoBubbleWindow 70 // because CAAnimations retain their delegates, and since the InfoBubbleWindow
70 // retains its animations a retain loop would be formed. 71 // retains its animations a retain loop would be formed.
71 @interface InfoBubbleWindowCloser : NSObject { 72 @interface InfoBubbleWindowCloser : NSObject <CAAnimationDelegate> {
72 @private 73 @private
73 InfoBubbleWindow* window_; // Weak. Window to close. 74 InfoBubbleWindow* window_; // Weak. Window to close.
74 } 75 }
75 - (id)initWithWindow:(InfoBubbleWindow*)window; 76 - (id)initWithWindow:(InfoBubbleWindow*)window;
76 @end 77 @end
77 78
78 @implementation InfoBubbleWindowCloser 79 @implementation InfoBubbleWindowCloser
79 80
80 - (id)initWithWindow:(InfoBubbleWindow*)window { 81 - (id)initWithWindow:(InfoBubbleWindow*)window {
81 if ((self = [super init])) { 82 if ((self = [super init])) {
82 window_ = window; 83 window_ = window;
83 } 84 }
84 return self; 85 return self;
85 } 86 }
86 87
88 - (void)animationDidStart:(CAAnimation*)theAnimation {
89 // CAAnimationDelegate method added on OSX 10.12.
90 }
91
87 // Callback for the alpha animation. Closes window_ if appropriate. 92 // Callback for the alpha animation. Closes window_ if appropriate.
88 - (void)animationDidStop:(CAAnimation*)anim finished:(BOOL)flag { 93 - (void)animationDidStop:(CAAnimation*)anim finished:(BOOL)flag {
89 // When alpha reaches zero, close window_. 94 // When alpha reaches zero, close window_.
90 if ([window_ alphaValue] == 0.0) { 95 if ([window_ alphaValue] == 0.0) {
91 [window_ finishCloseAfterAnimation]; 96 [window_ finishCloseAfterAnimation];
92 } 97 }
93 } 98 }
94 99
95 @end 100 @end
96 101
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 259
255 // Override -[NSWindow addChildWindow] to prevent ShareKit bugs propagating 260 // Override -[NSWindow addChildWindow] to prevent ShareKit bugs propagating
256 // to the browser window. See http://crbug.com/475855. 261 // to the browser window. See http://crbug.com/475855.
257 - (void)addChildWindow:(NSWindow*)childWindow 262 - (void)addChildWindow:(NSWindow*)childWindow
258 ordered:(NSWindowOrderingMode)orderingMode { 263 ordered:(NSWindowOrderingMode)orderingMode {
259 [[self parentWindow] removeChildWindow:self]; 264 [[self parentWindow] removeChildWindow:self];
260 [super addChildWindow:childWindow ordered:orderingMode]; 265 [super addChildWindow:childWindow ordered:orderingMode];
261 } 266 }
262 267
263 @end 268 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm ('k') | chrome/browser/ui/cocoa/spinner_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698