| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/public/web_state/web_state_delegate.h" | 5 #import "ios/web/public/web_state/web_state_delegate.h" |
| 6 | 6 |
| 7 #import "ios/web/public/web_state/web_state.h" | 7 #import "ios/web/public/web_state/web_state.h" |
| 8 | 8 |
| 9 namespace web { | 9 namespace web { |
| 10 | 10 |
| 11 WebStateDelegate::WebStateDelegate() {} | 11 WebStateDelegate::WebStateDelegate() {} |
| 12 | 12 |
| 13 WebStateDelegate::~WebStateDelegate() { | 13 WebStateDelegate::~WebStateDelegate() { |
| 14 while (!attached_states_.empty()) { | 14 while (!attached_states_.empty()) { |
| 15 WebState* web_state = *attached_states_.begin(); | 15 WebState* web_state = *attached_states_.begin(); |
| 16 web_state->SetDelegate(nullptr); | 16 web_state->SetDelegate(nullptr); |
| 17 } | 17 } |
| 18 DCHECK(attached_states_.empty()); | 18 DCHECK(attached_states_.empty()); |
| 19 } | 19 } |
| 20 | 20 |
| 21 WebState* WebStateDelegate::CreateNewWebState(WebState* source, |
| 22 const GURL& url, |
| 23 const GURL& opener_url, |
| 24 bool initiated_by_user) { |
| 25 return nullptr; |
| 26 } |
| 27 |
| 21 WebState* WebStateDelegate::OpenURLFromWebState( | 28 WebState* WebStateDelegate::OpenURLFromWebState( |
| 22 WebState*, | 29 WebState*, |
| 23 const WebState::OpenURLParams&) { | 30 const WebState::OpenURLParams&) { |
| 24 return nullptr; | 31 return nullptr; |
| 25 } | 32 } |
| 26 | 33 |
| 27 bool WebStateDelegate::HandleContextMenu(WebState*, const ContextMenuParams&) { | 34 bool WebStateDelegate::HandleContextMenu(WebState*, const ContextMenuParams&) { |
| 28 return false; | 35 return false; |
| 29 } | 36 } |
| 30 | 37 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 50 DCHECK(attached_states_.find(source) == attached_states_.end()); | 57 DCHECK(attached_states_.find(source) == attached_states_.end()); |
| 51 attached_states_.insert(source); | 58 attached_states_.insert(source); |
| 52 } | 59 } |
| 53 | 60 |
| 54 void WebStateDelegate::Detach(WebState* source) { | 61 void WebStateDelegate::Detach(WebState* source) { |
| 55 DCHECK(attached_states_.find(source) != attached_states_.end()); | 62 DCHECK(attached_states_.find(source) != attached_states_.end()); |
| 56 attached_states_.erase(source); | 63 attached_states_.erase(source); |
| 57 } | 64 } |
| 58 | 65 |
| 59 } // web | 66 } // web |
| OLD | NEW |