Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: remoting/host/desktop_resizer_mac.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/host/desktop_resizer.h ('k') | remoting/host/desktop_resizer_ozone.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/desktop_resizer.h" 5 #include "remoting/host/desktop_resizer.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
11 #include "base/mac/mac_util.h" 11 #include "base/mac/mac_util.h"
12 #include "base/mac/scoped_cftyperef.h" 12 #include "base/mac/scoped_cftyperef.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ptr_util.h"
14 #include "remoting/base/logging.h" 15 #include "remoting/base/logging.h"
15 16
16 namespace { 17 namespace {
17 // TODO(jamiewalch): Use the correct DPI for the mode: http://crbug.com/172405. 18 // TODO(jamiewalch): Use the correct DPI for the mode: http://crbug.com/172405.
18 const int kDefaultDPI = 96; 19 const int kDefaultDPI = 96;
19 } // namespace 20 } // namespace
20 21
21 namespace remoting { 22 namespace remoting {
22 23
23 class DesktopResizerMac : public DesktopResizer { 24 class DesktopResizerMac : public DesktopResizer {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 uint32_t num_displays; 161 uint32_t num_displays;
161 CGError err = CGGetActiveDisplayList(arraysize(displays), 162 CGError err = CGGetActiveDisplayList(arraysize(displays),
162 displays, &num_displays); 163 displays, &num_displays);
163 if (err != kCGErrorSuccess || num_displays != 1) { 164 if (err != kCGErrorSuccess || num_displays != 1) {
164 return false; 165 return false;
165 } 166 }
166 *display = displays[0]; 167 *display = displays[0];
167 return true; 168 return true;
168 } 169 }
169 170
170 scoped_ptr<DesktopResizer> DesktopResizer::Create() { 171 std::unique_ptr<DesktopResizer> DesktopResizer::Create() {
171 return make_scoped_ptr(new DesktopResizerMac); 172 return base::WrapUnique(new DesktopResizerMac);
172 } 173 }
173 174
174 } // namespace remoting 175 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_resizer.h ('k') | remoting/host/desktop_resizer_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698