OLD | NEW |
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_UI_COCOA_FULLSCREEN_LOW_POWER_COORDINATOR_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_FULLSCREEN_LOW_POWER_COORDINATOR_H_ |
6 #define CHROME_BROWSER_UI_COCOA_FULLSCREEN_LOW_POWER_COORDINATOR_H_ | 6 #define CHROME_BROWSER_UI_COCOA_FULLSCREEN_LOW_POWER_COORDINATOR_H_ |
7 | 7 |
8 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" | 8 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" |
9 #include "ui/accelerated_widget_mac/fullscreen_low_power_coordinator.h" | 9 #include "ui/accelerated_widget_mac/fullscreen_low_power_coordinator.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 // ui::FullscreenLowPowerCoordinator implementation. | 37 // ui::FullscreenLowPowerCoordinator implementation. |
38 void SetLowPowerLayerValid(bool valid) override; | 38 void SetLowPowerLayerValid(bool valid) override; |
39 void WillLoseAcceleratedWidget() override; | 39 void WillLoseAcceleratedWidget() override; |
40 | 40 |
41 private: | 41 private: |
42 // Determine if we should be fullscreen low power mode, and enter or exit | 42 // Determine if we should be fullscreen low power mode, and enter or exit |
43 // the mode as needed. | 43 // the mode as needed. |
44 void EnterOrExitLowPowerModeIfNeeded(); | 44 void EnterOrExitLowPowerModeIfNeeded(); |
45 | 45 |
46 // The main fullscreen window. | 46 // The main fullscreen window. |
47 base::scoped_nsobject<NSWindow> content_window_ = nil; | 47 base::scoped_nsobject<NSWindow> content_window_; |
48 | 48 |
49 // Weak, reset by WillLoseAcceleratedWidget before it goes away. | 49 // Weak, reset by WillLoseAcceleratedWidget before it goes away. |
50 ui::AcceleratedWidgetMac* widget_ = nullptr; | 50 ui::AcceleratedWidgetMac* widget_ = nullptr; |
51 | 51 |
52 // The window that we will put in front of the main fullscreen window when we | 52 // The window that we will put in front of the main fullscreen window when we |
53 // can. | 53 // can. |
54 base::scoped_nsobject<FullscreenLowPowerWindow> low_power_window_; | 54 base::scoped_nsobject<FullscreenLowPowerWindow> low_power_window_; |
55 | 55 |
56 // Set by the AcceleratedWidgetHost with each frame. This must be true to | 56 // Set by the AcceleratedWidgetHost with each frame. This must be true to |
57 // enter low power mode. | 57 // enter low power mode. |
58 bool low_power_layer_valid_ = false; | 58 bool low_power_layer_valid_ = false; |
59 | 59 |
60 // Set if the NSView hierarchy allows low power mode. Low power mode is only | 60 // Set if the NSView hierarchy allows low power mode. Low power mode is only |
61 // allowed when nothing but the web contents is on-screen. | 61 // allowed when nothing but the web contents is on-screen. |
62 bool allowed_by_nsview_layout_ = true; | 62 bool allowed_by_nsview_layout_ = true; |
63 | 63 |
64 // Updated by EnterOrExitLowPowerModeIfNeeded. | 64 // Updated by EnterOrExitLowPowerModeIfNeeded. |
65 bool in_low_power_mode_ = false; | 65 bool in_low_power_mode_ = false; |
66 }; | 66 }; |
67 | 67 |
68 #endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_LOW_POWER_COORDINATOR_H_ | 68 #endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_LOW_POWER_COORDINATOR_H_ |
OLD | NEW |