OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ |
| 7 |
| 8 #include "content/public/browser/web_contents_observer.h" |
| 9 #include "content/public/browser/web_contents_user_data.h" |
| 10 |
| 11 class SkBitmap; |
| 12 |
| 13 // Per-tab class to handle snapshot functionality. |
| 14 class SnapshotTabHelper |
| 15 : public content::WebContentsObserver, |
| 16 public content::WebContentsUserData<SnapshotTabHelper> { |
| 17 public: |
| 18 virtual ~SnapshotTabHelper(); |
| 19 |
| 20 // Captures a snapshot of the page. |
| 21 void CaptureSnapshot(); |
| 22 |
| 23 private: |
| 24 explicit SnapshotTabHelper(content::WebContents* web_contents); |
| 25 friend class content::WebContentsUserData<SnapshotTabHelper>; |
| 26 |
| 27 // content::WebContentsObserver overrides: |
| 28 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 29 |
| 30 // Internal helpers ---------------------------------------------------------- |
| 31 |
| 32 // Message handler. |
| 33 void OnSnapshot(const SkBitmap& bitmap); |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(SnapshotTabHelper); |
| 36 }; |
| 37 |
| 38 #endif // CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ |
OLD | NEW |