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 "ui/views/controls/webview/web_dialog_view.h" | 5 #include "ui/views/controls/webview/web_dialog_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 is_attempting_close_dialog_ = true; | 115 is_attempting_close_dialog_ = true; |
116 web_view_->web_contents()->DispatchBeforeUnload(false); | 116 web_view_->web_contents()->DispatchBeforeUnload(false); |
117 } | 117 } |
118 return false; | 118 return false; |
119 } | 119 } |
120 | 120 |
121 //////////////////////////////////////////////////////////////////////////////// | 121 //////////////////////////////////////////////////////////////////////////////// |
122 // WebDialogView, views::WidgetDelegate implementation: | 122 // WebDialogView, views::WidgetDelegate implementation: |
123 | 123 |
124 bool WebDialogView::CanResize() const { | 124 bool WebDialogView::CanResize() const { |
| 125 if (delegate_) |
| 126 return delegate_->CanResizeDialog(); |
125 return true; | 127 return true; |
126 } | 128 } |
127 | 129 |
128 ui::ModalType WebDialogView::GetModalType() const { | 130 ui::ModalType WebDialogView::GetModalType() const { |
129 return GetDialogModalType(); | 131 return GetDialogModalType(); |
130 } | 132 } |
131 | 133 |
132 base::string16 WebDialogView::GetWindowTitle() const { | 134 base::string16 WebDialogView::GetWindowTitle() const { |
133 if (delegate_) | 135 if (delegate_) |
134 return delegate_->GetDialogTitle(); | 136 return delegate_->GetDialogTitle(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 web_contents->SetDelegate(this); | 348 web_contents->SetDelegate(this); |
347 | 349 |
348 // Set the delegate. This must be done before loading the page. See | 350 // Set the delegate. This must be done before loading the page. See |
349 // the comment above WebDialogUI in its header file for why. | 351 // the comment above WebDialogUI in its header file for why. |
350 WebDialogUI::SetDelegate(web_contents, this); | 352 WebDialogUI::SetDelegate(web_contents, this); |
351 | 353 |
352 web_view_->LoadInitialURL(GetDialogContentURL()); | 354 web_view_->LoadInitialURL(GetDialogContentURL()); |
353 } | 355 } |
354 | 356 |
355 } // namespace views | 357 } // namespace views |
OLD | NEW |