| 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 #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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Overridden from content::NotificationObserver. | 44 // Overridden from content::NotificationObserver. |
| 45 void Observe(int type, | 45 void Observe(int type, |
| 46 const content::NotificationSource& source, | 46 const content::NotificationSource& source, |
| 47 const content::NotificationDetails& details) override { | 47 const content::NotificationDetails& details) override { |
| 48 switch (type) { | 48 switch (type) { |
| 49 case chrome::NOTIFICATION_APP_TERMINATING: | 49 case chrome::NOTIFICATION_APP_TERMINATING: |
| 50 [owner_ appIsTerminating]; | 50 [owner_ appIsTerminating]; |
| 51 break; | 51 break; |
| 52 default: | 52 default: |
| 53 NOTREACHED() << L"Unexpected notification"; | 53 NOTREACHED() << "Unexpected notification"; |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 // The object we need to inform when we get a notification. Weak. Owns us. | 58 // The object we need to inform when we get a notification. Weak. Owns us. |
| 59 InfoBubbleWindow* owner_; | 59 InfoBubbleWindow* owner_; |
| 60 | 60 |
| 61 // Used for registering to receive notifications and automatic clean up. | 61 // Used for registering to receive notifications and automatic clean up. |
| 62 content::NotificationRegistrar registrar_; | 62 content::NotificationRegistrar registrar_; |
| 63 | 63 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 // Override -[NSWindow addChildWindow] to prevent ShareKit bugs propagating | 255 // Override -[NSWindow addChildWindow] to prevent ShareKit bugs propagating |
| 256 // to the browser window. See http://crbug.com/475855. | 256 // to the browser window. See http://crbug.com/475855. |
| 257 - (void)addChildWindow:(NSWindow*)childWindow | 257 - (void)addChildWindow:(NSWindow*)childWindow |
| 258 ordered:(NSWindowOrderingMode)orderingMode { | 258 ordered:(NSWindowOrderingMode)orderingMode { |
| 259 [[self parentWindow] removeChildWindow:self]; | 259 [[self parentWindow] removeChildWindow:self]; |
| 260 [super addChildWindow:childWindow ordered:orderingMode]; | 260 [super addChildWindow:childWindow ordered:orderingMode]; |
| 261 } | 261 } |
| 262 | 262 |
| 263 @end | 263 @end |
| OLD | NEW |