| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // WebDialogView, views::WidgetDelegate implementation: | 128 // WebDialogView, views::WidgetDelegate implementation: |
| 129 | 129 |
| 130 bool WebDialogView::CanResize() const { | 130 bool WebDialogView::CanResize() const { |
| 131 return true; | 131 return true; |
| 132 } | 132 } |
| 133 | 133 |
| 134 ui::ModalType WebDialogView::GetModalType() const { | 134 ui::ModalType WebDialogView::GetModalType() const { |
| 135 return GetDialogModalType(); | 135 return GetDialogModalType(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 string16 WebDialogView::GetWindowTitle() const { | 138 base::string16 WebDialogView::GetWindowTitle() const { |
| 139 if (delegate_) | 139 if (delegate_) |
| 140 return delegate_->GetDialogTitle(); | 140 return delegate_->GetDialogTitle(); |
| 141 return string16(); | 141 return base::string16(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 std::string WebDialogView::GetWindowName() const { | 144 std::string WebDialogView::GetWindowName() const { |
| 145 if (delegate_) | 145 if (delegate_) |
| 146 return delegate_->GetDialogName(); | 146 return delegate_->GetDialogName(); |
| 147 return std::string(); | 147 return std::string(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void WebDialogView::WindowClosing() { | 150 void WebDialogView::WindowClosing() { |
| 151 // If we still have a delegate that means we haven't notified it of the | 151 // If we still have a delegate that means we haven't notified it of the |
| (...skipping 29 matching lines...) Expand all Loading... |
| 181 | 181 |
| 182 //////////////////////////////////////////////////////////////////////////////// | 182 //////////////////////////////////////////////////////////////////////////////// |
| 183 // WebDialogDelegate implementation: | 183 // WebDialogDelegate implementation: |
| 184 | 184 |
| 185 ui::ModalType WebDialogView::GetDialogModalType() const { | 185 ui::ModalType WebDialogView::GetDialogModalType() const { |
| 186 if (delegate_) | 186 if (delegate_) |
| 187 return delegate_->GetDialogModalType(); | 187 return delegate_->GetDialogModalType(); |
| 188 return ui::MODAL_TYPE_NONE; | 188 return ui::MODAL_TYPE_NONE; |
| 189 } | 189 } |
| 190 | 190 |
| 191 string16 WebDialogView::GetDialogTitle() const { | 191 base::string16 WebDialogView::GetDialogTitle() const { |
| 192 return GetWindowTitle(); | 192 return GetWindowTitle(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 GURL WebDialogView::GetDialogContentURL() const { | 195 GURL WebDialogView::GetDialogContentURL() const { |
| 196 if (delegate_) | 196 if (delegate_) |
| 197 return delegate_->GetDialogContentURL(); | 197 return delegate_->GetDialogContentURL(); |
| 198 return GURL(); | 198 return GURL(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void WebDialogView::GetWebUIMessageHandlers( | 201 void WebDialogView::GetWebUIMessageHandlers( |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 web_contents->SetDelegate(this); | 358 web_contents->SetDelegate(this); |
| 359 | 359 |
| 360 // Set the delegate. This must be done before loading the page. See | 360 // Set the delegate. This must be done before loading the page. See |
| 361 // the comment above WebDialogUI in its header file for why. | 361 // the comment above WebDialogUI in its header file for why. |
| 362 WebDialogUI::SetDelegate(web_contents, this); | 362 WebDialogUI::SetDelegate(web_contents, this); |
| 363 | 363 |
| 364 web_view_->LoadInitialURL(GetDialogContentURL()); | 364 web_view_->LoadInitialURL(GetDialogContentURL()); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace views | 367 } // namespace views |
| OLD | NEW |