| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef WebScrollbarImpl_h | 25 #ifndef WebScrollbarImpl_h |
| 26 #define WebScrollbarImpl_h | 26 #define WebScrollbarImpl_h |
| 27 | 27 |
| 28 #include "platform/PlatformExport.h" | 28 #include "platform/PlatformExport.h" |
| 29 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
| 30 #include "public/platform/WebScrollbar.h" | 30 #include "public/platform/WebScrollbar.h" |
| 31 #include "wtf/Allocator.h" | 31 #include "wtf/Allocator.h" |
| 32 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
| 33 #include "wtf/PtrUtil.h" |
| 34 |
| 35 #include <memory> |
| 33 | 36 |
| 34 namespace blink { | 37 namespace blink { |
| 35 | 38 |
| 36 class Scrollbar; | 39 class Scrollbar; |
| 37 class PLATFORM_EXPORT WebScrollbarImpl final : public WebScrollbar { | 40 class PLATFORM_EXPORT WebScrollbarImpl final : public WebScrollbar { |
| 38 USING_FAST_MALLOC(WebScrollbarImpl); | 41 USING_FAST_MALLOC(WebScrollbarImpl); |
| 39 WTF_MAKE_NONCOPYABLE(WebScrollbarImpl); | 42 WTF_MAKE_NONCOPYABLE(WebScrollbarImpl); |
| 40 | 43 |
| 41 public: | 44 public: |
| 42 static WebScrollbarImpl* create(Scrollbar* scrollbar) { | 45 static std::unique_ptr<WebScrollbarImpl> create(Scrollbar* scrollbar) { |
| 43 return new WebScrollbarImpl(scrollbar); | 46 return wrapUnique(new WebScrollbarImpl(scrollbar)); |
| 44 } | 47 } |
| 45 | 48 |
| 46 // Implement WebScrollbar methods | 49 // Implement WebScrollbar methods |
| 47 bool isOverlay() const override; | 50 bool isOverlay() const override; |
| 48 int value() const override; | 51 int value() const override; |
| 49 WebPoint location() const override; | 52 WebPoint location() const override; |
| 50 WebSize size() const override; | 53 WebSize size() const override; |
| 51 bool enabled() const override; | 54 bool enabled() const override; |
| 52 int maximum() const override; | 55 int maximum() const override; |
| 53 int totalSize() const override; | 56 int totalSize() const override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 65 | 68 |
| 66 private: | 69 private: |
| 67 explicit WebScrollbarImpl(Scrollbar*); | 70 explicit WebScrollbarImpl(Scrollbar*); |
| 68 | 71 |
| 69 Persistent<Scrollbar> m_scrollbar; | 72 Persistent<Scrollbar> m_scrollbar; |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace blink | 75 } // namespace blink |
| 73 | 76 |
| 74 #endif | 77 #endif |
| OLD | NEW |