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

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements/ui_element.h

Issue 2911943002: [vr] Add incognito coloring (Closed)
Patch Set: Created 3 years, 6 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 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/android/vr_shell/color_scheme.h"
13 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" 14 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h"
14 #include "device/vr/vr_types.h" 15 #include "device/vr/vr_types.h"
15 #include "third_party/skia/include/core/SkColor.h" 16 #include "third_party/skia/include/core/SkColor.h"
16 17
17 namespace base { 18 namespace base {
18 class TimeTicks; 19 class TimeTicks;
19 } 20 }
20 21
21 namespace vr_shell { 22 namespace vr_shell {
22 23
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void set_dirty(bool dirty) { dirty_ = dirty; } 237 void set_dirty(bool dirty) { dirty_ = dirty; }
237 238
238 // A flag usable during transformation calculates to avoid duplicate work. 239 // A flag usable during transformation calculates to avoid duplicate work.
239 UiElementDebugId debug_id() const { return debug_id_; } 240 UiElementDebugId debug_id() const { return debug_id_; }
240 void set_debug_id(UiElementDebugId debug_id) { debug_id_ = debug_id; } 241 void set_debug_id(UiElementDebugId debug_id) { debug_id_ = debug_id; }
241 242
242 // By default, sets an element to be visible or not. This may be overridden to 243 // By default, sets an element to be visible or not. This may be overridden to
243 // allow finer control of element visibility. 244 // allow finer control of element visibility.
244 virtual void SetEnabled(bool enabled); 245 virtual void SetEnabled(bool enabled);
245 246
247 void SetMode(ColorScheme::Mode mode);
248 ColorScheme::Mode mode() const { return mode_; }
249
250 protected:
251 virtual void OnSetMode();
252
246 private: 253 private:
247 // Valid IDs are non-negative. 254 // Valid IDs are non-negative.
248 int id_ = -1; 255 int id_ = -1;
249 256
250 // If a non-negative parent ID is specified, applicable transformations 257 // If a non-negative parent ID is specified, applicable transformations
251 // are applied relative to the parent, rather than absolutely. 258 // are applied relative to the parent, rather than absolutely.
252 int parent_id_ = -1; 259 int parent_id_ = -1;
253 260
254 // If true, this object will be visible. 261 // If true, this object will be visible.
255 bool visible_ = false; 262 bool visible_ = false;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 Transform inheritable_transform_; 316 Transform inheritable_transform_;
310 317
311 // A flag usable during transformation calculates to avoid duplicate work. 318 // A flag usable during transformation calculates to avoid duplicate work.
312 bool dirty_ = false; 319 bool dirty_ = false;
313 320
314 // An identifier used for testing and debugging, in lieu of a string. 321 // An identifier used for testing and debugging, in lieu of a string.
315 UiElementDebugId debug_id_ = UiElementDebugId::kNone; 322 UiElementDebugId debug_id_ = UiElementDebugId::kNone;
316 323
317 Transform transform_; 324 Transform transform_;
318 325
326 ColorScheme::Mode mode_ = ColorScheme::kModeNormal;
327
319 DISALLOW_COPY_AND_ASSIGN(UiElement); 328 DISALLOW_COPY_AND_ASSIGN(UiElement);
320 }; 329 };
321 330
322 } // namespace vr_shell 331 } // namespace vr_shell
323 332
324 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 333 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698