| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_SNAPSHOT_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 10 | 10 |
| 11 class SkBitmap; | 11 class SkBitmap; |
| 12 class TabContents; | 12 class TabContents; |
| 13 typedef TabContents TabContentsWrapper; | |
| 14 | 13 |
| 15 // Per-tab class to handle snapshot functionality. | 14 // Per-tab class to handle snapshot functionality. |
| 16 class SnapshotTabHelper : public content::WebContentsObserver { | 15 class SnapshotTabHelper : public content::WebContentsObserver { |
| 17 public: | 16 public: |
| 18 explicit SnapshotTabHelper(content::WebContents* tab); | 17 explicit SnapshotTabHelper(content::WebContents* tab); |
| 19 virtual ~SnapshotTabHelper(); | 18 virtual ~SnapshotTabHelper(); |
| 20 | 19 |
| 21 // Captures a snapshot of the page. | 20 // Captures a snapshot of the page. |
| 22 void CaptureSnapshot(); | 21 void CaptureSnapshot(); |
| 23 | 22 |
| 24 private: | 23 private: |
| 25 // content::WebContentsObserver overrides: | 24 // content::WebContentsObserver overrides: |
| 26 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 25 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 27 | 26 |
| 28 // Internal helpers ---------------------------------------------------------- | 27 // Internal helpers ---------------------------------------------------------- |
| 29 | 28 |
| 30 // Message handler. | 29 // Message handler. |
| 31 void OnSnapshot(const SkBitmap& bitmap); | 30 void OnSnapshot(const SkBitmap& bitmap); |
| 32 | 31 |
| 33 DISALLOW_COPY_AND_ASSIGN(SnapshotTabHelper); | 32 DISALLOW_COPY_AND_ASSIGN(SnapshotTabHelper); |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 #endif // CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ | 35 #endif // CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ |
| OLD | NEW |