Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm |
| diff --git a/ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm b/ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2afd6df836059df1a5a675820a57bafa70f9d666 |
| --- /dev/null |
| +++ b/ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm |
| @@ -0,0 +1,28 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.h" |
| + |
| +#import "ios/chrome/browser/find_in_page/find_in_page_model.h" |
| +#import "ios/clean/chrome/browser/ui/find_in_page/find_in_page_consumer.h" |
| +#include "ios/shared/chrome/browser/tabs/web_state_list.h" |
| +#include "ios/web/public/web_state/web_state.h" |
| + |
| +FindInPageMediator::FindInPageMediator(WebStateList* web_state_list, |
| + id<FindInPageMediatorDelegate> delegate) |
| + : web_state_list_(web_state_list), consumer_(nil), delegate_(delegate) { |
| + DCHECK(web_state_list_); |
| + DCHECK(delegate_); |
| +} |
| + |
| +FindInPageMediator::~FindInPageMediator() {} |
| + |
| +void FindInPageMediator::OnFindInPageResultsAvailable(FindInPageModel* model) { |
| + NSLog(@"%lu of %lu", model.currentIndex, model.matches); |
|
lpromero
2017/03/14 17:17:56
Remove.
|
| + if (!consumer_) { |
| + [delegate_ createConsumer]; |
| + } |
| + DCHECK(consumer_); |
| + [consumer_ setCurrentMatch:model.currentIndex ofTotalMatches:model.matches]; |
| +} |