OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "remoting/host/continue_window.h" | 5 #include "remoting/host/continue_window.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 [[ContinueWindowMacController alloc] initWithHost:host | 60 [[ContinueWindowMacController alloc] initWithHost:host |
61 callback:callback]); | 61 callback:callback]); |
62 [controller_ show]; | 62 [controller_ show]; |
63 } | 63 } |
64 | 64 |
65 void ContinueWindowMac::Hide() { | 65 void ContinueWindowMac::Hide() { |
66 base::mac::ScopedNSAutoreleasePool pool; | 66 base::mac::ScopedNSAutoreleasePool pool; |
67 [controller_ hide]; | 67 [controller_ hide]; |
68 } | 68 } |
69 | 69 |
70 ContinueWindow* ContinueWindow::Create() { | 70 scoped_ptr<ContinueWindow> ContinueWindow::Create() { |
71 return new ContinueWindowMac(); | 71 return scoped_ptr<ContinueWindow>(new ContinueWindowMac()); |
72 } | 72 } |
73 | 73 |
74 } // namespace remoting | 74 } // namespace remoting |
75 | 75 |
76 @implementation ContinueWindowMacController | 76 @implementation ContinueWindowMacController |
77 | 77 |
78 - (id)initWithHost:(remoting::ChromotingHost*)host | 78 - (id)initWithHost:(remoting::ChromotingHost*)host |
79 callback:(const ContinueSessionCallback&)callback { | 79 callback:(const ContinueSessionCallback&)callback { |
80 if ((self = [super init])) { | 80 if ((self = [super init])) { |
81 host_ = host; | 81 host_ = host; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 host_ = nil; | 158 host_ = nil; |
159 } | 159 } |
160 | 160 |
161 - (void)onContinue:(id)sender { | 161 - (void)onContinue:(id)sender { |
162 [self hide]; | 162 [self hide]; |
163 callback_.Run(true); | 163 callback_.Run(true); |
164 host_ = nil; | 164 host_ = nil; |
165 } | 165 } |
166 | 166 |
167 @end | 167 @end |
OLD | NEW |