Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: content/browser/frame_host/navigation_entry_screenshot_manager.h

Issue 2702093002: Consistent CopyFromSurface() API, consolidated to RWHV (Closed)
Patch Set: REBASE Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 20 matching lines...) Expand all
31 NavigationControllerImpl* controller); 31 NavigationControllerImpl* controller);
32 virtual ~NavigationEntryScreenshotManager(); 32 virtual ~NavigationEntryScreenshotManager();
33 33
34 // Takes a screenshot of the last-committed entry of the controller. 34 // Takes a screenshot of the last-committed entry of the controller.
35 void TakeScreenshot(); 35 void TakeScreenshot();
36 36
37 // Clears screenshots of all navigation entries. 37 // Clears screenshots of all navigation entries.
38 void ClearAllScreenshots(); 38 void ClearAllScreenshots();
39 39
40 protected: 40 protected:
41 virtual void TakeScreenshotImpl(RenderViewHost* host, 41 // Overridden by tests to be notified when a screenshot will be taken. Tests
42 NavigationEntryImpl* entry); 42 // can override OnScreenshotSet() to be notified after the screenshot is
43 // taken.
44 virtual void WillTakeScreenshot(RenderViewHost* host) {}
43 45
44 // Called after a screenshot has been set on an NavigationEntryImpl. 46 // Called after a screenshot has been set on an NavigationEntryImpl.
45 // Overridden in tests to get notified of when a screenshot is set. 47 // Overridden in tests to get notified of when a screenshot is set.
46 virtual void OnScreenshotSet(NavigationEntryImpl* entry); 48 virtual void OnScreenshotSet(NavigationEntryImpl* entry);
47 49
48 NavigationControllerImpl* owner() { return owner_; } 50 NavigationControllerImpl* owner() { return owner_; }
49 51
50 void SetMinScreenshotIntervalMS(int interval_ms); 52 void SetMinScreenshotIntervalMS(int interval_ms);
51 53
52 // The callback invoked when taking the screenshot of the page is complete. 54 // The callback invoked when taking the screenshot of the page is complete.
(...skipping 30 matching lines...) Expand all
83 // the callback to make sure that the screenshot/encoding completion callback 85 // the callback to make sure that the screenshot/encoding completion callback
84 // does not trigger on a destroyed NavigationEntryScreenshotManager. 86 // does not trigger on a destroyed NavigationEntryScreenshotManager.
85 base::WeakPtrFactory<NavigationEntryScreenshotManager> screenshot_factory_; 87 base::WeakPtrFactory<NavigationEntryScreenshotManager> screenshot_factory_;
86 88
87 DISALLOW_COPY_AND_ASSIGN(NavigationEntryScreenshotManager); 89 DISALLOW_COPY_AND_ASSIGN(NavigationEntryScreenshotManager);
88 }; 90 };
89 91
90 } // namespace content 92 } // namespace content
91 93
92 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ 94 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698