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 #include "remoting/host/continue_window.h" |
| 6 |
5 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
6 | 8 |
7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include "base/mac/scoped_nsautorelease_pool.h" | 11 #include "base/mac/scoped_nsautorelease_pool.h" |
10 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" |
12 #include "base/strings/sys_string_conversions.h" | 15 #include "base/strings/sys_string_conversions.h" |
13 #include "remoting/base/string_resources.h" | 16 #include "remoting/base/string_resources.h" |
14 #include "remoting/host/continue_window.h" | |
15 #include "ui/base/l10n/l10n_util_mac.h" | 17 #include "ui/base/l10n/l10n_util_mac.h" |
16 | 18 |
17 // Handles the ContinueWindow. | 19 // Handles the ContinueWindow. |
18 @interface ContinueWindowMacController : NSObject { | 20 @interface ContinueWindowMacController : NSObject { |
19 @private | 21 @private |
20 base::scoped_nsobject<NSMutableArray> shades_; | 22 base::scoped_nsobject<NSMutableArray> shades_; |
21 base::scoped_nsobject<NSAlert> continue_alert_; | 23 base::scoped_nsobject<NSAlert> continue_alert_; |
22 remoting::ContinueWindow* continue_window_; | 24 remoting::ContinueWindow* continue_window_; |
23 } | 25 } |
24 | 26 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 68 } |
67 | 69 |
68 void ContinueWindowMac::HideUi() { | 70 void ContinueWindowMac::HideUi() { |
69 DCHECK(CalledOnValidThread()); | 71 DCHECK(CalledOnValidThread()); |
70 | 72 |
71 base::mac::ScopedNSAutoreleasePool pool; | 73 base::mac::ScopedNSAutoreleasePool pool; |
72 [controller_ hide]; | 74 [controller_ hide]; |
73 } | 75 } |
74 | 76 |
75 // static | 77 // static |
76 scoped_ptr<HostWindow> HostWindow::CreateContinueWindow() { | 78 std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { |
77 return make_scoped_ptr(new ContinueWindowMac()); | 79 return base::WrapUnique(new ContinueWindowMac()); |
78 } | 80 } |
79 | 81 |
80 } // namespace remoting | 82 } // namespace remoting |
81 | 83 |
82 @implementation ContinueWindowMacController | 84 @implementation ContinueWindowMacController |
83 | 85 |
84 - (id)initWithWindow:(remoting::ContinueWindow*)continue_window { | 86 - (id)initWithWindow:(remoting::ContinueWindow*)continue_window { |
85 if ((self = [super init])) { | 87 if ((self = [super init])) { |
86 continue_window_ = continue_window; | 88 continue_window_ = continue_window; |
87 } | 89 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 [self hide]; | 158 [self hide]; |
157 continue_window_->DisconnectSession(); | 159 continue_window_->DisconnectSession(); |
158 } | 160 } |
159 | 161 |
160 - (void)onContinue:(id)sender { | 162 - (void)onContinue:(id)sender { |
161 [self hide]; | 163 [self hide]; |
162 continue_window_->ContinueSession(); | 164 continue_window_->ContinueSession(); |
163 } | 165 } |
164 | 166 |
165 @end | 167 @end |
OLD | NEW |