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

Side by Side Diff: base/scoped_aedesc.h

Issue 3151011: [Mac] Use an AppleEvent to tell the Finder to open downloaded items, rather than NSWorkspace. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Address comments Created 10 years, 4 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
« no previous file with comments | « base/base.gypi ('k') | chrome/browser/platform_util_mac.mm » ('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) 2010 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_AEDESC_H_
6 #define BASE_SCOPED_AEDESC_H_
7 #pragma once
8
9 #import <CoreServices/CoreServices.h>
10
11 #include "base/basictypes.h"
12
13 // The scoped_aedesc is used to scope AppleEvent descriptors. On creation,
14 // it will store a NULL descriptor. On destruction, it will dispose of the
15 // descriptor.
16 //
17 // This class is parameterized for additional type safety checks. You can use
18 // the generic AEDesc type by not providing a template parameter:
19 // scoped_aedesc<> desc;
20 template <typename AEDescType = AEDesc>
21 class scoped_aedesc {
22 public:
23 scoped_aedesc() {
24 AECreateDesc(typeNull, NULL, 0, &desc_);
25 }
26
27 ~scoped_aedesc() {
28 AEDisposeDesc(&desc_);
29 }
30
31 // Used for in parameters.
32 operator const AEDescType*() {
33 return &desc_;
34 }
35
36 // Used for out parameters.
37 AEDescType* OutPointer() {
38 return &desc_;
39 }
40
41 private:
42 AEDescType desc_;
43
44 DISALLOW_COPY_AND_ASSIGN(scoped_aedesc);
45 };
46
47 #endif // BASE_SCOPED_AEDESC_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | chrome/browser/platform_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698