Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: ios/clean/chrome/browser/ui/find_in_page/find_in_page_mediator.mm

Issue 2737563006: [ios] Adds support for Find in Page to the new architecture. (Closed)
Patch Set: Partially hook up the text field Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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];
+}

Powered by Google App Engine
This is Rietveld 408576698