| OLD | NEW |
| 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 <stddef.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 | 10 |
| 9 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 12 #include "base/bind.h" |
| 11 #include "base/callback.h" | 13 #include "base/callback.h" |
| 12 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 13 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
| 14 #include "components/mus/public/cpp/window.h" | 16 #include "components/mus/public/cpp/window.h" |
| 15 #include "components/mus/public/cpp/window_property.h" | 17 #include "components/mus/public/cpp/window_property.h" |
| 16 #include "components/web_view/frame_tree.h" | 18 #include "components/web_view/frame_tree.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 159 } |
| 158 | 160 |
| 159 double Frame::GatherProgress(int* frame_count) const { | 161 double Frame::GatherProgress(int* frame_count) const { |
| 160 ++(*frame_count); | 162 ++(*frame_count); |
| 161 double progress = progress_; | 163 double progress = progress_; |
| 162 for (const Frame* child : children_) | 164 for (const Frame* child : children_) |
| 163 progress += child->GatherProgress(frame_count); | 165 progress += child->GatherProgress(frame_count); |
| 164 return progress_; | 166 return progress_; |
| 165 } | 167 } |
| 166 | 168 |
| 167 void Frame::Find(int32 request_id, | 169 void Frame::Find(int32_t request_id, |
| 168 const mojo::String& search_text, | 170 const mojo::String& search_text, |
| 169 mojom::FindOptionsPtr options, | 171 mojom::FindOptionsPtr options, |
| 170 bool wrap_within_frame, | 172 bool wrap_within_frame, |
| 171 const FindCallback& callback) { | 173 const FindCallback& callback) { |
| 172 frame_client_->Find(request_id, search_text, options.Pass(), | 174 frame_client_->Find(request_id, search_text, options.Pass(), |
| 173 wrap_within_frame, callback); | 175 wrap_within_frame, callback); |
| 174 } | 176 } |
| 175 | 177 |
| 176 void Frame::StopFinding(bool clear_selection) { | 178 void Frame::StopFinding(bool clear_selection) { |
| 177 frame_client_->StopFinding(clear_selection); | 179 frame_client_->StopFinding(clear_selection); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 if (success) | 287 if (success) |
| 286 embedded_connection_id_ = connection_id; | 288 embedded_connection_id_ = connection_id; |
| 287 if (frame_binding_->is_bound()) | 289 if (frame_binding_->is_bound()) |
| 288 frame_binding_->ResumeIncomingMethodCallProcessing(); | 290 frame_binding_->ResumeIncomingMethodCallProcessing(); |
| 289 } | 291 } |
| 290 | 292 |
| 291 void Frame::OnWillNavigateAck( | 293 void Frame::OnWillNavigateAck( |
| 292 mojom::FrameClient* frame_client, | 294 mojom::FrameClient* frame_client, |
| 293 scoped_ptr<FrameUserData> user_data, | 295 scoped_ptr<FrameUserData> user_data, |
| 294 mus::mojom::WindowTreeClientPtr window_tree_client, | 296 mus::mojom::WindowTreeClientPtr window_tree_client, |
| 295 uint32 app_id, | 297 uint32_t app_id, |
| 296 base::TimeTicks navigation_start_time) { | 298 base::TimeTicks navigation_start_time) { |
| 297 DCHECK(waiting_for_on_will_navigate_ack_); | 299 DCHECK(waiting_for_on_will_navigate_ack_); |
| 298 DVLOG(2) << "Frame::OnWillNavigateAck id=" << id_; | 300 DVLOG(2) << "Frame::OnWillNavigateAck id=" << id_; |
| 299 waiting_for_on_will_navigate_ack_ = false; | 301 waiting_for_on_will_navigate_ack_ = false; |
| 300 ChangeClient(frame_client, user_data.Pass(), window_tree_client.Pass(), | 302 ChangeClient(frame_client, user_data.Pass(), window_tree_client.Pass(), |
| 301 app_id, navigation_start_time); | 303 app_id, navigation_start_time); |
| 302 if (pending_navigate_.get()) | 304 if (pending_navigate_.get()) |
| 303 StartNavigate(pending_navigate_.Pass()); | 305 StartNavigate(pending_navigate_.Pass()); |
| 304 } | 306 } |
| 305 | 307 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 final_update); | 598 final_update); |
| 597 } | 599 } |
| 598 | 600 |
| 599 void Frame::OnFindInPageSelectionUpdated(int32_t request_id, | 601 void Frame::OnFindInPageSelectionUpdated(int32_t request_id, |
| 600 int32_t active_match_ordinal) { | 602 int32_t active_match_ordinal) { |
| 601 tree_->delegate_->OnFindInPageSelectionUpdated(request_id, this, | 603 tree_->delegate_->OnFindInPageSelectionUpdated(request_id, this, |
| 602 active_match_ordinal); | 604 active_match_ordinal); |
| 603 } | 605 } |
| 604 | 606 |
| 605 } // namespace web_view | 607 } // namespace web_view |
| OLD | NEW |