| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 10 #include "ui/web_dialogs/constrained_web_dialog_ui.h" | 10 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
| 11 #include "ui/web_dialogs/web_dialog_ui.h" | 11 #include "ui/web_dialogs/web_dialog_ui.h" |
| 12 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" | 12 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 class WebDialogDelegate; | 15 class WebDialogDelegate; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // Platform-agnostic base implementation of ConstrainedWebDialogDelegate. | 18 // Platform-agnostic base implementation of ConstrainedWebDialogDelegate. |
| 19 class ConstrainedWebDialogDelegateBase | 19 class ConstrainedWebDialogDelegateBase |
| 20 : public ui::ConstrainedWebDialogDelegate, | 20 : public ConstrainedWebDialogDelegate, |
| 21 public ui::WebDialogWebContentsDelegate { | 21 public ui::WebDialogWebContentsDelegate { |
| 22 public: | 22 public: |
| 23 ConstrainedWebDialogDelegateBase( | 23 ConstrainedWebDialogDelegateBase( |
| 24 Profile* profile, | 24 Profile* profile, |
| 25 ui::WebDialogDelegate* delegate, | 25 ui::WebDialogDelegate* delegate, |
| 26 WebDialogWebContentsDelegate* tab_delegate); | 26 WebDialogWebContentsDelegate* tab_delegate); |
| 27 virtual ~ConstrainedWebDialogDelegateBase(); | 27 virtual ~ConstrainedWebDialogDelegateBase(); |
| 28 | 28 |
| 29 void set_window(ConstrainedWindow* window); | 29 void set_window(ConstrainedWindow* window); |
| 30 bool closed_via_webui() const; | 30 bool closed_via_webui() const; |
| 31 | 31 |
| 32 // ui::ConstrainedWebDialogDelegate interface. | 32 // ConstrainedWebDialogDelegate interface. |
| 33 virtual const ui::WebDialogDelegate* | 33 virtual const ui::WebDialogDelegate* |
| 34 GetWebDialogDelegate() const OVERRIDE; | 34 GetWebDialogDelegate() const OVERRIDE; |
| 35 virtual ui::WebDialogDelegate* GetWebDialogDelegate() OVERRIDE; | 35 virtual ui::WebDialogDelegate* GetWebDialogDelegate() OVERRIDE; |
| 36 virtual void OnDialogCloseFromWebUI() OVERRIDE; | 36 virtual void OnDialogCloseFromWebUI() OVERRIDE; |
| 37 virtual void ReleaseTabContentsOnDialogClose() OVERRIDE; | 37 virtual void ReleaseTabContentsOnDialogClose() OVERRIDE; |
| 38 virtual ConstrainedWindow* window() OVERRIDE; | 38 virtual ConstrainedWindow* window() OVERRIDE; |
| 39 virtual TabContents* tab() OVERRIDE; | 39 virtual TabContents* tab() OVERRIDE; |
| 40 | 40 |
| 41 // WebDialogWebContentsDelegate interface. | 41 // WebDialogWebContentsDelegate interface. |
| 42 virtual void HandleKeyboardEvent( | 42 virtual void HandleKeyboardEvent( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 | 62 |
| 63 // If true, release |tab_| on close instead of destroying it. | 63 // If true, release |tab_| on close instead of destroying it. |
| 64 bool release_tab_on_close_; | 64 bool release_tab_on_close_; |
| 65 | 65 |
| 66 scoped_ptr<WebDialogWebContentsDelegate> override_tab_delegate_; | 66 scoped_ptr<WebDialogWebContentsDelegate> override_tab_delegate_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateBase); | 68 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateBase); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ | 71 #endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_DELEGATE_BASE_H_ |
| OLD | NEW |