| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |