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

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements/exclusive_screen_toast.cc

Issue 2957173002: Update toast behavior and apperance according to UX requirement (Closed)
Patch Set: Set size to DMM. Scale will be used to correctly scale the toast Created 3 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/android/vr_shell/ui_elements/exclusive_screen_toast.h"
6
7 #include "chrome/browser/android/vr_shell/textures/ui_texture.h"
8 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h"
9
10 namespace vr_shell {
11
12 ExclusiveScreenToast::ExclusiveScreenToast(int preferred_width)
13 : SimpleTexturedElement(preferred_width) {}
14
15 ExclusiveScreenToast::~ExclusiveScreenToast() = default;
16
17 void ExclusiveScreenToast::UpdateElementSize() {
18 // Adjust the width of this element according to the texture. The width is
19 // decided by the length of the text to show.
20 gfx::SizeF drawn_size = GetTexture()->GetDrawnSize();
21 float x = drawn_size.width() / drawn_size.height() * size().y();
cjgrant 2017/06/28 13:55:34 s/x/width/ ? 'x' generally sounds like a position
bshe 2017/06/28 20:01:58 Done.
22 set_size({x, size().y(), 1});
23 }
24
25 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698