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

Side by Side Diff: chrome/browser/ui/webui/constrained_web_dialog_ui.h

Issue 2798583002: WebUI: prevent WebContent to hold invalid pointer. (Closed)
Patch Set: Remove reference to |this| when the WebContent is no more owned. 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 #ifndef CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/public/browser/web_ui_controller.h" 10 #include "content/public/browser/web_ui_controller.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 public: 67 public:
68 explicit ConstrainedWebDialogUI(content::WebUI* web_ui); 68 explicit ConstrainedWebDialogUI(content::WebUI* web_ui);
69 ~ConstrainedWebDialogUI() override; 69 ~ConstrainedWebDialogUI() override;
70 70
71 // WebUIController implementation: 71 // WebUIController implementation:
72 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; 72 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
73 73
74 // Sets the delegate on the WebContents. 74 // Sets the delegate on the WebContents.
75 static void SetConstrainedDelegate(content::WebContents* web_contents, 75 static void SetConstrainedDelegate(content::WebContents* web_contents,
76 ConstrainedWebDialogDelegate* delegate); 76 ConstrainedWebDialogDelegate* delegate);
77 static void ClearConstrainedDelegate(content::WebContents* web_contents);
77 78
78 protected: 79 protected:
79 // Returns the ConstrainedWebDialogDelegate saved with the WebContents. 80 // Returns the ConstrainedWebDialogDelegate saved with the WebContents.
80 // Returns NULL if no such delegate is set. 81 // Returns NULL if no such delegate is set.
81 ConstrainedWebDialogDelegate* GetConstrainedDelegate(); 82 ConstrainedWebDialogDelegate* GetConstrainedDelegate();
82 83
83 private: 84 private:
84 // JS Message Handler 85 // JS Message Handler
85 void OnDialogCloseMessage(const base::ListValue* args); 86 void OnDialogCloseMessage(const base::ListValue* args);
86 87
(...skipping 21 matching lines...) Expand all
108 // |min_size| is the minimum size of the dialog. 109 // |min_size| is the minimum size of the dialog.
109 // |max_size| is the maximum size of the dialog. 110 // |max_size| is the maximum size of the dialog.
110 ConstrainedWebDialogDelegate* ShowConstrainedWebDialogWithAutoResize( 111 ConstrainedWebDialogDelegate* ShowConstrainedWebDialogWithAutoResize(
111 content::BrowserContext* browser_context, 112 content::BrowserContext* browser_context,
112 ui::WebDialogDelegate* delegate, 113 ui::WebDialogDelegate* delegate,
113 content::WebContents* overshadowed, 114 content::WebContents* overshadowed,
114 const gfx::Size& min_size, 115 const gfx::Size& min_size,
115 const gfx::Size& max_size); 116 const gfx::Size& max_size);
116 117
117 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_ 118 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698