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

Side by Side Diff: chrome/browser/extensions/api/capture_web_contents_function.h

Issue 259523008: Remove RenderWidgetHost::GetSnapshotFromRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: getsnapshotfromrenderer: rm Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/capture_web_contents_function.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
7 7
8 #include "chrome/browser/extensions/chrome_extension_function.h" 8 #include "chrome/browser/extensions/chrome_extension_function.h"
9 #include "chrome/common/extensions/api/types.h" 9 #include "chrome/common/extensions/api/types.h"
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 // ExtensionFunction implementation. 28 // ExtensionFunction implementation.
29 virtual bool HasPermission() OVERRIDE; 29 virtual bool HasPermission() OVERRIDE;
30 virtual bool RunImpl() OVERRIDE; 30 virtual bool RunImpl() OVERRIDE;
31 31
32 virtual bool IsScreenshotEnabled() = 0; 32 virtual bool IsScreenshotEnabled() = 0;
33 virtual content::WebContents* GetWebContentsForID(int context_id) = 0; 33 virtual content::WebContents* GetWebContentsForID(int context_id) = 0;
34 34
35 enum FailureReason { 35 enum FailureReason {
36 FAILURE_REASON_UNKNOWN, 36 FAILURE_REASON_UNKNOWN,
37 FAILURE_REASON_CONTENT_NOT_FOUND,
38 FAILURE_REASON_ENCODING_FAILED, 37 FAILURE_REASON_ENCODING_FAILED,
39 FAILURE_REASON_VIEW_INVISIBLE 38 FAILURE_REASON_VIEW_INVISIBLE
40 }; 39 };
41 virtual void OnCaptureFailure(FailureReason reason) = 0; 40 virtual void OnCaptureFailure(FailureReason reason) = 0;
42 41
43 private: 42 private:
44 typedef api::types::ImageDetails ImageDetails; 43 typedef api::types::ImageDetails ImageDetails;
45 44
46 void CopyFromBackingStoreComplete(bool succeed, const SkBitmap& bitmap); 45 void CopyFromBackingStoreComplete(bool succeed, const SkBitmap& bitmap);
47 void GetSnapshotFromRendererComplete(bool succeeded, const SkBitmap& bitmap);
48 void OnCaptureSuccess(const SkBitmap& bitmap); 46 void OnCaptureSuccess(const SkBitmap& bitmap);
49 47
50 // |context_id_| is the ID used to find the relevant WebContents. In the 48 // |context_id_| is the ID used to find the relevant WebContents. In the
51 // |tabs.captureVisibleTab()| api, this represents the window-id, and in the 49 // |tabs.captureVisibleTab()| api, this represents the window-id, and in the
52 // |webview.captureVisibleRegion()| api, this represents the instance-id of 50 // |webview.captureVisibleRegion()| api, this represents the instance-id of
53 // the guest. 51 // the guest.
54 int context_id_; 52 int context_id_;
55 53
56 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). 54 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl().
57 ImageDetails::Format image_format_; 55 ImageDetails::Format image_format_;
58 56
59 // Quality setting to use when encoding jpegs. Set in RunImpl(). 57 // Quality setting to use when encoding jpegs. Set in RunImpl().
60 int image_quality_; 58 int image_quality_;
61 59
62 DISALLOW_COPY_AND_ASSIGN(CaptureWebContentsFunction); 60 DISALLOW_COPY_AND_ASSIGN(CaptureWebContentsFunction);
63 }; 61 };
64 62
65 } // namespace extensions 63 } // namespace extensions
66 64
67 #endif // CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_ 65 #endif // CHROME_BROWSER_EXTENSIONS_API_CAPTURE_WEB_CONTENTS_FUNCTION_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/capture_web_contents_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698