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