OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 APP_SCOPED_HANDLE_GTK_H_ | 5 #ifndef UI_BASE_GTK_SCOPED_HANDLE_GTK_H_ |
6 #define APP_SCOPED_HANDLE_GTK_H_ | 6 #define UI_BASE_GTK_SCOPED_HANDLE_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
10 | 10 |
| 11 namespace ui { |
| 12 |
11 // Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in | 13 // Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in |
12 // scoped_handle_win. | 14 // scoped_handle_win. |
13 class ScopedRegion { | 15 class ScopedRegion { |
14 public: | 16 public: |
15 ScopedRegion() : region_(NULL) {} | 17 ScopedRegion() : region_(NULL) {} |
16 explicit ScopedRegion(GdkRegion* region) : region_(region) {} | 18 explicit ScopedRegion(GdkRegion* region) : region_(region) {} |
17 | 19 |
18 ~ScopedRegion() { | 20 ~ScopedRegion() { |
19 Close(); | 21 Close(); |
20 } | 22 } |
(...skipping 20 matching lines...) Expand all Loading... |
41 gdk_region_destroy(region_); | 43 gdk_region_destroy(region_); |
42 region_ = NULL; | 44 region_ = NULL; |
43 } | 45 } |
44 } | 46 } |
45 | 47 |
46 GdkRegion* region_; | 48 GdkRegion* region_; |
47 | 49 |
48 DISALLOW_COPY_AND_ASSIGN(ScopedRegion); | 50 DISALLOW_COPY_AND_ASSIGN(ScopedRegion); |
49 }; | 51 }; |
50 | 52 |
51 #endif // APP_SCOPED_HANDLE_GTK_H_ | 53 } // namespace ui |
| 54 |
| 55 #endif // UI_BASE_GTK_SCOPED_HANDLE_GTK_H_ |
OLD | NEW |