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

Side by Side Diff: remoting/host/resizing_host_observer.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
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/resizing_host_observer.h" 5 #include "remoting/host/resizing_host_observer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <list> 9 #include <list>
10 #include <utility> 10 #include <utility>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 private: 112 private:
113 float client_scale_factor_; 113 float client_scale_factor_;
114 float aspect_ratio_goodness_; 114 float aspect_ratio_goodness_;
115 ScreenResolution resolution_; 115 ScreenResolution resolution_;
116 }; 116 };
117 117
118 } // namespace 118 } // namespace
119 119
120 ResizingHostObserver::ResizingHostObserver( 120 ResizingHostObserver::ResizingHostObserver(
121 scoped_ptr<DesktopResizer> desktop_resizer) 121 std::unique_ptr<DesktopResizer> desktop_resizer)
122 : desktop_resizer_(std::move(desktop_resizer)), 122 : desktop_resizer_(std::move(desktop_resizer)),
123 now_function_(base::Bind(base::Time::Now)), 123 now_function_(base::Bind(base::Time::Now)),
124 weak_factory_(this) {} 124 weak_factory_(this) {}
125 125
126 ResizingHostObserver::~ResizingHostObserver() { 126 ResizingHostObserver::~ResizingHostObserver() {
127 if (!original_resolution_.IsEmpty()) 127 if (!original_resolution_.IsEmpty())
128 desktop_resizer_->RestoreResolution(original_resolution_); 128 desktop_resizer_->RestoreResolution(original_resolution_);
129 } 129 }
130 130
131 void ResizingHostObserver::SetScreenResolution( 131 void ResizingHostObserver::SetScreenResolution(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // Update the time of last resize to allow it to be rate-limited. 179 // Update the time of last resize to allow it to be rate-limited.
180 previous_resize_time_ = now; 180 previous_resize_time_ = now;
181 } 181 }
182 182
183 void ResizingHostObserver::SetNowFunctionForTesting( 183 void ResizingHostObserver::SetNowFunctionForTesting(
184 const base::Callback<base::Time(void)>& now_function) { 184 const base::Callback<base::Time(void)>& now_function) {
185 now_function_ = now_function; 185 now_function_ = now_function;
186 } 186 }
187 187
188 } // namespace remoting 188 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/resizing_host_observer.h ('k') | remoting/host/resizing_host_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698