Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: app/scoped_handle_gtk.h

Issue 6257006: Move a bunch of random other files to src/ui/base... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « app/message_box_flags.h ('k') | app/surface/transport_dib.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 APP_SCOPED_HANDLE_GTK_H_
6 #define APP_SCOPED_HANDLE_GTK_H_
7 #pragma once
8
9 #include <gdk/gdk.h>
10
11 // Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in
12 // scoped_handle_win.
13 class ScopedRegion {
14 public:
15 ScopedRegion() : region_(NULL) {}
16 explicit ScopedRegion(GdkRegion* region) : region_(region) {}
17
18 ~ScopedRegion() {
19 Close();
20 }
21
22 void Set(GdkRegion* region) {
23 Close();
24
25 region_ = region;
26 }
27
28 GdkRegion* Get() {
29 return region_;
30 }
31
32 GdkRegion* release() {
33 GdkRegion* region = region_;
34 region_ = NULL;
35 return region;
36 }
37
38 private:
39 void Close() {
40 if (region_) {
41 gdk_region_destroy(region_);
42 region_ = NULL;
43 }
44 }
45
46 GdkRegion* region_;
47
48 DISALLOW_COPY_AND_ASSIGN(ScopedRegion);
49 };
50
51 #endif // APP_SCOPED_HANDLE_GTK_H_
OLDNEW
« no previous file with comments | « app/message_box_flags.h ('k') | app/surface/transport_dib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698