OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_VIEWS_AUTO_KEEP_ALIVE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTO_KEEP_ALIVE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTO_KEEP_ALIVE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTO_KEEP_ALIVE_H_ |
7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" |
8 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
9 | 10 |
| 11 namespace browser_lifetime { |
| 12 class ScopedKeepAlive; |
| 13 } |
| 14 |
10 // Class to scoped decrement keep alive count. | 15 // Class to scoped decrement keep alive count. |
11 class AutoKeepAlive { | 16 class AutoKeepAlive { |
12 public: | 17 public: |
13 explicit AutoKeepAlive(gfx::NativeWindow window); | 18 explicit AutoKeepAlive(gfx::NativeWindow window); |
14 ~AutoKeepAlive(); | 19 ~AutoKeepAlive(); |
15 | 20 |
16 private: | 21 private: |
17 bool keep_alive_available_; | 22 scoped_ptr<browser_lifetime::ScopedKeepAlive> keep_alive_; |
18 | 23 |
19 DISALLOW_COPY_AND_ASSIGN(AutoKeepAlive); | 24 DISALLOW_COPY_AND_ASSIGN(AutoKeepAlive); |
20 }; | 25 }; |
21 | 26 |
22 #endif // CHROME_BROWSER_UI_VIEWS_AUTO_KEEP_ALIVE_H_ | 27 #endif // CHROME_BROWSER_UI_VIEWS_AUTO_KEEP_ALIVE_H_ |
OLD | NEW |