| Index: content/shell/browser/browser_plugin/test_guest_manager_delegate.h
|
| diff --git a/content/shell/browser/browser_plugin/test_guest_manager_delegate.h b/content/shell/browser/browser_plugin/test_guest_manager_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0893db625980f5edfd1a610c37a5d2a4aef165f1
|
| --- /dev/null
|
| +++ b/content/shell/browser/browser_plugin/test_guest_manager_delegate.h
|
| @@ -0,0 +1,58 @@
|
| +// 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.
|
| +
|
| +#ifndef CONTENT_SHELL_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_
|
| +#define CONTENT_SHELL_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_
|
| +
|
| +#include <map>
|
| +
|
| +#include "base/memory/singleton.h"
|
| +#include "content/public/browser/browser_plugin_guest_manager_delegate.h"
|
| +
|
| +namespace content {
|
| +
|
| +// This class is temporary until BrowserPluginHostTest.* tests are entirely
|
| +// moved out of content.
|
| +class TestGuestManagerDelegate : public BrowserPluginGuestManagerDelegate {
|
| + public:
|
| + virtual ~TestGuestManagerDelegate();
|
| +
|
| + static TestGuestManagerDelegate* GetInstance();
|
| +
|
| + // BrowserPluginGuestManagerDelegate implementation.
|
| + virtual int GetNextInstanceID() OVERRIDE;
|
| + virtual void AddGuest(int guest_instance_id,
|
| + WebContents* guest_web_contents) OVERRIDE;
|
| + virtual void RemoveGuest(int guest_instance_id) OVERRIDE;
|
| + virtual WebContents* GetGuestByInstanceID(
|
| + int guest_instance_id,
|
| + int embedder_render_process_id) OVERRIDE;
|
| + virtual bool CanEmbedderAccessInstanceIDMaybeKill(
|
| + int embedder_render_process_id,
|
| + int guest_instance_id) OVERRIDE;
|
| + virtual bool CanEmbedderAccessInstanceID(int embedder_render_process_id,
|
| + int guest_instance_id) OVERRIDE;
|
| + virtual SiteInstance* GetGuestSiteInstance(
|
| + const GURL& guest_site) OVERRIDE;
|
| + virtual bool ForEachGuest(WebContents* embedder_web_contents,
|
| + const GuestCallback& callback) OVERRIDE;
|
| + virtual void RequestInstanceID(
|
| + const std::string& src,
|
| + const InstanceIDResponseCallback& callback) OVERRIDE;
|
| +
|
| + private:
|
| + friend struct DefaultSingletonTraits<TestGuestManagerDelegate>;
|
| + TestGuestManagerDelegate();
|
| + // Contains guests' WebContents, mapping from their instance ids.
|
| + typedef std::map<int, WebContents*> GuestInstanceMap;
|
| + GuestInstanceMap guest_web_contents_by_instance_id_;
|
| +
|
| + int next_instance_id_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TestGuestManagerDelegate);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_SHELL_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_
|
|
|