blob: c809c0ff7e5e74368272a4576ce87368b857bde7 [file] [log] [blame]
// Copyright 2014 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.
#include "base/callback.h"
#include "content/common/content_export.h"
namespace content {
class WebContents;
// A BrowserPluginGuestManager offloads guest management and routing
// operations outside of the content layer.
class CONTENT_EXPORT BrowserPluginGuestManager {
virtual ~BrowserPluginGuestManager() {}
// Requests a guest WebContents associated with the provided
// <owner_process_id, browser_plugin_instance_id> tuple.
virtual WebContents* GetGuestByInstanceID(int owner_process_id,
int browser_plugin_instance_id);
// Iterates over all WebContents belonging to a given |embedder_web_contents|,
// calling |callback| for each. If one of the callbacks returns true, then
// the iteration exits early.
typedef base::Callback<bool(WebContents*)> GuestCallback;
virtual bool ForEachGuest(WebContents* embedder_web_contents,
const GuestCallback& callback);
// Returns the "full page" guest if there is one. That is, if there is a
// single BrowserPlugin in the given embedder which takes up the full page,
// then it is returned.
virtual WebContents* GetFullPageGuest(WebContents* embedder_web_contents);
} // namespace content