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 <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" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/trace_event/trace_event.h" |
13 #include "components/mus/public/cpp/window.h" | 14 #include "components/mus/public/cpp/window.h" |
14 #include "components/mus/public/cpp/window_property.h" | 15 #include "components/mus/public/cpp/window_property.h" |
15 #include "components/web_view/frame_tree.h" | 16 #include "components/web_view/frame_tree.h" |
16 #include "components/web_view/frame_tree_delegate.h" | 17 #include "components/web_view/frame_tree_delegate.h" |
17 #include "components/web_view/frame_user_data.h" | 18 #include "components/web_view/frame_user_data.h" |
18 #include "components/web_view/frame_utils.h" | 19 #include "components/web_view/frame_utils.h" |
19 #include "mojo/application/public/interfaces/shell.mojom.h" | 20 #include "mojo/application/public/interfaces/shell.mojom.h" |
20 #include "mojo/common/url_type_converters.h" | 21 #include "mojo/common/url_type_converters.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 requested_url, navigation_start_time)); | 370 requested_url, navigation_start_time)); |
370 } | 371 } |
371 | 372 |
372 void Frame::OnCanNavigateFrame( | 373 void Frame::OnCanNavigateFrame( |
373 const GURL& url, | 374 const GURL& url, |
374 base::TimeTicks navigation_start_time, | 375 base::TimeTicks navigation_start_time, |
375 uint32_t app_id, | 376 uint32_t app_id, |
376 mojom::FrameClient* frame_client, | 377 mojom::FrameClient* frame_client, |
377 scoped_ptr<FrameUserData> user_data, | 378 scoped_ptr<FrameUserData> user_data, |
378 mus::mojom::WindowTreeClientPtr window_tree_client) { | 379 mus::mojom::WindowTreeClientPtr window_tree_client) { |
| 380 TRACE_EVENT1("web_view", "Frame::OnCanNavigateFrame", |
| 381 "url", url.possibly_invalid_spec()); |
| 382 |
379 DVLOG(2) << "Frame::OnCanNavigateFrame id=" << id_ | 383 DVLOG(2) << "Frame::OnCanNavigateFrame id=" << id_ |
380 << " equal=" << (AreAppIdsEqual(app_id, app_id_) ? "true" : "false"); | 384 << " equal=" << (AreAppIdsEqual(app_id, app_id_) ? "true" : "false"); |
381 if (AreAppIdsEqual(app_id, app_id_)) { | 385 if (AreAppIdsEqual(app_id, app_id_)) { |
382 // The app currently rendering the frame will continue rendering it. In this | 386 // The app currently rendering the frame will continue rendering it. In this |
383 // case we do not use the WindowTreeClient (because the app has a Window | 387 // case we do not use the WindowTreeClient (because the app has a Window |
384 // already | 388 // already |
385 // and ends up reusing it). | 389 // and ends up reusing it). |
386 DCHECK(!window_tree_client.get()); | 390 DCHECK(!window_tree_client.get()); |
387 ChangeClient(frame_client, user_data.Pass(), window_tree_client.Pass(), | 391 ChangeClient(frame_client, user_data.Pass(), window_tree_client.Pass(), |
388 app_id, navigation_start_time); | 392 app_id, navigation_start_time); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 final_update); | 597 final_update); |
594 } | 598 } |
595 | 599 |
596 void Frame::OnFindInPageSelectionUpdated(int32_t request_id, | 600 void Frame::OnFindInPageSelectionUpdated(int32_t request_id, |
597 int32_t active_match_ordinal) { | 601 int32_t active_match_ordinal) { |
598 tree_->delegate_->OnFindInPageSelectionUpdated(request_id, this, | 602 tree_->delegate_->OnFindInPageSelectionUpdated(request_id, this, |
599 active_match_ordinal); | 603 active_match_ordinal); |
600 } | 604 } |
601 | 605 |
602 } // namespace web_view | 606 } // namespace web_view |
OLD | NEW |