| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_COMMON_CURSORS_WEBCURSOR_H_ | 5 #ifndef CONTENT_COMMON_CURSORS_WEBCURSOR_H_ |
| 6 #define CONTENT_COMMON_CURSORS_WEBCURSOR_H_ | 6 #define CONTENT_COMMON_CURSORS_WEBCURSOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 typedef struct HICON__* HICON; | 24 typedef struct HICON__* HICON; |
| 25 typedef HICON HCURSOR; | 25 typedef HICON HCURSOR; |
| 26 #elif defined(OS_MACOSX) | 26 #elif defined(OS_MACOSX) |
| 27 #ifdef __OBJC__ | 27 #ifdef __OBJC__ |
| 28 @class NSCursor; | 28 @class NSCursor; |
| 29 #else | 29 #else |
| 30 class NSCursor; | 30 class NSCursor; |
| 31 #endif | 31 #endif |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 namespace base { |
| 34 class Pickle; | 35 class Pickle; |
| 35 class PickleIterator; | 36 class PickleIterator; |
| 37 } |
| 36 | 38 |
| 37 namespace content { | 39 namespace content { |
| 38 | 40 |
| 39 // This class encapsulates a cross-platform description of a cursor. Platform | 41 // This class encapsulates a cross-platform description of a cursor. Platform |
| 40 // specific methods are provided to translate the cross-platform cursor into a | 42 // specific methods are provided to translate the cross-platform cursor into a |
| 41 // platform specific cursor. It is also possible to serialize / de-serialize a | 43 // platform specific cursor. It is also possible to serialize / de-serialize a |
| 42 // WebCursor. | 44 // WebCursor. |
| 43 class CONTENT_EXPORT WebCursor { | 45 class CONTENT_EXPORT WebCursor { |
| 44 public: | 46 public: |
| 45 struct CursorInfo { | 47 struct CursorInfo { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 74 | 76 |
| 75 // Copy constructor/assignment operator combine. | 77 // Copy constructor/assignment operator combine. |
| 76 WebCursor(const WebCursor& other); | 78 WebCursor(const WebCursor& other); |
| 77 const WebCursor& operator=(const WebCursor& other); | 79 const WebCursor& operator=(const WebCursor& other); |
| 78 | 80 |
| 79 // Conversion from/to CursorInfo. | 81 // Conversion from/to CursorInfo. |
| 80 void InitFromCursorInfo(const CursorInfo& cursor_info); | 82 void InitFromCursorInfo(const CursorInfo& cursor_info); |
| 81 void GetCursorInfo(CursorInfo* cursor_info) const; | 83 void GetCursorInfo(CursorInfo* cursor_info) const; |
| 82 | 84 |
| 83 // Serialization / De-serialization | 85 // Serialization / De-serialization |
| 84 bool Deserialize(PickleIterator* iter); | 86 bool Deserialize(base::PickleIterator* iter); |
| 85 bool Serialize(Pickle* pickle) const; | 87 bool Serialize(base::Pickle* pickle) const; |
| 86 | 88 |
| 87 // Returns true if GetCustomCursor should be used to allocate a platform | 89 // Returns true if GetCustomCursor should be used to allocate a platform |
| 88 // specific cursor object. Otherwise GetCursor should be used. | 90 // specific cursor object. Otherwise GetCursor should be used. |
| 89 bool IsCustom() const; | 91 bool IsCustom() const; |
| 90 | 92 |
| 91 // Returns true if the current cursor object contains the same cursor as the | 93 // Returns true if the current cursor object contains the same cursor as the |
| 92 // cursor object passed in. If the current cursor is a custom cursor, we also | 94 // cursor object passed in. If the current cursor is a custom cursor, we also |
| 93 // compare the bitmaps to verify whether they are equal. | 95 // compare the bitmaps to verify whether they are equal. |
| 94 bool IsEqual(const WebCursor& other) const; | 96 bool IsEqual(const WebCursor& other) const; |
| 95 | 97 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 124 // Copies the contents of the WebCursor instance passed in. | 126 // Copies the contents of the WebCursor instance passed in. |
| 125 void Copy(const WebCursor& other); | 127 void Copy(const WebCursor& other); |
| 126 | 128 |
| 127 // Cleans up the WebCursor instance. | 129 // Cleans up the WebCursor instance. |
| 128 void Clear(); | 130 void Clear(); |
| 129 | 131 |
| 130 // Platform specific initialization goes here. | 132 // Platform specific initialization goes here. |
| 131 void InitPlatformData(); | 133 void InitPlatformData(); |
| 132 | 134 |
| 133 // Platform specific Serialization / De-serialization | 135 // Platform specific Serialization / De-serialization |
| 134 bool SerializePlatformData(Pickle* pickle) const; | 136 bool SerializePlatformData(base::Pickle* pickle) const; |
| 135 bool DeserializePlatformData(PickleIterator* iter); | 137 bool DeserializePlatformData(base::PickleIterator* iter); |
| 136 | 138 |
| 137 // Returns true if the platform data in the current cursor object | 139 // Returns true if the platform data in the current cursor object |
| 138 // matches that of the cursor passed in. | 140 // matches that of the cursor passed in. |
| 139 bool IsPlatformDataEqual(const WebCursor& other) const ; | 141 bool IsPlatformDataEqual(const WebCursor& other) const ; |
| 140 | 142 |
| 141 // Copies platform specific data from the WebCursor instance passed in. | 143 // Copies platform specific data from the WebCursor instance passed in. |
| 142 void CopyPlatformData(const WebCursor& other); | 144 void CopyPlatformData(const WebCursor& other); |
| 143 | 145 |
| 144 // Platform specific cleanup. | 146 // Platform specific cleanup. |
| 145 void CleanupPlatformData(); | 147 void CleanupPlatformData(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 #endif | 180 #endif |
| 179 | 181 |
| 180 #if defined(USE_OZONE) | 182 #if defined(USE_OZONE) |
| 181 gfx::Display::Rotation rotation_; | 183 gfx::Display::Rotation rotation_; |
| 182 #endif | 184 #endif |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 } // namespace content | 187 } // namespace content |
| 186 | 188 |
| 187 #endif // CONTENT_COMMON_CURSORS_WEBCURSOR_H_ | 189 #endif // CONTENT_COMMON_CURSORS_WEBCURSOR_H_ |
| OLD | NEW |