| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 public: | 34 public: |
| 35 explicit AppNotificationBridge(InfoBubbleWindow* owner) : owner_(owner) { | 35 explicit AppNotificationBridge(InfoBubbleWindow* owner) : owner_(owner) { |
| 36 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, | 36 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, |
| 37 content::NotificationService::AllSources()); | 37 content::NotificationService::AllSources()); |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Overridden from content::NotificationObserver. | 40 // Overridden from content::NotificationObserver. |
| 41 virtual void Observe( | 41 virtual void Observe( |
| 42 int type, | 42 int type, |
| 43 const content::NotificationSource& source, | 43 const content::NotificationSource& source, |
| 44 const content::NotificationDetails& details) OVERRIDE { | 44 const content::NotificationDetails& details) override { |
| 45 switch (type) { | 45 switch (type) { |
| 46 case chrome::NOTIFICATION_APP_TERMINATING: | 46 case chrome::NOTIFICATION_APP_TERMINATING: |
| 47 [owner_ appIsTerminating]; | 47 [owner_ appIsTerminating]; |
| 48 break; | 48 break; |
| 49 default: | 49 default: |
| 50 NOTREACHED() << L"Unexpected notification"; | 50 NOTREACHED() << L"Unexpected notification"; |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 private: |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 - (void)sendEvent:(NSEvent*)theEvent { | 228 - (void)sendEvent:(NSEvent*)theEvent { |
| 229 if (!closing_) | 229 if (!closing_) |
| 230 [super sendEvent:theEvent]; | 230 [super sendEvent:theEvent]; |
| 231 } | 231 } |
| 232 | 232 |
| 233 - (BOOL)isClosing { | 233 - (BOOL)isClosing { |
| 234 return closing_; | 234 return closing_; |
| 235 } | 235 } |
| 236 | 236 |
| 237 @end | 237 @end |
| OLD | NEW |