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

Side by Side Diff: chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm

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 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // ConstrainedWebDialogDelegate interface 111 // ConstrainedWebDialogDelegate interface
112 const WebDialogDelegate* GetWebDialogDelegate() const override { 112 const WebDialogDelegate* GetWebDialogDelegate() const override {
113 return impl_->GetWebDialogDelegate(); 113 return impl_->GetWebDialogDelegate();
114 } 114 }
115 WebDialogDelegate* GetWebDialogDelegate() override { 115 WebDialogDelegate* GetWebDialogDelegate() override {
116 return impl_->GetWebDialogDelegate(); 116 return impl_->GetWebDialogDelegate();
117 } 117 }
118 void OnDialogCloseFromWebUI() override { 118 void OnDialogCloseFromWebUI() override {
119 return impl_->OnDialogCloseFromWebUI(); 119 return impl_->OnDialogCloseFromWebUI();
120 } 120 }
121 void ReleaseWebContentsOnDialogClose() override { 121 std::unique_ptr<content::WebContents> ReleaseWebContents() override {
122 return impl_->ReleaseWebContentsOnDialogClose(); 122 return impl_->ReleaseWebContents();
123 } 123 }
124 gfx::NativeWindow GetNativeDialog() override { return window_; } 124 gfx::NativeWindow GetNativeDialog() override { return window_; }
125 WebContents* GetWebContents() override { return impl_->GetWebContents(); } 125 WebContents* GetWebContents() override { return impl_->GetWebContents(); }
126 gfx::Size GetMinimumSize() const override { 126 gfx::Size GetMinimumSize() const override {
127 return min_size_; 127 return min_size_;
128 } 128 }
129 gfx::Size GetMaximumSize() const override { 129 gfx::Size GetMaximumSize() const override {
130 return max_size_; 130 return max_size_;
131 } 131 }
132 gfx::Size GetPreferredSize() const override { 132 gfx::Size GetPreferredSize() const override {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 const gfx::Size& max_size) { 253 const gfx::Size& max_size) {
254 DCHECK(!min_size.IsEmpty()); 254 DCHECK(!min_size.IsEmpty());
255 DCHECK(!max_size.IsEmpty()); 255 DCHECK(!max_size.IsEmpty());
256 // Deleted when the dialog closes. 256 // Deleted when the dialog closes.
257 ConstrainedWebDialogDelegateViewMac* constrained_delegate = 257 ConstrainedWebDialogDelegateViewMac* constrained_delegate =
258 new ConstrainedWebDialogDelegateViewMac( 258 new ConstrainedWebDialogDelegateViewMac(
259 browser_context, delegate, web_contents, 259 browser_context, delegate, web_contents,
260 min_size, max_size); 260 min_size, max_size);
261 return constrained_delegate; 261 return constrained_delegate;
262 } 262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698