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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene_manager.cc

Issue 2891503002: VR: UiElement for Screen Capture indicator (Closed)
Patch Set: rebase 2 Created 3 years, 7 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 | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | components/vector_icons/BUILD.gn » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_manager.h" 5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" 9 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h"
10 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" 10 #include "chrome/browser/android/vr_shell/textures/ui_texture.h"
11 #include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h" 11 #include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h"
12 #include "chrome/browser/android/vr_shell/ui_elements/button.h" 12 #include "chrome/browser/android/vr_shell/ui_elements/button.h"
13 #include "chrome/browser/android/vr_shell/ui_elements/exit_warning.h" 13 #include "chrome/browser/android/vr_shell/ui_elements/exit_warning.h"
14 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h" 14 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h"
15 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning .h" 15 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning .h"
16 #include "chrome/browser/android/vr_shell/ui_elements/screen_capture_indicator.h "
16 #include "chrome/browser/android/vr_shell/ui_elements/screen_dimmer.h" 17 #include "chrome/browser/android/vr_shell/ui_elements/screen_dimmer.h"
17 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning .h" 18 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning .h"
18 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" 19 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h"
19 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" 20 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h"
20 #include "chrome/browser/android/vr_shell/ui_elements/video_capture_indicator.h" 21 #include "chrome/browser/android/vr_shell/ui_elements/video_capture_indicator.h"
21 #include "chrome/browser/android/vr_shell/ui_scene.h" 22 #include "chrome/browser/android/vr_shell/ui_scene.h"
22 #include "chrome/browser/android/vr_shell/vr_browser_interface.h" 23 #include "chrome/browser/android/vr_shell/vr_browser_interface.h"
23 #include "chrome/browser/android/vr_shell/vr_shell.h" 24 #include "chrome/browser/android/vr_shell/vr_shell.h"
24 25
25 namespace vr_shell { 26 namespace vr_shell {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 scene_->AddUiElement(std::move(element)); 153 scene_->AddUiElement(std::move(element));
153 } 154 }
154 155
155 void UiSceneManager::CreateSystemIndicators() { 156 void UiSceneManager::CreateSystemIndicators() {
156 std::unique_ptr<UiElement> element; 157 std::unique_ptr<UiElement> element;
157 158
158 // TODO(acondor): Make constants for sizes and positions once the UX for the 159 // TODO(acondor): Make constants for sizes and positions once the UX for the
159 // indicators is defined. 160 // indicators is defined.
160 element = base::MakeUnique<AudioCaptureIndicator>(512); 161 element = base::MakeUnique<AudioCaptureIndicator>(512);
161 element->set_id(AllocateId()); 162 element->set_id(AllocateId());
162 element->set_translation({-0.3, 0.8, -1.9}); 163 element->set_translation({-0.3, 0.8, -kContentDistance + 0.1});
163 element->set_size({0.5, 0, 1}); 164 element->set_size({0.5, 0, 1});
164 element->set_visible(false); 165 element->set_visible(false);
165 audio_capture_indicator_ = element.get(); 166 audio_capture_indicator_ = element.get();
166 scene_->AddUiElement(std::move(element)); 167 scene_->AddUiElement(std::move(element));
167 168
168 element = base::MakeUnique<VideoCaptureIndicator>(512); 169 element = base::MakeUnique<VideoCaptureIndicator>(512);
169 element->set_id(AllocateId()); 170 element->set_id(AllocateId());
170 element->set_translation({0.3, 0.8, -1.9}); 171 element->set_translation({0.3, 0.8, -kContentDistance + 0.1});
171 element->set_size({0.5, 0, 1}); 172 element->set_size({0.5, 0, 1});
172 element->set_visible(false); 173 element->set_visible(false);
173 video_capture_indicator_ = element.get(); 174 video_capture_indicator_ = element.get();
174 scene_->AddUiElement(std::move(element)); 175 scene_->AddUiElement(std::move(element));
176
177 element = base::MakeUnique<ScreenCaptureIndicator>(512);
178 element->set_id(AllocateId());
179 element->set_translation({0.0, 0.65, -kContentDistance + 0.1});
180 element->set_size({0.4, 0, 1});
181 element->set_visible(false);
182 screen_capture_indicator_ = element.get();
183 scene_->AddUiElement(std::move(element));
175 } 184 }
176 185
177 void UiSceneManager::CreateContentQuad() { 186 void UiSceneManager::CreateContentQuad() {
178 std::unique_ptr<UiElement> element; 187 std::unique_ptr<UiElement> element;
179 188
180 element = base::MakeUnique<UiElement>(); 189 element = base::MakeUnique<UiElement>();
181 element->set_id(AllocateId()); 190 element->set_id(AllocateId());
182 element->set_fill(vr_shell::Fill::CONTENT); 191 element->set_fill(vr_shell::Fill::CONTENT);
183 element->set_size({kContentWidth, kContentHeight, 1}); 192 element->set_size({kContentWidth, kContentHeight, 1});
184 element->set_translation({0, kContentVerticalOffset, -kContentDistance}); 193 element->set_translation({0, kContentVerticalOffset, -kContentDistance});
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, 424 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back,
416 bool can_go_forward) {} 425 bool can_go_forward) {}
417 426
418 void UiSceneManager::OnCloseButtonClicked() {} 427 void UiSceneManager::OnCloseButtonClicked() {}
419 428
420 int UiSceneManager::AllocateId() { 429 int UiSceneManager::AllocateId() {
421 return next_available_id_++; 430 return next_available_id_++;
422 } 431 }
423 432
424 } // namespace vr_shell 433 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | components/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698