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