| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 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 BASE_MAC_UTIL_H_ | 5 #ifndef BASE_MAC_UTIL_H_ |
| 6 #define BASE_MAC_UTIL_H_ | 6 #define BASE_MAC_UTIL_H_ |
| 7 | 7 |
| 8 #include <Carbon/Carbon.h> | 8 #include <Carbon/Carbon.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> |
| 10 | 11 |
| 11 class FilePath; | 12 class FilePath; |
| 12 | 13 |
| 13 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
| 14 @class NSBundle; | 15 @class NSBundle; |
| 16 @class NSWindow; |
| 15 #else | 17 #else |
| 16 class NSBundle; | 18 class NSBundle; |
| 19 class NSWindow; |
| 17 #endif | 20 #endif |
| 18 | 21 |
| 19 namespace mac_util { | 22 namespace mac_util { |
| 20 | 23 |
| 21 std::string PathFromFSRef(const FSRef& ref); | 24 std::string PathFromFSRef(const FSRef& ref); |
| 22 bool FSRefFromPath(const std::string& path, FSRef* ref); | 25 bool FSRefFromPath(const std::string& path, FSRef* ref); |
| 23 | 26 |
| 24 // Returns true if the application is running from a bundle | 27 // Returns true if the application is running from a bundle |
| 25 bool AmIBundled(); | 28 bool AmIBundled(); |
| 26 | 29 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // fullscreen windows. For example, if the menu bar is not currently | 68 // fullscreen windows. For example, if the menu bar is not currently |
| 66 // hidden, this will hide it. Must be called on main thread. | 69 // hidden, this will hide it. Must be called on main thread. |
| 67 void RequestFullScreen(); | 70 void RequestFullScreen(); |
| 68 | 71 |
| 69 // Release a request for full screen mode. As with RequestFullScree(), this | 72 // Release a request for full screen mode. As with RequestFullScree(), this |
| 70 // does not affect windows directly, but rather manages per-application state. | 73 // does not affect windows directly, but rather manages per-application state. |
| 71 // For example, if there are no other outstanding requests for full screen, | 74 // For example, if there are no other outstanding requests for full screen, |
| 72 // this will show the menu bar. Must be called on main thread. | 75 // this will show the menu bar. Must be called on main thread. |
| 73 void ReleaseFullScreen(); | 76 void ReleaseFullScreen(); |
| 74 | 77 |
| 78 // Pulls a snapshot of the entire browser into png_representation. |
| 79 void GrabWindowSnapshot(NSWindow* window, |
| 80 std::vector<unsigned char>* png_representation); |
| 75 } // namespace mac_util | 81 } // namespace mac_util |
| 76 | 82 |
| 77 #endif // BASE_MAC_UTIL_H_ | 83 #endif // BASE_MAC_UTIL_H_ |
| OLD | NEW |