OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/common/cursors/webcursor.h" | 5 #include "content/common/cursors/webcursor.h" |
6 | 6 |
7 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 7 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
8 #include "ui/base/cursor/cursor.h" | 8 #include "ui/base/cursor/cursor.h" |
9 #include "ui/base/cursor/cursor_util.h" | 9 #include "ui/base/cursor/cursor_util.h" |
10 #include "ui/ozone/public/cursor_factory_ozone.h" | 10 #include "ui/ozone/public/cursor_factory_ozone.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // It is not necessary to recreate platform_cursor_ yet, since it will be | 50 // It is not necessary to recreate platform_cursor_ yet, since it will be |
51 // recreated on demand when GetPlatformCursor is called. | 51 // recreated on demand when GetPlatformCursor is called. |
52 } | 52 } |
53 | 53 |
54 void WebCursor::InitPlatformData() { | 54 void WebCursor::InitPlatformData() { |
55 platform_cursor_ = NULL; | 55 platform_cursor_ = NULL; |
56 device_scale_factor_ = 1.f; | 56 device_scale_factor_ = 1.f; |
57 rotation_ = gfx::Display::ROTATE_0; | 57 rotation_ = gfx::Display::ROTATE_0; |
58 } | 58 } |
59 | 59 |
60 bool WebCursor::SerializePlatformData(Pickle* pickle) const { | 60 bool WebCursor::SerializePlatformData(base::Pickle* pickle) const { |
61 return true; | 61 return true; |
62 } | 62 } |
63 | 63 |
64 bool WebCursor::DeserializePlatformData(PickleIterator* iter) { | 64 bool WebCursor::DeserializePlatformData(base::PickleIterator* iter) { |
65 return true; | 65 return true; |
66 } | 66 } |
67 | 67 |
68 bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const { | 68 bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const { |
69 return true; | 69 return true; |
70 } | 70 } |
71 | 71 |
72 void WebCursor::CleanupPlatformData() { | 72 void WebCursor::CleanupPlatformData() { |
73 if (platform_cursor_) { | 73 if (platform_cursor_) { |
74 ui::CursorFactoryOzone::GetInstance()->UnrefImageCursor(platform_cursor_); | 74 ui::CursorFactoryOzone::GetInstance()->UnrefImageCursor(platform_cursor_); |
75 platform_cursor_ = NULL; | 75 platform_cursor_ = NULL; |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 void WebCursor::CopyPlatformData(const WebCursor& other) { | 79 void WebCursor::CopyPlatformData(const WebCursor& other) { |
80 if (platform_cursor_) | 80 if (platform_cursor_) |
81 ui::CursorFactoryOzone::GetInstance()->UnrefImageCursor(platform_cursor_); | 81 ui::CursorFactoryOzone::GetInstance()->UnrefImageCursor(platform_cursor_); |
82 platform_cursor_ = other.platform_cursor_; | 82 platform_cursor_ = other.platform_cursor_; |
83 if (platform_cursor_) | 83 if (platform_cursor_) |
84 ui::CursorFactoryOzone::GetInstance()->RefImageCursor(platform_cursor_); | 84 ui::CursorFactoryOzone::GetInstance()->RefImageCursor(platform_cursor_); |
85 | 85 |
86 device_scale_factor_ = other.device_scale_factor_; | 86 device_scale_factor_ = other.device_scale_factor_; |
87 } | 87 } |
88 | 88 |
89 } // namespace content | 89 } // namespace content |
OLD | NEW |