| 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 #include "chrome/browser/render_widget_host.h" | 7 #include "chrome/browser/render_widget_host.h" |
| 8 | 8 |
| 9 void WebContentsView::RenderWidgetHostDestroyed(RenderWidgetHost* host) { | 9 void WebContentsView::RenderWidgetHostDestroyed(RenderWidgetHost* host) { |
| 10 for (PendingWidgetViews::iterator i = pending_widget_views_.begin(); | 10 for (PendingWidgetViews::iterator i = pending_widget_views_.begin(); |
| 11 i != pending_widget_views_.end(); ++i) { | 11 i != pending_widget_views_.end(); ++i) { |
| 12 if (host->view() == i->second) { | 12 if (host->view() == i->second) { |
| 13 pending_widget_views_.erase(i); | 13 pending_widget_views_.erase(i); |
| 14 return; | 14 return; |
| 15 } | 15 } |
| 16 } | 16 } |
| 17 } | 17 } |
| 18 | 18 |
| 19 void WebContentsView::CreateNewWindow(int route_id, HANDLE modal_dialog_event) { | 19 void WebContentsView::CreateNewWindow(int route_id, |
| 20 base::WaitableEvent* modal_dialog_event) { |
| 20 // Save the created window associated with the route so we can show it later. | 21 // Save the created window associated with the route so we can show it later. |
| 21 pending_contents_[route_id] = CreateNewWindowInternal(route_id, | 22 pending_contents_[route_id] = CreateNewWindowInternal(route_id, |
| 22 modal_dialog_event); | 23 modal_dialog_event); |
| 23 } | 24 } |
| 24 | 25 |
| 25 void WebContentsView::CreateNewWidget(int route_id, bool activatable) { | 26 void WebContentsView::CreateNewWidget(int route_id, bool activatable) { |
| 26 // Save the created widget associated with the route so we can show it later. | 27 // Save the created widget associated with the route so we can show it later. |
| 27 pending_widget_views_[route_id] = CreateNewWidgetInternal(route_id, | 28 pending_widget_views_[route_id] = CreateNewWidgetInternal(route_id, |
| 28 activatable); | 29 activatable); |
| 29 } | 30 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 51 if (iter == pending_widget_views_.end()) { | 52 if (iter == pending_widget_views_.end()) { |
| 52 DCHECK(false); | 53 DCHECK(false); |
| 53 return; | 54 return; |
| 54 } | 55 } |
| 55 | 56 |
| 56 RenderWidgetHostView* widget_host_view = iter->second; | 57 RenderWidgetHostView* widget_host_view = iter->second; |
| 57 pending_widget_views_.erase(route_id); | 58 pending_widget_views_.erase(route_id); |
| 58 | 59 |
| 59 ShowCreatedWidgetInternal(widget_host_view, initial_pos); | 60 ShowCreatedWidgetInternal(widget_host_view, initial_pos); |
| 60 } | 61 } |
| OLD | NEW |