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

Side by Side Diff: chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc

Issue 2798583002: WebUI: prevent WebContent to hold invalid pointer. (Closed)
Patch Set: Fix compilation on mac Created 3 years, 8 months 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
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 "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // ConstrainedWebDialogDelegate: 168 // ConstrainedWebDialogDelegate:
169 const ui::WebDialogDelegate* GetWebDialogDelegate() const override { 169 const ui::WebDialogDelegate* GetWebDialogDelegate() const override {
170 return impl_->GetWebDialogDelegate(); 170 return impl_->GetWebDialogDelegate();
171 } 171 }
172 ui::WebDialogDelegate* GetWebDialogDelegate() override { 172 ui::WebDialogDelegate* GetWebDialogDelegate() override {
173 return impl_->GetWebDialogDelegate(); 173 return impl_->GetWebDialogDelegate();
174 } 174 }
175 void OnDialogCloseFromWebUI() override { 175 void OnDialogCloseFromWebUI() override {
176 return impl_->OnDialogCloseFromWebUI(); 176 return impl_->OnDialogCloseFromWebUI();
177 } 177 }
178 void ReleaseWebContentsOnDialogClose() override { 178 std::unique_ptr<content::WebContents> ReleaseWebContents() override {
179 return impl_->ReleaseWebContentsOnDialogClose(); 179 return impl_->ReleaseWebContents();
180 } 180 }
181 gfx::NativeWindow GetNativeDialog() override { 181 gfx::NativeWindow GetNativeDialog() override {
182 return impl_->GetNativeDialog(); 182 return impl_->GetNativeDialog();
183 } 183 }
184 content::WebContents* GetWebContents() override { 184 content::WebContents* GetWebContents() override {
185 return impl_->GetWebContents(); 185 return impl_->GetWebContents();
186 } 186 }
187 187
188 // views::WidgetDelegate: 188 // views::WidgetDelegate:
189 views::View* GetInitiallyFocusedView() override { return this; } 189 views::View* GetInitiallyFocusedView() override { return this; }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 min_size, max_size); 300 min_size, max_size);
301 301
302 // For embedded WebContents, use the embedder's WebContents for constrained 302 // For embedded WebContents, use the embedder's WebContents for constrained
303 // window. 303 // window.
304 content::WebContents* top_level_web_contents = 304 content::WebContents* top_level_web_contents =
305 constrained_window::GetTopLevelWebContents(web_contents); 305 constrained_window::GetTopLevelWebContents(web_contents);
306 DCHECK(top_level_web_contents); 306 DCHECK(top_level_web_contents);
307 constrained_window::CreateWebModalDialogViews(dialog, top_level_web_contents); 307 constrained_window::CreateWebModalDialogViews(dialog, top_level_web_contents);
308 return dialog; 308 return dialog;
309 } 309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698