OLD | NEW |
(Empty) | |
| 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 |
| 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 #pragma once |
| 8 |
| 9 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 10 |
| 11 class SkBitmap; |
| 12 class TabContentsWrapper; |
| 13 |
| 14 // Per-tab class to handle snapshot functionality. |
| 15 class SnapshotTabHelper : public TabContentsObserver { |
| 16 public: |
| 17 explicit SnapshotTabHelper(TabContentsWrapper* wrapper); |
| 18 virtual ~SnapshotTabHelper(); |
| 19 |
| 20 // Captures a snapshot of the page. |
| 21 void CaptureSnapshot(); |
| 22 |
| 23 private: |
| 24 // TabContentsObserver overrides: |
| 25 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 26 |
| 27 // Internal helpers ---------------------------------------------------------- |
| 28 |
| 29 // Message handler. |
| 30 void OnSnapshot(const SkBitmap& bitmap); |
| 31 |
| 32 // Our owning TabContentsWrapper. |
| 33 TabContentsWrapper* wrapper_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(SnapshotTabHelper); |
| 36 }; |
| 37 |
| 38 #endif // CHROME_BROWSER_UI_SNAPSHOT_TAB_HELPER_H_ |
OLD | NEW |