OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_WEB_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_WEB_CONTENTS_VIEW_H_ |
6 #define CHROME_BROWSER_WEB_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_WEB_CONTENTS_VIEW_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // ...::View functions directly, since the routing stuff will already be | 148 // ...::View functions directly, since the routing stuff will already be |
149 // computed. They should implement the rest of the functions as normal. | 149 // computed. They should implement the rest of the functions as normal. |
150 // | 150 // |
151 // The only difference is that the Create functions return the newly | 151 // The only difference is that the Create functions return the newly |
152 // created objects so that they can be associated with the given routes. When | 152 // created objects so that they can be associated with the given routes. When |
153 // they are shown later, we'll look them up again and pass the objects to | 153 // they are shown later, we'll look them up again and pass the objects to |
154 // the Show functions rather than the route ID. | 154 // the Show functions rather than the route ID. |
155 virtual WebContents* CreateNewWindowInternal(int route_id, | 155 virtual WebContents* CreateNewWindowInternal(int route_id, |
156 HANDLE modal_dialog_event) = 0; | 156 HANDLE modal_dialog_event) = 0; |
157 virtual RenderWidgetHostView* CreateNewWidgetInternal(int route_id, | 157 virtual RenderWidgetHostView* CreateNewWidgetInternal(int route_id, |
158 bool focus_on_show) = 0; | 158 bool activatable) = 0; |
159 virtual void ShowCreatedWindowInternal(WebContents* new_web_contents, | 159 virtual void ShowCreatedWindowInternal(WebContents* new_web_contents, |
160 WindowOpenDisposition disposition, | 160 WindowOpenDisposition disposition, |
161 const gfx::Rect& initial_pos, | 161 const gfx::Rect& initial_pos, |
162 bool user_gesture) = 0; | 162 bool user_gesture) = 0; |
163 virtual void ShowCreatedWidgetInternal(RenderWidgetHostView* widget_host_view, | 163 virtual void ShowCreatedWidgetInternal(RenderWidgetHostView* widget_host_view, |
164 const gfx::Rect& initial_pos) = 0; | 164 const gfx::Rect& initial_pos) = 0; |
165 | 165 |
166 private: | 166 private: |
167 // We implement these functions on RenderViewHostDelegate::View directly and | 167 // We implement these functions on RenderViewHostDelegate::View directly and |
168 // do some book-keeping associated with the request. The request is then | 168 // do some book-keeping associated with the request. The request is then |
169 // forwarded to *Internal which does platform-specific work. | 169 // forwarded to *Internal which does platform-specific work. |
170 virtual void CreateNewWindow(int route_id, HANDLE modal_dialog_event); | 170 virtual void CreateNewWindow(int route_id, HANDLE modal_dialog_event); |
171 virtual void CreateNewWidget(int route_id, | 171 virtual void CreateNewWidget(int route_id, bool activatable); |
172 bool focus_on_show); | |
173 virtual void ShowCreatedWindow(int route_id, | 172 virtual void ShowCreatedWindow(int route_id, |
174 WindowOpenDisposition disposition, | 173 WindowOpenDisposition disposition, |
175 const gfx::Rect& initial_pos, | 174 const gfx::Rect& initial_pos, |
176 bool user_gesture); | 175 bool user_gesture); |
177 virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); | 176 virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos); |
178 | 177 |
179 // Tracks created WebContents objects that have not been shown yet. They are | 178 // Tracks created WebContents objects that have not been shown yet. They are |
180 // identified by the route ID passed to CreateNewWindow. | 179 // identified by the route ID passed to CreateNewWindow. |
181 typedef std::map<int, WebContents*> PendingContents; | 180 typedef std::map<int, WebContents*> PendingContents; |
182 PendingContents pending_contents_; | 181 PendingContents pending_contents_; |
183 | 182 |
184 // These maps hold on to the widgets that we created on behalf of the | 183 // These maps hold on to the widgets that we created on behalf of the |
185 // renderer that haven't shown yet. | 184 // renderer that haven't shown yet. |
186 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; | 185 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; |
187 PendingWidgetViews pending_widget_views_; | 186 PendingWidgetViews pending_widget_views_; |
188 | 187 |
189 DISALLOW_COPY_AND_ASSIGN(WebContentsView); | 188 DISALLOW_COPY_AND_ASSIGN(WebContentsView); |
190 }; | 189 }; |
191 | 190 |
192 #endif // CHROME_BROWSER_WEB_CONTENTS_VIEW_H_ | 191 #endif // CHROME_BROWSER_WEB_CONTENTS_VIEW_H_ |
OLD | NEW |