Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: ios/web/web_state/web_state_impl.mm

Issue 2737943003: Moved window opening callback to WebStateDelegate. (Closed)
Patch Set: Self review Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #import "ios/web/web_state/web_state_impl.h" 5 #import "ios/web/web_state/web_state_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 JavaScriptDialogPresenter* presenter = 499 JavaScriptDialogPresenter* presenter =
500 delegate_ ? delegate_->GetJavaScriptDialogPresenter(this) : nullptr; 500 delegate_ ? delegate_->GetJavaScriptDialogPresenter(this) : nullptr;
501 if (!presenter) { 501 if (!presenter) {
502 callback.Run(false, nil); 502 callback.Run(false, nil);
503 return; 503 return;
504 } 504 }
505 presenter->RunJavaScriptDialog(this, origin_url, javascript_dialog_type, 505 presenter->RunJavaScriptDialog(this, origin_url, javascript_dialog_type,
506 message_text, default_prompt_text, callback); 506 message_text, default_prompt_text, callback);
507 } 507 }
508 508
509 WebState* WebStateImpl::CreateNewWebState(const GURL& url,
510 const GURL& opener_url,
511 bool initiated_by_user) {
512 if (delegate_) {
513 return delegate_->CreateNewWebState(this, url, opener_url,
514 initiated_by_user);
515 }
516 return nullptr;
517 }
518
509 void WebStateImpl::OnAuthRequired( 519 void WebStateImpl::OnAuthRequired(
510 NSURLProtectionSpace* protection_space, 520 NSURLProtectionSpace* protection_space,
511 NSURLCredential* proposed_credential, 521 NSURLCredential* proposed_credential,
512 const WebStateDelegate::AuthCallback& callback) { 522 const WebStateDelegate::AuthCallback& callback) {
513 if (delegate_) { 523 if (delegate_) {
514 delegate_->OnAuthRequired(this, protection_space, proposed_credential, 524 delegate_->OnAuthRequired(this, protection_space, proposed_credential,
515 callback); 525 callback);
516 } else { 526 } else {
517 callback.Run(nil, nil); 527 callback.Run(nil, nil);
518 } 528 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 const LoadCommittedDetails& load_details) { 742 const LoadCommittedDetails& load_details) {
733 for (auto& observer : observers_) 743 for (auto& observer : observers_)
734 observer.NavigationItemCommitted(load_details); 744 observer.NavigationItemCommitted(load_details);
735 } 745 }
736 746
737 WebState* WebStateImpl::GetWebState() { 747 WebState* WebStateImpl::GetWebState() {
738 return this; 748 return this;
739 } 749 }
740 750
741 } // namespace web 751 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698