blob: 23aec8f19a07d5d518fdcce559092b7e784cfd49 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/common/cursors/webcursor.h"
#include <windows.h>
#include "third_party/WebKit/public/platform/WebCursorInfo.h"
#include "ui/gfx/icon_util.h"
namespace content {
ui::PlatformCursor WebCursor::GetPlatformCursor() {
if (!IsCustom())
return LoadCursor(NULL, IDC_ARROW);
if (custom_cursor_)
return custom_cursor_;
custom_cursor_ =
IconUtil::CreateCursorFromDIB(
custom_size_,
hotspot_,
!custom_data_.empty() ? &custom_data_[0] : NULL,
custom_data_.size());
return custom_cursor_;
}
void WebCursor::SetDisplayInfo(const gfx::Display& display) {
// TODO(winguru): Add support for scaling the cursor.
}
void WebCursor::InitPlatformData() {
custom_cursor_ = NULL;
}
bool WebCursor::SerializePlatformData(base::Pickle* pickle) const {
return true;
}
bool WebCursor::DeserializePlatformData(base::PickleIterator* iter) {
return true;
}
bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const {
return true;
}
void WebCursor::CleanupPlatformData() {
if (custom_cursor_) {
DestroyIcon(custom_cursor_);
custom_cursor_ = NULL;
}
}
void WebCursor::CopyPlatformData(const WebCursor& other) {
}
} // namespace content
|