fixup! Fix for Geolocation webTCT failures
[platform/framework/web/chromium-efl.git] / ash / display / display_highlight_controller.h
1 // Copyright 2020 The Chromium Authors
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 ASH_DISPLAY_DISPLAY_HIGHLIGHT_CONTROLLER_H_
6 #define ASH_DISPLAY_DISPLAY_HIGHLIGHT_CONTROLLER_H_
7
8 #include "ash/ash_export.h"
9 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/public/cpp/session/session_observer.h"
11 #include "ui/views/widget/widget.h"
12
13 namespace ash {
14
15 // DisplayHighlightController manages which display should render display
16 // identification highlights. Highlights are translucent blue rectangles on the
17 // edges of a display.
18 // TODO(1091497): Consider combining DisplayHighlightController and
19 // DisplayAlignmentController.
20 class ASH_EXPORT DisplayHighlightController
21     : public WindowTreeHostManager::Observer,
22       public SessionObserver {
23  public:
24   DisplayHighlightController();
25   ~DisplayHighlightController() override;
26
27   // Sets the display to render the highlights on. To remove a currently-active
28   // highlight, pass display::kInvalidDisplayId as |display_id|.
29   void SetHighlightedDisplay(int64_t display_id);
30
31   views::Widget* GetWidgetForTesting() { return highlight_widget_.get(); }
32
33  private:
34   // WindowTreeHostManager::Observer:
35   void OnDisplayConfigurationChanged() override;
36   void OnDisplaysInitialized() override;
37
38   // SessionObserver:
39   void OnLockStateChanged(bool locked) override;
40
41   // Updates |highlight_| with new selected display.
42   void UpdateDisplayIdentificationHighlight();
43
44   // Widget used to render a blue highlight on the border of the specified
45   // display.
46   std::unique_ptr<views::Widget> highlight_widget_;
47
48   int64_t selected_display_id_ = display::kInvalidDisplayId;
49
50   // Tracks if the screen is locked in order to remove the highlight when screen
51   // locks and show it when it unlocks.
52   bool is_locked_;
53 };
54 }  // namespace ash
55
56 #endif  // ASH_DISPLAY_DISPLAY_HIGHLIGHT_CONTROLLER_H_