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

Side by Side Diff: content/browser/browser_plugin/test_guest_manager_delegate.h

Issue 261363002: Rename BrowserPluginGuestManagerDelegate to BrowserPluginGuestManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_cleanupguestmanager
Patch Set: Fixed Android Build (Hopefully) Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_
7
8 #include <map>
9
10 #include "base/memory/singleton.h"
11 #include "content/public/browser/browser_plugin_guest_manager_delegate.h"
12
13 namespace content {
14
15 class MessageLoopRunner;
16 class WebContentsImpl;
17
18 // This class is temporary until BrowserPluginHostTest.* tests are entirely
19 // moved out of content.
20 class TestGuestManagerDelegate : public BrowserPluginGuestManagerDelegate {
21 public:
22 virtual ~TestGuestManagerDelegate();
23
24 static TestGuestManagerDelegate* GetInstance();
25
26 void AddGuest(int guest_instance_id, WebContents* guest_web_contents);
27 void RemoveGuest(int guest_instance_id);
28 SiteInstance* GetGuestSiteInstance(const GURL& guest_site);
29
30 // Waits until at least one guest is added to this guest manager.
31 WebContentsImpl* WaitForGuestAdded();
32
33 // BrowserPluginGuestManagerDelegate implementation.
34 virtual content::WebContents* CreateGuest(
35 content::SiteInstance* embedder_site_instance,
36 int instance_id,
37 const std::string& storage_partition_id,
38 bool persist_storage,
39 scoped_ptr<base::DictionaryValue> extra_params) OVERRIDE;
40 virtual int GetNextInstanceID() OVERRIDE;
41 virtual void MaybeGetGuestByInstanceIDOrKill(
42 int guest_instance_id,
43 int embedder_render_process_id,
44 const GuestByInstanceIDCallback& callback) OVERRIDE;
45 virtual bool ForEachGuest(WebContents* embedder_web_contents,
46 const GuestCallback& callback) OVERRIDE;
47
48 private:
49 friend struct DefaultSingletonTraits<TestGuestManagerDelegate>;
50 TestGuestManagerDelegate();
51
52 // Contains guests' WebContents, mapping from their instance ids.
53 typedef std::map<int, WebContents*> GuestInstanceMap;
54 GuestInstanceMap guest_web_contents_by_instance_id_;
55 WebContentsImpl* last_guest_added_;
56 int next_instance_id_;
57 scoped_refptr<MessageLoopRunner> message_loop_runner_;
58
59 DISALLOW_COPY_AND_ASSIGN(TestGuestManagerDelegate);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_TEST_GUEST_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/test_guest_manager.cc ('k') | content/browser/browser_plugin/test_guest_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698