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

Unified Diff: ui/snapshot/snapshot_aura.cc

Issue 2854543002: Block incognito browser windows for voice interaction. (Closed)
Patch Set: address review comments Created 3 years, 7 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 | « ui/snapshot/snapshot_aura.h ('k') | ui/wm/core/window_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/snapshot/snapshot_aura.cc
diff --git a/ui/snapshot/snapshot_aura.cc b/ui/snapshot/snapshot_aura.cc
index 44b136eb6fd61a59b22ce9aec01a51104f97c19b..4a136c84f0e0ea0802ec9768c9cbee3a0b7c9d54 100644
--- a/ui/snapshot/snapshot_aura.cc
+++ b/ui/snapshot/snapshot_aura.cc
@@ -29,13 +29,13 @@ bool GrabWindowSnapshotAura(aura::Window* window,
}
static void MakeAsyncCopyRequest(
- aura::Window* window,
+ Layer* layer,
const gfx::Rect& source_rect,
const cc::CopyOutputRequest::CopyOutputRequestCallback& callback) {
std::unique_ptr<cc::CopyOutputRequest> request =
cc::CopyOutputRequest::CreateBitmapRequest(callback);
request->set_area(source_rect);
- window->layer()->RequestCopyOfOutput(std::move(request));
+ layer->RequestCopyOfOutput(std::move(request));
}
static void FinishedAsyncCopyRequest(
@@ -55,7 +55,7 @@ static void FinishedAsyncCopyRequest(
// dereference.
aura::Window* window = tracker->windows()[0];
MakeAsyncCopyRequest(
- window, source_rect,
+ window->layer(), source_rect,
base::Bind(&FinishedAsyncCopyRequest, base::Passed(&tracker),
source_rect, callback, retry_count + 1));
return;
@@ -71,7 +71,7 @@ static void MakeInitialAsyncCopyRequest(
auto tracker = base::MakeUnique<aura::WindowTracker>();
tracker->Add(window);
MakeAsyncCopyRequest(
- window, source_rect,
+ window->layer(), source_rect,
base::Bind(&FinishedAsyncCopyRequest, base::Passed(&tracker), source_rect,
callback, 0));
}
@@ -133,6 +133,14 @@ void GrabViewSnapshotAsync(gfx::NativeView view,
GrabWindowSnapshotAsyncAura(view, source_rect, callback);
}
+void GrabLayerSnapshotAsync(ui::Layer* layer,
+ const gfx::Rect& source_rect,
+ const GrabLayerSnapshotCallback& callback) {
+ MakeAsyncCopyRequest(
+ layer, source_rect,
+ base::Bind(&SnapshotAsync::RunCallbackWithCopyOutputResult, callback));
+}
+
#endif
} // namespace ui
« no previous file with comments | « ui/snapshot/snapshot_aura.h ('k') | ui/wm/core/window_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698