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

Side by Side Diff: base/scoped_handle_gtk.h

Issue 340077: Gets find bar animation/clipping to work on views/gtk. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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
Property Changes:
Added: svn:eol-style
+ LF
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 BASE_SCOPED_HANDLE_GTK_H_
6 #define BASE_SCOPED_HANDLE_GTK_H_
7
8 #include <gdk/gdk.h>
9
10 // Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in
11 // scoped_handle_win.
12 class ScopedRegion {
13 public:
14 ScopedRegion() : region_(NULL) {}
15 explicit ScopedRegion(GdkRegion* region) : region_(region) {}
16
17 ~ScopedRegion() {
18 Close();
19 }
20
21 void Set(GdkRegion* region) {
22 Close();
23
24 region_ = region;
25 }
26
27 GdkRegion* Get() {
28 return region_;
29 }
30
31 GdkRegion* release() {
32 GdkRegion* region = region_;
33 region_ = NULL;
34 return region;
35 }
36
37 private:
38 void Close() {
39 if (region_) {
40 gdk_region_destroy(region_);
41 region_ = NULL;
42 }
43 }
44
45 GdkRegion* region_;
46
47 DISALLOW_COPY_AND_ASSIGN(ScopedRegion);
48 };
49
50 #endif // BASE_SCOPED_HANDLE_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698