| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "device/vr/android/gvr/gvr_device.h" | 5 #include "device/vr/android/gvr/gvr_device.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 delegate_->UpdateWebVRTextureBounds(left_gvr_bounds, right_gvr_bounds); | 238 delegate_->UpdateWebVRTextureBounds(left_gvr_bounds, right_gvr_bounds); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void GvrDevice::SetDelegate(const base::WeakPtr<GvrDelegate>& delegate) { | 241 void GvrDevice::SetDelegate(const base::WeakPtr<GvrDelegate>& delegate) { |
| 242 delegate_ = delegate; | 242 delegate_ = delegate; |
| 243 | 243 |
| 244 // Notify the clients that this device has changed | 244 // Notify the clients that this device has changed |
| 245 if (delegate_) { | 245 if (delegate_) { |
| 246 delegate_->SetWebVRSecureOrigin(secure_origin_); | 246 delegate_->SetWebVRSecureOrigin(secure_origin_); |
| 247 OnDisplayChanged(); | 247 OnChanged(); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 gvr::GvrApi* GvrDevice::GetGvrApi() { | 251 gvr::GvrApi* GvrDevice::GetGvrApi() { |
| 252 if (!delegate_) | 252 if (!delegate_) |
| 253 return nullptr; | 253 return nullptr; |
| 254 | 254 |
| 255 return delegate_->gvr_api(); | 255 return delegate_->gvr_api(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace device | 258 } // namespace device |
| OLD | NEW |