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 #include "chrome/browser/web_contents_view.h" | 5 #include "chrome/browser/web_contents_view.h" |
6 | 6 |
7 void WebContentsView::CreateNewWindow(int route_id, HANDLE modal_dialog_event) { | 7 void WebContentsView::CreateNewWindow(int route_id, HANDLE modal_dialog_event) { |
8 // Save the created window associated with the route so we can show it later. | 8 // Save the created window associated with the route so we can show it later. |
9 pending_contents_[route_id] = CreateNewWindowInternal(route_id, | 9 pending_contents_[route_id] = CreateNewWindowInternal(route_id, |
10 modal_dialog_event); | 10 modal_dialog_event); |
11 } | 11 } |
12 | 12 |
13 void WebContentsView::CreateNewWidget(int route_id) { | 13 void WebContentsView::CreateNewWidget(int route_id, |
| 14 bool focus_on_show) { |
14 // Save the created widget associated with the route so we can show it later. | 15 // Save the created widget associated with the route so we can show it later. |
15 pending_widget_views_[route_id] = CreateNewWidgetInternal(route_id); | 16 pending_widget_views_[route_id] = CreateNewWidgetInternal(route_id, |
| 17 focus_on_show); |
16 } | 18 } |
17 | 19 |
18 void WebContentsView::ShowCreatedWindow(int route_id, | 20 void WebContentsView::ShowCreatedWindow(int route_id, |
19 WindowOpenDisposition disposition, | 21 WindowOpenDisposition disposition, |
20 const gfx::Rect& initial_pos, | 22 const gfx::Rect& initial_pos, |
21 bool user_gesture) { | 23 bool user_gesture) { |
22 PendingContents::iterator iter = pending_contents_.find(route_id); | 24 PendingContents::iterator iter = pending_contents_.find(route_id); |
23 if (iter == pending_contents_.end()) { | 25 if (iter == pending_contents_.end()) { |
24 DCHECK(false); | 26 DCHECK(false); |
25 return; | 27 return; |
(...skipping 12 matching lines...) Expand all Loading... |
38 if (iter == pending_widget_views_.end()) { | 40 if (iter == pending_widget_views_.end()) { |
39 DCHECK(false); | 41 DCHECK(false); |
40 return; | 42 return; |
41 } | 43 } |
42 | 44 |
43 RenderWidgetHostView* widget_host_view = iter->second; | 45 RenderWidgetHostView* widget_host_view = iter->second; |
44 pending_widget_views_.erase(route_id); | 46 pending_widget_views_.erase(route_id); |
45 | 47 |
46 ShowCreatedWidgetInternal(widget_host_view, initial_pos); | 48 ShowCreatedWidgetInternal(widget_host_view, initial_pos); |
47 } | 49 } |
OLD | NEW |