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

Side by Side Diff: components/constrained_window/constrained_window_views.cc

Issue 1432143002: Track where WebContents are created in order to better understand issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Save the Delegate Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "components/constrained_window/constrained_window_views.h" 5 #include "components/constrained_window/constrained_window_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/alias.h"
9 #include "components/constrained_window/constrained_window_views_client.h" 10 #include "components/constrained_window/constrained_window_views_client.h"
10 #include "components/guest_view/browser/guest_view_base.h" 11 #include "components/guest_view/browser/guest_view_base.h"
11 #include "components/web_modal/web_contents_modal_dialog_host.h" 12 #include "components/web_modal/web_contents_modal_dialog_host.h"
12 #include "components/web_modal/web_contents_modal_dialog_manager.h" 13 #include "components/web_modal/web_contents_modal_dialog_manager.h"
13 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" 14 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
14 #include "ui/views/border.h" 15 #include "ui/views/border.h"
15 #include "ui/views/widget/widget.h" 16 #include "ui/views/widget/widget.h"
16 #include "ui/views/widget/widget_observer.h" 17 #include "ui/views/widget/widget_observer.h"
17 #include "ui/views/window/dialog_delegate.h" 18 #include "ui/views/window/dialog_delegate.h"
18 19
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 content::WebContents* web_contents = 140 content::WebContents* web_contents =
140 guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents); 141 guest_view::GuestViewBase::GetTopLevelWebContents(initiator_web_contents);
141 views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents); 142 views::Widget* widget = CreateWebModalDialogViews(dialog, web_contents);
142 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents) 143 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents)
143 ->ShowModalDialog(widget->GetNativeWindow()); 144 ->ShowModalDialog(widget->GetNativeWindow());
144 return widget; 145 return widget;
145 } 146 }
146 147
147 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, 148 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
148 content::WebContents* web_contents) { 149 content::WebContents* web_contents) {
150 // Temporary to track down http://crbug.com/538612
151 content::WebContentsDelegate* delegate = web_contents->GetDelegate();
152 base::debug::Alias(delegate);
Mike Wittman 2015/11/17 16:24:06 Have you verified that the vtable is captured in t
ncarter (slow) 2015/11/17 17:42:16 This should work; I wouldn't sweat it. For example
hcarmona 2015/11/20 03:36:50 I wasn't able to see the variable in the new crash
153 CHECK(
154 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents));
155
149 DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType()); 156 DCHECK_EQ(ui::MODAL_TYPE_CHILD, dialog->GetModalType());
150 return views::DialogDelegate::CreateDialogWidget( 157 return views::DialogDelegate::CreateDialogWidget(
151 dialog, nullptr, 158 dialog, nullptr,
152 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents) 159 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents)
153 ->delegate() 160 ->delegate()
154 ->GetWebContentsModalDialogHost() 161 ->GetWebContentsModalDialogHost()
155 ->GetHostView()); 162 ->GetHostView());
156 } 163 }
157 164
158 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, 165 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
(...skipping 25 matching lines...) Expand all
184 DCHECK_EQ(parent_view, host->GetHostView()); 191 DCHECK_EQ(parent_view, host->GetHostView());
185 ModalDialogHostObserver* dialog_host_observer = 192 ModalDialogHostObserver* dialog_host_observer =
186 new WidgetModalDialogHostObserverViews( 193 new WidgetModalDialogHostObserverViews(
187 host, widget, kWidgetModalDialogHostObserverViewsKey); 194 host, widget, kWidgetModalDialogHostObserverViewsKey);
188 dialog_host_observer->OnPositionRequiresUpdate(); 195 dialog_host_observer->OnPositionRequiresUpdate();
189 } 196 }
190 return widget; 197 return widget;
191 } 198 }
192 199
193 } // namespace constrained window 200 } // namespace constrained window
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698