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

Unified Diff: headless/lib/browser/headless_browser_impl.cc

Issue 2896763002: Implement window management devtools commands for headless. (Closed)
Patch Set: nit and rebase 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 | « headless/lib/browser/headless_browser_impl.h ('k') | headless/lib/browser/headless_devtools_client_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_browser_impl.cc
diff --git a/headless/lib/browser/headless_browser_impl.cc b/headless/lib/browser/headless_browser_impl.cc
index 57605807d53a9488123ae1ca0d000934b2ff4067..c3c2f2570a1a7be848ee33247e82cbf9dc690588 100644
--- a/headless/lib/browser/headless_browser_impl.cc
+++ b/headless/lib/browser/headless_browser_impl.cc
@@ -200,6 +200,19 @@ HeadlessWebContents* HeadlessBrowserImpl::GetWebContentsForDevToolsAgentHostId(
return nullptr;
}
+HeadlessWebContentsImpl* HeadlessBrowserImpl::GetWebContentsForWindowId(
+ const int window_id) {
+ for (HeadlessBrowserContext* context : GetAllBrowserContexts()) {
+ for (HeadlessWebContents* web_contents : context->GetAllWebContents()) {
+ auto* contents = HeadlessWebContentsImpl::From(web_contents);
+ if (contents->window_id() == window_id) {
+ return contents;
+ }
+ }
+ }
+ return nullptr;
+}
+
HeadlessBrowserContext* HeadlessBrowserImpl::GetBrowserContextForId(
const std::string& id) {
auto find_it = browser_contexts_.find(id);
« no previous file with comments | « headless/lib/browser/headless_browser_impl.h ('k') | headless/lib/browser/headless_devtools_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698