| 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, | 21 WebState* WebStateDelegate::CreateNewWebState(WebState* source, |
| 22 const GURL& url, | 22 const GURL& url, |
| 23 const GURL& opener_url, | 23 const GURL& opener_url, |
| 24 bool initiated_by_user) { | 24 bool initiated_by_user) { |
| 25 return nullptr; | 25 return nullptr; |
| 26 } | 26 } |
| 27 | 27 |
| 28 void WebStateDelegate::CloseWebState(WebState* source) {} |
| 29 |
| 28 WebState* WebStateDelegate::OpenURLFromWebState( | 30 WebState* WebStateDelegate::OpenURLFromWebState( |
| 29 WebState*, | 31 WebState*, |
| 30 const WebState::OpenURLParams&) { | 32 const WebState::OpenURLParams&) { |
| 31 return nullptr; | 33 return nullptr; |
| 32 } | 34 } |
| 33 | 35 |
| 34 bool WebStateDelegate::HandleContextMenu(WebState*, const ContextMenuParams&) { | 36 bool WebStateDelegate::HandleContextMenu(WebState*, const ContextMenuParams&) { |
| 35 return false; | 37 return false; |
| 36 } | 38 } |
| 37 | 39 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 DCHECK(attached_states_.find(source) == attached_states_.end()); | 59 DCHECK(attached_states_.find(source) == attached_states_.end()); |
| 58 attached_states_.insert(source); | 60 attached_states_.insert(source); |
| 59 } | 61 } |
| 60 | 62 |
| 61 void WebStateDelegate::Detach(WebState* source) { | 63 void WebStateDelegate::Detach(WebState* source) { |
| 62 DCHECK(attached_states_.find(source) != attached_states_.end()); | 64 DCHECK(attached_states_.find(source) != attached_states_.end()); |
| 63 attached_states_.erase(source); | 65 attached_states_.erase(source); |
| 64 } | 66 } |
| 65 | 67 |
| 66 } // web | 68 } // web |
| OLD | NEW |