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

Side by Side Diff: content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h

Issue 11343017: Move remaining files in content\browser\renderer_host to content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 1 month 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_MANAGER_H _ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_MANAGER_H _
6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_MANAGER_H _ 6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_MANAGER_H _
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "content/public/browser/web_contents_observer.h" 13 #include "content/public/browser/web_contents_observer.h"
14 14
15 class JavaBridgeDispatcherHost;
16 struct NPObject; 15 struct NPObject;
17 16
18 namespace content { 17 namespace content {
18 class JavaBridgeDispatcherHost;
19 class RenderViewHost; 19 class RenderViewHost;
20 }
21 20
22 // This class handles injecting Java objects into all of the RenderViews 21 // This class handles injecting Java objects into all of the RenderViews
23 // associated with a WebContents. It manages a set of JavaBridgeDispatcherHost 22 // associated with a WebContents. It manages a set of JavaBridgeDispatcherHost
24 // objects, one per RenderViewHost. 23 // objects, one per RenderViewHost.
25 class JavaBridgeDispatcherHostManager : public content::WebContentsObserver { 24 class JavaBridgeDispatcherHostManager : public WebContentsObserver {
26 public: 25 public:
27 explicit JavaBridgeDispatcherHostManager(content::WebContents* web_contents); 26 explicit JavaBridgeDispatcherHostManager(WebContents* web_contents);
28 virtual ~JavaBridgeDispatcherHostManager(); 27 virtual ~JavaBridgeDispatcherHostManager();
29 28
30 // These methods add or remove the object to each JavaBridgeDispatcherHost. 29 // These methods add or remove the object to each JavaBridgeDispatcherHost.
31 // Each one holds a reference to the NPObject while the object is bound to 30 // Each one holds a reference to the NPObject while the object is bound to
32 // the corresponding RenderView. See JavaBridgeDispatcherHost for details. 31 // the corresponding RenderView. See JavaBridgeDispatcherHost for details.
33 void AddNamedObject(const string16& name, NPObject* object); 32 void AddNamedObject(const string16& name, NPObject* object);
34 void RemoveNamedObject(const string16& name); 33 void RemoveNamedObject(const string16& name);
35 34
36 // content::WebContentsObserver overrides 35 // WebContentsObserver overrides
37 virtual void RenderViewCreated( 36 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
38 content::RenderViewHost* render_view_host) OVERRIDE; 37 virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE;
39 virtual void RenderViewDeleted( 38 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
40 content::RenderViewHost* render_view_host) OVERRIDE;
41 virtual void WebContentsDestroyed(
42 content::WebContents* web_contents) OVERRIDE;
43 39
44 private: 40 private:
45 typedef std::map<content::RenderViewHost*, 41 typedef std::map<RenderViewHost*, scoped_refptr<JavaBridgeDispatcherHost> >
46 scoped_refptr<JavaBridgeDispatcherHost> >
47 InstanceMap; 42 InstanceMap;
48 InstanceMap instances_; 43 InstanceMap instances_;
49 typedef std::map<string16, NPObject*> ObjectMap; 44 typedef std::map<string16, NPObject*> ObjectMap;
50 ObjectMap objects_; 45 ObjectMap objects_;
51 46
52 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHostManager); 47 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHostManager);
53 }; 48 };
54 49
50 } // namespace content
51
55 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_MANAGE R_H_ 52 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_MANAGE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698