| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 bool* was_blocked) { | 328 bool* was_blocked) { |
| 329 if (delegate_ && delegate_->HandleAddNewContents( | 329 if (delegate_ && delegate_->HandleAddNewContents( |
| 330 source, new_contents, disposition, initial_pos, user_gesture)) { | 330 source, new_contents, disposition, initial_pos, user_gesture)) { |
| 331 return; | 331 return; |
| 332 } | 332 } |
| 333 WebDialogWebContentsDelegate::AddNewContents( | 333 WebDialogWebContentsDelegate::AddNewContents( |
| 334 source, new_contents, disposition, initial_pos, user_gesture, | 334 source, new_contents, disposition, initial_pos, user_gesture, |
| 335 was_blocked); | 335 was_blocked); |
| 336 } | 336 } |
| 337 | 337 |
| 338 void WebDialogView::LoadingStateChanged(content::WebContents* source) { | 338 void WebDialogView::LoadingStateChanged(content::WebContents* source, |
| 339 bool to_different_document) { |
| 339 if (delegate_) | 340 if (delegate_) |
| 340 delegate_->OnLoadingStateChanged(source); | 341 delegate_->OnLoadingStateChanged(source); |
| 341 } | 342 } |
| 342 | 343 |
| 343 void WebDialogView::BeforeUnloadFired(content::WebContents* tab, | 344 void WebDialogView::BeforeUnloadFired(content::WebContents* tab, |
| 344 bool proceed, | 345 bool proceed, |
| 345 bool* proceed_to_fire_unload) { | 346 bool* proceed_to_fire_unload) { |
| 346 before_unload_fired_ = true; | 347 before_unload_fired_ = true; |
| 347 *proceed_to_fire_unload = proceed; | 348 *proceed_to_fire_unload = proceed; |
| 348 } | 349 } |
| 349 | 350 |
| 350 //////////////////////////////////////////////////////////////////////////////// | 351 //////////////////////////////////////////////////////////////////////////////// |
| 351 // WebDialogView, private: | 352 // WebDialogView, private: |
| 352 | 353 |
| 353 void WebDialogView::InitDialog() { | 354 void WebDialogView::InitDialog() { |
| 354 content::WebContents* web_contents = web_view_->GetWebContents(); | 355 content::WebContents* web_contents = web_view_->GetWebContents(); |
| 355 if (web_contents->GetDelegate() == this) | 356 if (web_contents->GetDelegate() == this) |
| 356 return; | 357 return; |
| 357 | 358 |
| 358 web_contents->SetDelegate(this); | 359 web_contents->SetDelegate(this); |
| 359 | 360 |
| 360 // Set the delegate. This must be done before loading the page. See | 361 // Set the delegate. This must be done before loading the page. See |
| 361 // the comment above WebDialogUI in its header file for why. | 362 // the comment above WebDialogUI in its header file for why. |
| 362 WebDialogUI::SetDelegate(web_contents, this); | 363 WebDialogUI::SetDelegate(web_contents, this); |
| 363 | 364 |
| 364 web_view_->LoadInitialURL(GetDialogContentURL()); | 365 web_view_->LoadInitialURL(GetDialogContentURL()); |
| 365 } | 366 } |
| 366 | 367 |
| 367 } // namespace views | 368 } // namespace views |
| OLD | NEW |