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 #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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/ui/views/constrained_window_views.h" | 8 #include "chrome/browser/ui/views/constrained_window_views.h" |
9 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" | 9 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" |
10 #include "content/public/browser/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 : public views::WebView, | 72 : public views::WebView, |
73 public ConstrainedWebDialogDelegate, | 73 public ConstrainedWebDialogDelegate, |
74 public views::WidgetDelegate { | 74 public views::WidgetDelegate { |
75 public: | 75 public: |
76 ConstrainedWebDialogDelegateViewViews( | 76 ConstrainedWebDialogDelegateViewViews( |
77 content::BrowserContext* browser_context, | 77 content::BrowserContext* browser_context, |
78 WebDialogDelegate* delegate, | 78 WebDialogDelegate* delegate, |
79 WebDialogWebContentsDelegate* tab_delegate); | 79 WebDialogWebContentsDelegate* tab_delegate); |
80 virtual ~ConstrainedWebDialogDelegateViewViews(); | 80 virtual ~ConstrainedWebDialogDelegateViewViews(); |
81 | 81 |
82 void set_window(ConstrainedWindow* window) { | 82 void set_window(WebContentsModalDialog* window) { |
83 return impl_->set_window(window); | 83 return impl_->set_window(window); |
84 } | 84 } |
85 | 85 |
86 // ConstrainedWebDialogDelegate interface | 86 // ConstrainedWebDialogDelegate interface |
87 virtual const WebDialogDelegate* | 87 virtual const WebDialogDelegate* |
88 GetWebDialogDelegate() const OVERRIDE { | 88 GetWebDialogDelegate() const OVERRIDE { |
89 return impl_->GetWebDialogDelegate(); | 89 return impl_->GetWebDialogDelegate(); |
90 } | 90 } |
91 virtual WebDialogDelegate* GetWebDialogDelegate() OVERRIDE { | 91 virtual WebDialogDelegate* GetWebDialogDelegate() OVERRIDE { |
92 return impl_->GetWebDialogDelegate(); | 92 return impl_->GetWebDialogDelegate(); |
93 } | 93 } |
94 virtual void OnDialogCloseFromWebUI() OVERRIDE { | 94 virtual void OnDialogCloseFromWebUI() OVERRIDE { |
95 return impl_->OnDialogCloseFromWebUI(); | 95 return impl_->OnDialogCloseFromWebUI(); |
96 } | 96 } |
97 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE { | 97 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE { |
98 return impl_->ReleaseWebContentsOnDialogClose(); | 98 return impl_->ReleaseWebContentsOnDialogClose(); |
99 } | 99 } |
100 virtual ConstrainedWindow* GetWindow() OVERRIDE { | 100 virtual WebContentsModalDialog* GetWindow() OVERRIDE { |
101 return impl_->GetWindow(); | 101 return impl_->GetWindow(); |
102 } | 102 } |
103 virtual WebContents* GetWebContents() OVERRIDE { | 103 virtual WebContents* GetWebContents() OVERRIDE { |
104 return impl_->GetWebContents(); | 104 return impl_->GetWebContents(); |
105 } | 105 } |
106 | 106 |
107 // views::WidgetDelegate interface. | 107 // views::WidgetDelegate interface. |
108 virtual views::View* GetInitiallyFocusedView() OVERRIDE { | 108 virtual views::View* GetInitiallyFocusedView() OVERRIDE { |
109 return this; | 109 return this; |
110 } | 110 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( | 192 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( |
193 content::BrowserContext* browser_context, | 193 content::BrowserContext* browser_context, |
194 WebDialogDelegate* delegate, | 194 WebDialogDelegate* delegate, |
195 WebDialogWebContentsDelegate* tab_delegate, | 195 WebDialogWebContentsDelegate* tab_delegate, |
196 content::WebContents* web_contents) { | 196 content::WebContents* web_contents) { |
197 ConstrainedWebDialogDelegateViewViews* constrained_delegate = | 197 ConstrainedWebDialogDelegateViewViews* constrained_delegate = |
198 new ConstrainedWebDialogDelegateViewViews( | 198 new ConstrainedWebDialogDelegateViewViews( |
199 browser_context, delegate, tab_delegate); | 199 browser_context, delegate, tab_delegate); |
200 ConstrainedWindow* constrained_window = | 200 WebContentsModalDialog* web_contents_modal_dialog = |
201 new ConstrainedWindowViews(web_contents, constrained_delegate); | 201 new ConstrainedWindowViews(web_contents, constrained_delegate); |
202 constrained_delegate->set_window(constrained_window); | 202 constrained_delegate->set_window(web_contents_modal_dialog); |
203 return constrained_delegate; | 203 return constrained_delegate; |
204 } | 204 } |
OLD | NEW |