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

Side by Side Diff: components/web_view/frame.cc

Issue 1371773003: mandoline: Add find in page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT to fix patch failure. Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "components/web_view/frame.h" 5 #include "components/web_view/frame.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 double Frame::GatherProgress(int* frame_count) const { 156 double Frame::GatherProgress(int* frame_count) const {
157 ++(*frame_count); 157 ++(*frame_count);
158 double progress = progress_; 158 double progress = progress_;
159 for (const Frame* child : children_) 159 for (const Frame* child : children_)
160 progress += child->GatherProgress(frame_count); 160 progress += child->GatherProgress(frame_count);
161 return progress_; 161 return progress_;
162 } 162 }
163 163
164 void Frame::Find(int32 request_id, const mojo::String& search_text,
165 const FindCallback& callback) {
166 frame_client_->Find(request_id, search_text, callback);
167 }
168
169 void Frame::StopFinding(bool clear_selection) {
170 frame_client_->StopFinding(clear_selection);
171 }
172
173 void Frame::ScopeStringMatches(int32_t request_id,
174 const mojo::String& search_text,
175 bool reset) {
176 frame_client_->ScopeStringMatches(request_id, search_text, reset);
177 }
178
179 void Frame::CancelPendingScopingEffort() {
180 frame_client_->CancelPendingScopingEffort();
181 }
182
164 void Frame::InitClient(ClientType client_type, 183 void Frame::InitClient(ClientType client_type,
165 scoped_ptr<FrameUserDataAndBinding> data_and_binding, 184 scoped_ptr<FrameUserDataAndBinding> data_and_binding,
166 mojo::ViewTreeClientPtr view_tree_client, 185 mojo::ViewTreeClientPtr view_tree_client,
167 mojo::InterfaceRequest<mojom::Frame> frame_request) { 186 mojo::InterfaceRequest<mojom::Frame> frame_request) {
168 if (client_type == ClientType::EXISTING_FRAME_NEW_APP && 187 if (client_type == ClientType::EXISTING_FRAME_NEW_APP &&
169 view_tree_client.get()) { 188 view_tree_client.get()) {
170 embedded_connection_id_ = kInvalidConnectionId; 189 embedded_connection_id_ = kInvalidConnectionId;
171 embed_weak_ptr_factory_.InvalidateWeakPtrs(); 190 embed_weak_ptr_factory_.InvalidateWeakPtrs();
172 view_->Embed( 191 view_->Embed(
173 view_tree_client.Pass(), mojo::ViewTree::ACCESS_POLICY_DEFAULT, 192 view_tree_client.Pass(), mojo::ViewTree::ACCESS_POLICY_DEFAULT,
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 void Frame::DispatchLoadEventToParent() { 555 void Frame::DispatchLoadEventToParent() {
537 if (parent_ && !AreAppIdsEqual(app_id_, parent_->app_id_)) { 556 if (parent_ && !AreAppIdsEqual(app_id_, parent_->app_id_)) {
538 // Send notification to fire a load event in the parent, if the parent is in 557 // Send notification to fire a load event in the parent, if the parent is in
539 // a different app. If the parent is in the same app, we assume that the app 558 // a different app. If the parent is in the same app, we assume that the app
540 // itself handles firing load event directly and no notification is needed 559 // itself handles firing load event directly and no notification is needed
541 // from our side. 560 // from our side.
542 parent_->NotifyDispatchFrameLoadEvent(this); 561 parent_->NotifyDispatchFrameLoadEvent(this);
543 } 562 }
544 } 563 }
545 564
565 void Frame::OnReportFindInFrameMatchCount(int32_t request_id,
566 int32_t count,
567 bool final_update) {
568 tree_->delegate_->OnReportFindInFrameMatchCount(request_id,
569 this,
570 count,
571 final_update);
572 }
573
574 void Frame::OnReportFindInPageSelection(int32_t request_id,
575 int32_t active_match_ordinal) {
576 tree_->delegate_->OnReportFindInPageSelection(request_id,
577 this,
578 active_match_ordinal);
579 }
580
546 } // namespace web_view 581 } // namespace web_view
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698