| 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_DELEGATE_BASE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // ConstrainedWebDialogDelegate interface. | 37 // ConstrainedWebDialogDelegate interface. |
| 38 const ui::WebDialogDelegate* GetWebDialogDelegate() const override; | 38 const ui::WebDialogDelegate* GetWebDialogDelegate() const override; |
| 39 ui::WebDialogDelegate* GetWebDialogDelegate() override; | 39 ui::WebDialogDelegate* GetWebDialogDelegate() override; |
| 40 void OnDialogCloseFromWebUI() override; | 40 void OnDialogCloseFromWebUI() override; |
| 41 void ReleaseWebContentsOnDialogClose() override; | 41 void ReleaseWebContentsOnDialogClose() override; |
| 42 content::WebContents* GetWebContents() override; | 42 content::WebContents* GetWebContents() override; |
| 43 gfx::NativeWindow GetNativeDialog() override; | 43 gfx::NativeWindow GetNativeDialog() override; |
| 44 gfx::Size GetMinimumSize() const override; | 44 gfx::Size GetMinimumSize() const override; |
| 45 gfx::Size GetMaximumSize() const override; | 45 gfx::Size GetMaximumSize() const override; |
| 46 gfx::Size GetPreferredSize() const override; | 46 gfx::Size GetPreferredSize() const override; |
| 47 bool * GetIndependentBounds(); |
| 47 | 48 |
| 48 // WebDialogWebContentsDelegate interface. | 49 // WebDialogWebContentsDelegate interface. |
| 49 void HandleKeyboardEvent( | 50 void HandleKeyboardEvent( |
| 50 content::WebContents* source, | 51 content::WebContents* source, |
| 51 const content::NativeWebKeyboardEvent& event) override; | 52 const content::NativeWebKeyboardEvent& event) override; |
| 52 | 53 |
| 53 // Resize the dialog to the given size. | 54 // Resize the dialog to the given size. |
| 54 virtual void ResizeToGivenSize(const gfx::Size size); | 55 virtual void ResizeToGivenSize(const gfx::Size size); |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 std::unique_ptr<ui::WebDialogDelegate> web_dialog_delegate_; | 58 std::unique_ptr<ui::WebDialogDelegate> web_dialog_delegate_; |
| 58 | 59 |
| 59 // Holds the HTML to display in the constrained dialog. | 60 // Holds the HTML to display in the constrained dialog. |
| 60 std::unique_ptr<content::WebContents> web_contents_; | 61 std::unique_ptr<content::WebContents> web_contents_; |
| 61 | 62 |
| 62 // Was the dialog closed from WebUI (in which case |web_dialog_delegate_|'s | 63 // Was the dialog closed from WebUI (in which case |web_dialog_delegate_|'s |
| 63 // OnDialogClosed() method has already been called)? | 64 // OnDialogClosed() method has already been called)? |
| 64 bool closed_via_webui_; | 65 bool closed_via_webui_; |
| 65 | 66 |
| 66 // If true, release |web_contents_| on close instead of destroying it. | 67 // If true, release |web_contents_| on close instead of destroying it. |
| 67 bool release_contents_on_close_; | 68 bool release_contents_on_close_; |
| 68 | 69 |
| 69 std::unique_ptr<WebDialogWebContentsDelegate> override_tab_delegate_; | 70 std::unique_ptr<WebDialogWebContentsDelegate> override_tab_delegate_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateBase); | 72 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateBase); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ | 75 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ |
| OLD | NEW |