| 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 "chrome/browser/android/vr_shell/ui_scene.h" | 5 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 elements.push_back(element.get()); | 168 elements.push_back(element.get()); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 return elements; | 171 return elements; |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool UiScene::HasVisibleHeadLockedElements() const { | 174 bool UiScene::HasVisibleHeadLockedElements() const { |
| 175 return !GetHeadLockedElements().empty(); | 175 return !GetHeadLockedElements().empty(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void UiScene::SetBackgroundColor(const SkColor& color) { | 178 void UiScene::SetMode(ColorScheme::Mode mode) { |
| 179 background_color_ = color; | 179 if (mode == mode_) |
| 180 return; |
| 181 |
| 182 mode_ = mode; |
| 183 for (const auto& element : ui_elements_) |
| 184 element->SetMode(mode); |
| 180 } | 185 } |
| 181 | 186 |
| 182 const SkColor& UiScene::GetBackgroundColor() const { | 187 ColorScheme::Mode UiScene::mode() const { |
| 183 return background_color_; | 188 return mode_; |
| 189 } |
| 190 |
| 191 SkColor UiScene::GetBackgroundColor() const { |
| 192 return ColorScheme::GetColorScheme(mode_).horizon; |
| 184 } | 193 } |
| 185 | 194 |
| 186 void UiScene::SetBackgroundDistance(float distance) { | 195 void UiScene::SetBackgroundDistance(float distance) { |
| 187 background_distance_ = distance; | 196 background_distance_ = distance; |
| 188 } | 197 } |
| 189 | 198 |
| 190 float UiScene::GetBackgroundDistance() const { | 199 float UiScene::GetBackgroundDistance() const { |
| 191 return background_distance_; | 200 return background_distance_; |
| 192 } | 201 } |
| 193 | 202 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 262 |
| 254 // TODO(mthiesse): Move this to UiSceneManager. | 263 // TODO(mthiesse): Move this to UiSceneManager. |
| 255 void UiScene::OnGLInitialized() { | 264 void UiScene::OnGLInitialized() { |
| 256 gl_initialized_ = true; | 265 gl_initialized_ = true; |
| 257 for (auto& element : ui_elements_) { | 266 for (auto& element : ui_elements_) { |
| 258 element->Initialize(); | 267 element->Initialize(); |
| 259 } | 268 } |
| 260 } | 269 } |
| 261 | 270 |
| 262 } // namespace vr_shell | 271 } // namespace vr_shell |
| OLD | NEW |