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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 1614703003: Revert of Implement webview.captureVisibleRegion() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.h ('k') | chrome/common/extensions/api/webview_tag.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/tabs/tabs_api.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index ad2a7920d3da5de11b7c7a98facbbd3115118904..a1176106d3158048a3183e4271ae5551fbd71235 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -1641,10 +1641,6 @@
: chrome_details_(this) {
}
-bool TabsCaptureVisibleTabFunction::HasPermission() {
- return true;
-}
-
bool TabsCaptureVisibleTabFunction::IsScreenshotEnabled() {
PrefService* service = chrome_details_.GetProfile()->GetPrefs();
if (service->GetBoolean(prefs::kDisableScreenshots)) {
@@ -1670,40 +1666,6 @@
return NULL;
}
return contents;
-}
-
-bool TabsCaptureVisibleTabFunction::RunAsync() {
- using api::extension_types::ImageDetails;
-
- EXTENSION_FUNCTION_VALIDATE(args_);
-
- int context_id = extension_misc::kCurrentWindowId;
- args_->GetInteger(0, &context_id);
-
- scoped_ptr<ImageDetails> image_details;
- if (args_->GetSize() > 1) {
- base::Value* spec = NULL;
- EXTENSION_FUNCTION_VALIDATE(args_->Get(1, &spec) && spec);
- image_details = ImageDetails::FromValue(*spec);
- }
-
- WebContents* contents = GetWebContentsForID(context_id);
-
- return CaptureAsync(
- contents, image_details.get(),
- base::Bind(&TabsCaptureVisibleTabFunction::CopyFromBackingStoreComplete,
- this));
-}
-
-void TabsCaptureVisibleTabFunction::OnCaptureSuccess(const SkBitmap& bitmap) {
- std::string base64_result;
- if (!EncodeBitmap(bitmap, &base64_result)) {
- OnCaptureFailure(FAILURE_REASON_ENCODING_FAILED);
- return;
- }
-
- SetResult(new base::StringValue(base64_result));
- SendResponse(true);
}
void TabsCaptureVisibleTabFunction::OnCaptureFailure(FailureReason reason) {
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.h ('k') | chrome/common/extensions/api/webview_tag.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698