| 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 "components/reading_list/ios/reading_list_model_bridge_observer.h" | 5 #import "components/reading_list/ios/reading_list_model_bridge_observer.h" |
| 6 | 6 |
| 7 #include "components/reading_list/core/reading_list_entry.h" | 7 #include "components/reading_list/core/reading_list_entry.h" |
| 8 #include "components/reading_list/core/reading_list_model.h" | 8 #include "components/reading_list/core/reading_list_model.h" |
| 9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." |
| 12 #endif |
| 13 |
| 10 ReadingListModelBridge::ReadingListModelBridge( | 14 ReadingListModelBridge::ReadingListModelBridge( |
| 11 id<ReadingListModelBridgeObserver> observer, | 15 id<ReadingListModelBridgeObserver> observer, |
| 12 ReadingListModel* model) | 16 ReadingListModel* model) |
| 13 : observer_(observer), model_(model) { | 17 : observer_(observer), model_(model) { |
| 14 DCHECK(model); | 18 DCHECK(model); |
| 15 model_->AddObserver(this); | 19 model_->AddObserver(this); |
| 16 } | 20 } |
| 17 | 21 |
| 18 ReadingListModelBridge::~ReadingListModelBridge() { | 22 ReadingListModelBridge::~ReadingListModelBridge() { |
| 19 if (model_) { | 23 if (model_) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 107 } |
| 104 | 108 |
| 105 void ReadingListModelBridge::ReadingListWillUpdateEntry( | 109 void ReadingListModelBridge::ReadingListWillUpdateEntry( |
| 106 const ReadingListModel* model, | 110 const ReadingListModel* model, |
| 107 const GURL& url) { | 111 const GURL& url) { |
| 108 if ([observer_ | 112 if ([observer_ |
| 109 respondsToSelector:@selector(readingListModel:willUpdateEntry:)]) { | 113 respondsToSelector:@selector(readingListModel:willUpdateEntry:)]) { |
| 110 [observer_ readingListModel:model willUpdateEntry:url]; | 114 [observer_ readingListModel:model willUpdateEntry:url]; |
| 111 } | 115 } |
| 112 } | 116 } |
| OLD | NEW |