OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual void OnScreenshotSet(NavigationEntryImpl* entry); | 44 virtual void OnScreenshotSet(NavigationEntryImpl* entry); |
45 | 45 |
46 NavigationControllerImpl* owner() { return owner_; } | 46 NavigationControllerImpl* owner() { return owner_; } |
47 | 47 |
48 void SetMinScreenshotIntervalMS(int interval_ms); | 48 void SetMinScreenshotIntervalMS(int interval_ms); |
49 | 49 |
50 // The callback invoked when taking the screenshot of the page is complete. | 50 // The callback invoked when taking the screenshot of the page is complete. |
51 // This sets the screenshot on the navigation entry. | 51 // This sets the screenshot on the navigation entry. |
52 void OnScreenshotTaken(int unique_id, | 52 void OnScreenshotTaken(int unique_id, |
53 bool success, | 53 bool success, |
54 const SkBitmap& bitmap); | 54 const SkBitmap& bitmap, |
| 55 const int& response); |
55 | 56 |
56 // Returns the number of entries with screenshots. | 57 // Returns the number of entries with screenshots. |
57 int GetScreenshotCount() const; | 58 int GetScreenshotCount() const; |
58 | 59 |
59 private: | 60 private: |
60 // This is called when the screenshot data has beene encoded to PNG in a | 61 // This is called when the screenshot data has beene encoded to PNG in a |
61 // worker thread. | 62 // worker thread. |
62 void OnScreenshotEncodeComplete(int unique_id, | 63 void OnScreenshotEncodeComplete(int unique_id, |
63 scoped_refptr<ScreenshotData> data); | 64 scoped_refptr<ScreenshotData> data); |
64 | 65 |
(...skipping 16 matching lines...) Expand all Loading... |
81 // the callback to make sure that the screenshot/encoding completion callback | 82 // the callback to make sure that the screenshot/encoding completion callback |
82 // does not trigger on a destroyed NavigationEntryScreenshotManager. | 83 // does not trigger on a destroyed NavigationEntryScreenshotManager. |
83 base::WeakPtrFactory<NavigationEntryScreenshotManager> screenshot_factory_; | 84 base::WeakPtrFactory<NavigationEntryScreenshotManager> screenshot_factory_; |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(NavigationEntryScreenshotManager); | 86 DISALLOW_COPY_AND_ASSIGN(NavigationEntryScreenshotManager); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace content | 89 } // namespace content |
89 | 90 |
90 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ | 91 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ |
OLD | NEW |