| 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/chrome_to_mobile_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/chrome_to_mobile_service_factory.h" | 10 #include "chrome/browser/chrome_to_mobile_service_factory.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 ChromeToMobileBubbleNotificationBridge::ChromeToMobileBubbleNotificationBridge( | 33 ChromeToMobileBubbleNotificationBridge::ChromeToMobileBubbleNotificationBridge( |
| 34 ChromeToMobileBubbleController* controller, | 34 ChromeToMobileBubbleController* controller, |
| 35 SEL selector) | 35 SEL selector) |
| 36 : controller_(controller), | 36 : controller_(controller), |
| 37 selector_(selector) { | 37 selector_(selector) { |
| 38 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, | 38 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, |
| 39 content::NotificationService::AllSources()); | 39 content::NotificationService::AllSources()); |
| 40 registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED, | 40 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 41 content::NotificationService::AllSources()); | 41 content::NotificationService::AllSources()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // All observed notifications perform the same selector to close the bubble. | 44 // All observed notifications perform the same selector to close the bubble. |
| 45 void ChromeToMobileBubbleNotificationBridge::Observe( | 45 void ChromeToMobileBubbleNotificationBridge::Observe( |
| 46 int type, | 46 int type, |
| 47 const content::NotificationSource& source, | 47 const content::NotificationSource& source, |
| 48 const content::NotificationDetails& details) { | 48 const content::NotificationDetails& details) { |
| 49 [controller_ performSelector:selector_ withObject:controller_]; | 49 [controller_ performSelector:selector_ withObject:controller_]; |
| 50 } | 50 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 - (void)setSendCopy:(bool)sendCopy { | 263 - (void)setSendCopy:(bool)sendCopy { |
| 264 [sendCopy_ setState:(sendCopy ? NSOnState : NSOffState)]; | 264 [sendCopy_ setState:(sendCopy ? NSOnState : NSOffState)]; |
| 265 } | 265 } |
| 266 | 266 |
| 267 - (ChromeToMobileBubbleNotificationBridge*)bridge { | 267 - (ChromeToMobileBubbleNotificationBridge*)bridge { |
| 268 return bridge_.get(); | 268 return bridge_.get(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 @end // ChromeToMobileBubbleController (JustForTesting) | 271 @end // ChromeToMobileBubbleController (JustForTesting) |
| OLD | NEW |