| 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> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 11 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
| 11 #include "ui/web_dialogs/web_dialog_ui.h" | 12 #include "ui/web_dialogs/web_dialog_ui.h" |
| 12 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" | 13 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 class BrowserContext; | 16 class BrowserContext; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace ui { | 19 namespace ui { |
| 19 class WebDialogDelegate; | 20 class WebDialogDelegate; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 46 | 47 |
| 47 // WebDialogWebContentsDelegate interface. | 48 // WebDialogWebContentsDelegate interface. |
| 48 void HandleKeyboardEvent( | 49 void HandleKeyboardEvent( |
| 49 content::WebContents* source, | 50 content::WebContents* source, |
| 50 const content::NativeWebKeyboardEvent& event) override; | 51 const content::NativeWebKeyboardEvent& event) override; |
| 51 | 52 |
| 52 // Resize the dialog to the given size. | 53 // Resize the dialog to the given size. |
| 53 virtual void ResizeToGivenSize(const gfx::Size size); | 54 virtual void ResizeToGivenSize(const gfx::Size size); |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 scoped_ptr<ui::WebDialogDelegate> web_dialog_delegate_; | 57 std::unique_ptr<ui::WebDialogDelegate> web_dialog_delegate_; |
| 57 | 58 |
| 58 // Holds the HTML to display in the constrained dialog. | 59 // Holds the HTML to display in the constrained dialog. |
| 59 scoped_ptr<content::WebContents> web_contents_; | 60 std::unique_ptr<content::WebContents> web_contents_; |
| 60 | 61 |
| 61 // Was the dialog closed from WebUI (in which case |web_dialog_delegate_|'s | 62 // Was the dialog closed from WebUI (in which case |web_dialog_delegate_|'s |
| 62 // OnDialogClosed() method has already been called)? | 63 // OnDialogClosed() method has already been called)? |
| 63 bool closed_via_webui_; | 64 bool closed_via_webui_; |
| 64 | 65 |
| 65 // If true, release |web_contents_| on close instead of destroying it. | 66 // If true, release |web_contents_| on close instead of destroying it. |
| 66 bool release_contents_on_close_; | 67 bool release_contents_on_close_; |
| 67 | 68 |
| 68 scoped_ptr<WebDialogWebContentsDelegate> override_tab_delegate_; | 69 std::unique_ptr<WebDialogWebContentsDelegate> override_tab_delegate_; |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateBase); | 71 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateBase); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ | 74 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ |
| OLD | NEW |