| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/web/public/web_state/web_state_delegate.h" |
| 6 |
| 7 #import "ios/web/public/web_state/web_state.h" |
| 8 |
| 9 namespace web { |
| 10 |
| 11 WebStateDelegate::WebStateDelegate() {} |
| 12 |
| 13 WebStateDelegate::~WebStateDelegate() { |
| 14 while (!attached_states_.empty()) { |
| 15 WebState* web_state = *attached_states_.begin(); |
| 16 web_state->SetDelegate(nullptr); |
| 17 } |
| 18 DCHECK(attached_states_.empty()); |
| 19 } |
| 20 |
| 21 void WebStateDelegate::LoadProgressChanged(WebState*, double) {} |
| 22 |
| 23 void WebStateDelegate::Attach(WebState* source) { |
| 24 DCHECK(attached_states_.find(source) == attached_states_.end()); |
| 25 attached_states_.insert(source); |
| 26 } |
| 27 |
| 28 void WebStateDelegate::Detach(WebState* source) { |
| 29 DCHECK(attached_states_.find(source) != attached_states_.end()); |
| 30 attached_states_.erase(source); |
| 31 } |
| 32 |
| 33 } // web |
| OLD | NEW |