OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" | 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" |
6 | 6 |
7 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 7 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
8 #include "content/public/browser/notification_source.h" | 8 #include "content/public/browser/notification_source.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class ConstrainedWebDialogDelegateGtk : public ConstrainedWindowGtkDelegate, | 21 class ConstrainedWebDialogDelegateGtk : public ConstrainedWindowGtkDelegate, |
22 public ConstrainedWebDialogDelegate { | 22 public ConstrainedWebDialogDelegate { |
23 public: | 23 public: |
24 ConstrainedWebDialogDelegateGtk( | 24 ConstrainedWebDialogDelegateGtk( |
25 content::BrowserContext* browser_context, | 25 content::BrowserContext* browser_context, |
26 WebDialogDelegate* delegate, | 26 WebDialogDelegate* delegate, |
27 WebDialogWebContentsDelegate* tab_delegate); | 27 WebDialogWebContentsDelegate* tab_delegate); |
28 | 28 |
29 virtual ~ConstrainedWebDialogDelegateGtk() {} | 29 virtual ~ConstrainedWebDialogDelegateGtk() {} |
30 | 30 |
31 void set_window(ConstrainedWindow* window) { | 31 void set_window(WebContentsModalDialog* dialog) { |
32 return impl_->set_window(window); | 32 return impl_->set_window(dialog); |
33 } | 33 } |
34 | 34 |
35 // ConstrainedWebDialogDelegate interface | 35 // ConstrainedWebDialogDelegate interface |
36 virtual const WebDialogDelegate* | 36 virtual const WebDialogDelegate* |
37 GetWebDialogDelegate() const OVERRIDE { | 37 GetWebDialogDelegate() const OVERRIDE { |
38 return impl_->GetWebDialogDelegate(); | 38 return impl_->GetWebDialogDelegate(); |
39 } | 39 } |
40 virtual WebDialogDelegate* GetWebDialogDelegate() OVERRIDE { | 40 virtual WebDialogDelegate* GetWebDialogDelegate() OVERRIDE { |
41 return impl_->GetWebDialogDelegate(); | 41 return impl_->GetWebDialogDelegate(); |
42 } | 42 } |
43 virtual void OnDialogCloseFromWebUI() OVERRIDE { | 43 virtual void OnDialogCloseFromWebUI() OVERRIDE { |
44 return impl_->OnDialogCloseFromWebUI(); | 44 return impl_->OnDialogCloseFromWebUI(); |
45 } | 45 } |
46 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE { | 46 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE { |
47 return impl_->ReleaseWebContentsOnDialogClose(); | 47 return impl_->ReleaseWebContentsOnDialogClose(); |
48 } | 48 } |
49 virtual ConstrainedWindow* GetWindow() OVERRIDE { | 49 virtual WebContentsModalDialog* GetWindow() OVERRIDE { |
50 return impl_->GetWindow(); | 50 return impl_->GetWindow(); |
51 } | 51 } |
52 virtual WebContents* GetWebContents() OVERRIDE { | 52 virtual WebContents* GetWebContents() OVERRIDE { |
53 return impl_->GetWebContents(); | 53 return impl_->GetWebContents(); |
54 } | 54 } |
55 | 55 |
56 // ConstrainedWindowGtkDelegate interface | 56 // ConstrainedWindowGtkDelegate interface |
57 virtual GtkWidget* GetWidgetRoot() OVERRIDE { | 57 virtual GtkWidget* GetWidgetRoot() OVERRIDE { |
58 return GetWebContents()->GetView()->GetNativeView(); | 58 return GetWebContents()->GetView()->GetNativeView(); |
59 } | 59 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( | 94 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( |
95 content::BrowserContext* browser_context, | 95 content::BrowserContext* browser_context, |
96 WebDialogDelegate* delegate, | 96 WebDialogDelegate* delegate, |
97 WebDialogWebContentsDelegate* tab_delegate, | 97 WebDialogWebContentsDelegate* tab_delegate, |
98 content::WebContents* web_contents) { | 98 content::WebContents* web_contents) { |
99 ConstrainedWebDialogDelegateGtk* constrained_delegate = | 99 ConstrainedWebDialogDelegateGtk* constrained_delegate = |
100 new ConstrainedWebDialogDelegateGtk( | 100 new ConstrainedWebDialogDelegateGtk( |
101 browser_context, delegate, tab_delegate); | 101 browser_context, delegate, tab_delegate); |
102 ConstrainedWindow* constrained_window = | 102 WebContentsModalDialog* web_contents_modal_dialog = |
103 new ConstrainedWindowGtk(web_contents, constrained_delegate); | 103 new ConstrainedWindowGtk(web_contents, constrained_delegate); |
104 constrained_delegate->set_window(constrained_window); | 104 constrained_delegate->set_window(web_contents_modal_dialog); |
105 return constrained_delegate; | 105 return constrained_delegate; |
106 } | 106 } |
OLD | NEW |