| 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 #ifndef CHROME_BROWSER_ANDROID_THUMBNAIL_THUMBNAIL_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_THUMBNAIL_THUMBNAIL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_THUMBNAIL_THUMBNAIL_H_ | 6 #define CHROME_BROWSER_ANDROID_THUMBNAIL_THUMBNAIL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "cc/resources/ui_resource_bitmap.h" | 11 #include "cc/resources/ui_resource_bitmap.h" |
| 12 #include "cc/resources/ui_resource_client.h" | 12 #include "cc/resources/ui_resource_client.h" |
| 13 #include "third_party/skia/include/core/SkRefCnt.h" |
| 13 #include "ui/gfx/geometry/size_f.h" | 14 #include "ui/gfx/geometry/size_f.h" |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class Time; | 17 class Time; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class Size; | 21 class Size; |
| 21 } | 22 } |
| 22 | 23 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 ~Thumbnail() override; | 46 ~Thumbnail() override; |
| 46 | 47 |
| 47 TabId tab_id() const { return tab_id_; } | 48 TabId tab_id() const { return tab_id_; } |
| 48 base::Time time_stamp() const { return time_stamp_; } | 49 base::Time time_stamp() const { return time_stamp_; } |
| 49 float scale() const { return scale_; } | 50 float scale() const { return scale_; } |
| 50 cc::UIResourceId ui_resource_id() const { return ui_resource_id_; } | 51 cc::UIResourceId ui_resource_id() const { return ui_resource_id_; } |
| 51 const gfx::SizeF& scaled_content_size() const { return scaled_content_size_; } | 52 const gfx::SizeF& scaled_content_size() const { return scaled_content_size_; } |
| 52 const gfx::SizeF& scaled_data_size() const { return scaled_data_size_; } | 53 const gfx::SizeF& scaled_data_size() const { return scaled_data_size_; } |
| 53 | 54 |
| 54 void SetBitmap(const SkBitmap& bitmap); | 55 void SetBitmap(const SkBitmap& bitmap); |
| 55 void SetCompressedBitmap(skia::RefPtr<SkPixelRef> compressed_bitmap, | 56 void SetCompressedBitmap(sk_sp<SkPixelRef> compressed_bitmap, |
| 56 const gfx::Size& content_size); | 57 const gfx::Size& content_size); |
| 57 void CreateUIResource(); | 58 void CreateUIResource(); |
| 58 | 59 |
| 59 // cc::UIResourceClient implementation. | 60 // cc::UIResourceClient implementation. |
| 60 cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid, | 61 cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid, |
| 61 bool resource_lost) override; | 62 bool resource_lost) override; |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 Thumbnail(TabId tab_id, | 65 Thumbnail(TabId tab_id, |
| 65 const base::Time& time_stamp, | 66 const base::Time& time_stamp, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 83 bool retrieved_; | 84 bool retrieved_; |
| 84 | 85 |
| 85 ui::UIResourceProvider* ui_resource_provider_; | 86 ui::UIResourceProvider* ui_resource_provider_; |
| 86 ThumbnailDelegate* thumbnail_delegate_; | 87 ThumbnailDelegate* thumbnail_delegate_; |
| 87 | 88 |
| 88 base::WeakPtrFactory<Thumbnail> weak_factory_; | 89 base::WeakPtrFactory<Thumbnail> weak_factory_; |
| 89 DISALLOW_COPY_AND_ASSIGN(Thumbnail); | 90 DISALLOW_COPY_AND_ASSIGN(Thumbnail); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 #endif // CHROME_BROWSER_ANDROID_THUMBNAIL_THUMBNAIL_H_ | 93 #endif // CHROME_BROWSER_ANDROID_THUMBNAIL_THUMBNAIL_H_ |
| OLD | NEW |