OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_DELEGATE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_DELEGATE_HELPER_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_DELEGATE_HELPER_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_DELEGATE_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "content/browser/webui/web_ui.h" | 12 #include "content/browser/webui/web_ui.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "content/public/common/window_container_type.h" | 15 #include "content/public/common/window_container_type.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
18 #include "webkit/glue/webpreferences.h" | 18 #include "webkit/glue/webpreferences.h" |
19 #include "webkit/glue/window_open_disposition.h" | 19 #include "webkit/glue/window_open_disposition.h" |
20 | 20 |
21 class BackgroundContents; | 21 class BackgroundContents; |
22 class Profile; | 22 class Profile; |
23 class RenderProcessHost; | |
24 class RenderViewHost; | 23 class RenderViewHost; |
25 class RenderViewHostDelegate; | 24 class RenderViewHostDelegate; |
26 class RenderWidgetHost; | 25 class RenderWidgetHost; |
27 class RenderWidgetHostView; | 26 class RenderWidgetHostView; |
28 class SiteInstance; | 27 class SiteInstance; |
29 class TabContents; | 28 class TabContents; |
30 struct ViewHostMsg_CreateWindow_Params; | 29 struct ViewHostMsg_CreateWindow_Params; |
31 | 30 |
32 namespace content { | 31 namespace content { |
33 class BrowserContext; | 32 class BrowserContext; |
| 33 class RenderProcessHost; |
34 } | 34 } |
35 | 35 |
36 // Provides helper methods that provide common implementations of some | 36 // Provides helper methods that provide common implementations of some |
37 // RenderViewHostDelegate::View methods. | 37 // RenderViewHostDelegate::View methods. |
38 class RenderViewHostDelegateViewHelper : public content::NotificationObserver { | 38 class RenderViewHostDelegateViewHelper : public content::NotificationObserver { |
39 public: | 39 public: |
40 RenderViewHostDelegateViewHelper(); | 40 RenderViewHostDelegateViewHelper(); |
41 virtual ~RenderViewHostDelegateViewHelper(); | 41 virtual ~RenderViewHostDelegateViewHelper(); |
42 | 42 |
43 // Creates a new renderer for window.open. This will either be a | 43 // Creates a new renderer for window.open. This will either be a |
44 // BackgroundContents (if the window_container_type == | 44 // BackgroundContents (if the window_container_type == |
45 // WINDOW_CONTAINER_TYPE_BACKGROUND and permissions allow) or a TabContents. | 45 // WINDOW_CONTAINER_TYPE_BACKGROUND and permissions allow) or a TabContents. |
46 // If a TabContents is created, it is returned. Otherwise NULL is returned. | 46 // If a TabContents is created, it is returned. Otherwise NULL is returned. |
47 TabContents* CreateNewWindow( | 47 TabContents* CreateNewWindow( |
48 int route_id, | 48 int route_id, |
49 Profile* profile, | 49 Profile* profile, |
50 SiteInstance* site, | 50 SiteInstance* site, |
51 WebUI::TypeID webui_type, | 51 WebUI::TypeID webui_type, |
52 RenderViewHostDelegate* opener, | 52 RenderViewHostDelegate* opener, |
53 WindowContainerType window_container_type, | 53 WindowContainerType window_container_type, |
54 const string16& frame_name); | 54 const string16& frame_name); |
55 | 55 |
56 // Creates a new RenderWidgetHost and saves it for later retrieval by | 56 // Creates a new RenderWidgetHost and saves it for later retrieval by |
57 // GetCreatedWidget. | 57 // GetCreatedWidget. |
58 RenderWidgetHostView* CreateNewWidget(int route_id, | 58 RenderWidgetHostView* CreateNewWidget(int route_id, |
59 WebKit::WebPopupType popup_type, | 59 WebKit::WebPopupType popup_type, |
60 RenderProcessHost* process); | 60 content::RenderProcessHost* process); |
61 | 61 |
62 RenderWidgetHostView* CreateNewFullscreenWidget( | 62 RenderWidgetHostView* CreateNewFullscreenWidget( |
63 int route_id, RenderProcessHost* process); | 63 int route_id, content::RenderProcessHost* process); |
64 | 64 |
65 // Finds the new RenderWidgetHost and returns it. Note that this can only be | 65 // Finds the new RenderWidgetHost and returns it. Note that this can only be |
66 // called once as this call also removes it from the internal map. | 66 // called once as this call also removes it from the internal map. |
67 RenderWidgetHostView* GetCreatedWidget(int route_id); | 67 RenderWidgetHostView* GetCreatedWidget(int route_id); |
68 | 68 |
69 // Finds the new RenderViewHost/Delegate by route_id, initializes it for | 69 // Finds the new RenderViewHost/Delegate by route_id, initializes it for |
70 // for renderer-initiated creation, and returns the TabContents that needs | 70 // for renderer-initiated creation, and returns the TabContents that needs |
71 // to be shown, if there is one (i.e. not a BackgroundContents). Note that | 71 // to be shown, if there is one (i.e. not a BackgroundContents). Note that |
72 // this can only be called once as this call also removes it from the internal | 72 // this can only be called once as this call also removes it from the internal |
73 // map. | 73 // map. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const std::string& value); | 132 const std::string& value); |
133 static void ClearInspectorSettings(content::BrowserContext* browser_context); | 133 static void ClearInspectorSettings(content::BrowserContext* browser_context); |
134 | 134 |
135 private: | 135 private: |
136 RenderViewHostDelegateHelper(); | 136 RenderViewHostDelegateHelper(); |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(RenderViewHostDelegateHelper); | 138 DISALLOW_COPY_AND_ASSIGN(RenderViewHostDelegateHelper); |
139 }; | 139 }; |
140 | 140 |
141 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_DELEGATE_HELPER_H_ | 141 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_DELEGATE_HELPER_H_ |
OLD | NEW |