| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 ASH_WM_SCREEN_DIMMER_H_ | 5 #ifndef ASH_WM_SCREEN_DIMMER_H_ |
| 6 #define ASH_WM_SCREEN_DIMMER_H_ | 6 #define ASH_WM_SCREEN_DIMMER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 bool is_dimming() const { return is_dimming_; } | 54 bool is_dimming() const { return is_dimming_; } |
| 55 | 55 |
| 56 // Find a ScreenDimmer in the container, or nullptr if it does not exist. | 56 // Find a ScreenDimmer in the container, or nullptr if it does not exist. |
| 57 static ScreenDimmer* FindForTest(int container_id); | 57 static ScreenDimmer* FindForTest(int container_id); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 friend class test::ScreenDimmerTest; | 60 friend class test::ScreenDimmerTest; |
| 61 | 61 |
| 62 explicit ScreenDimmer(int container_id); | 62 explicit ScreenDimmer(int container_id); |
| 63 | 63 |
| 64 static aura::Window* FindContainer(int container_id); | |
| 65 | |
| 66 // ShellObserver: | 64 // ShellObserver: |
| 67 void OnRootWindowAdded(WmWindow* root_window) override; | 65 void OnRootWindowAdded(WmWindow* root_window) override; |
| 68 | 66 |
| 69 // Update the dimming state. This will also create a new DimWindow | 67 // Update the dimming state. This will also create a new DimWindow |
| 70 // if necessary. (Used when a new display is connected) | 68 // if necessary. (Used when a new display is connected) |
| 71 void Update(bool should_dim); | 69 void Update(bool should_dim); |
| 72 | 70 |
| 73 int container_id_; | 71 int container_id_; |
| 74 float target_opacity_; | 72 float target_opacity_; |
| 75 | 73 |
| 76 // Are we currently dimming the screen? | 74 // Are we currently dimming the screen? |
| 77 bool is_dimming_; | 75 bool is_dimming_; |
| 78 bool at_bottom_; | 76 bool at_bottom_; |
| 79 | 77 |
| 80 // Owns the WindowDimmers. | 78 // Owns the WindowDimmers. |
| 81 std::unique_ptr<WmWindowUserData<WindowDimmer>> window_dimmers_; | 79 std::unique_ptr<WmWindowUserData<WindowDimmer>> window_dimmers_; |
| 82 | 80 |
| 83 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); | 81 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); |
| 84 }; | 82 }; |
| 85 | 83 |
| 86 } // namespace ash | 84 } // namespace ash |
| 87 | 85 |
| 88 #endif // ASH_WM_SCREEN_DIMMER_H_ | 86 #endif // ASH_WM_SCREEN_DIMMER_H_ |
| OLD | NEW |