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

Side by Side Diff: content/test/test_render_view_host_factory.h

Issue 10191010: Re-implement the screensaver to use WebView instead of ExtensionDialogHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_TEST_TEST_RENDER_VIEW_HOST_FACTORY_H_
6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_FACTORY_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "content/browser/renderer_host/render_view_host_factory.h"
12
13 namespace content {
14
15 class SiteInstance;
16 class RenderViewHostDelegate;
17 class RenderProcessHostFactory;
18 class SessionStorageNamespace;
19
20 // Manages creation of the RenderViewHosts using our special subclass. This
21 // automatically registers itself when it goes in scope, and unregisters itself
22 // when it goes out of scope. Since you can't have more than one factory
23 // registered at a time, you can only have one of these objects at a time.
24 class TestRenderViewHostFactory : public RenderViewHostFactory {
25 public:
26 explicit TestRenderViewHostFactory(
27 content::RenderProcessHostFactory* rph_factory);
28 virtual ~TestRenderViewHostFactory();
29
30 virtual void set_render_process_host_factory(
31 content::RenderProcessHostFactory* rph_factory);
32 virtual content::RenderViewHost* CreateRenderViewHost(
33 content::SiteInstance* instance,
34 content::RenderViewHostDelegate* delegate,
35 int routing_id,
36 content::SessionStorageNamespace* session_storage) OVERRIDE;
37
38 private:
39 // This is a bit of a hack. With the current design of the site instances /
40 // browsing instances, it's difficult to pass a RenderProcessHostFactory
41 // around properly.
42 //
43 // Instead, we set it right before we create a new RenderViewHost, which
44 // happens before the RenderProcessHost is created. This way, the instance
45 // has the correct factory and creates our special RenderProcessHosts.
46 content::RenderProcessHostFactory* render_process_host_factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(TestRenderViewHostFactory);
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698