Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "ui/compositor/layer_delegate.h" | |
| 11 #include "ui/gfx/display.h" | |
| 12 #include "ui/gfx/insets.h" | |
| 13 #include "ui/gfx/rect.h" | |
| 14 | |
| 15 namespace ui { | |
| 16 class Layer; | |
| 17 } | |
| 18 | |
| 19 namespace chromeos { | |
| 20 | |
| 21 // This is used to show the visible feedback to the user's operations for | |
| 22 // calibrating display overscan settings. | |
| 23 class OverscanCalibrator : public ui::LayerDelegate { | |
| 24 public: | |
| 25 OverscanCalibrator(const gfx::Display& target_display, | |
| 26 const gfx::Insets& initial_insets); | |
| 27 ~OverscanCalibrator(); | |
|
oshima
2012/10/19 19:36:11
virtual
Jun Mukai
2012/10/19 21:39:34
Done.
| |
| 28 | |
| 29 // Removees all visible feedback layers. | |
| 30 void Finish(); | |
|
oshima
2012/10/19 19:36:11
looks like this isn't used?
Jun Mukai
2012/10/19 21:39:34
removed.
| |
| 31 | |
| 32 // Commits the current insets data to the system. | |
| 33 void Commit(); | |
| 34 | |
| 35 // Updates the insets and redraw the visual feedback. | |
| 36 void UpdateInsets(const gfx::Insets& insets); | |
| 37 | |
| 38 private: | |
| 39 // ui::LayerDelegate overrides: | |
| 40 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | |
| 41 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | |
| 42 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE; | |
| 43 | |
| 44 gfx::Display display_; | |
|
oshima
2012/10/19 19:36:11
const
Jun Mukai
2012/10/19 21:39:34
Done.
| |
| 45 gfx::Insets insets_; | |
| 46 gfx::Rect inner_bounds_; | |
| 47 scoped_ptr<ui::Layer> calibration_layer_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(OverscanCalibrator); | |
| 50 }; | |
| 51 | |
| 52 } // namespace chromeos | |
| 53 | |
| 54 #endif // CHROME_BROWSER_CHROMEOS_DISPLAY_OVERSCAN_CALIBRATOR_H_ | |
| OLD | NEW |