| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/guest_view/web_view/web_view_guest.h" | 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 args->SetInteger(webview::kInternalProcessId, | 884 args->SetInteger(webview::kInternalProcessId, |
| 885 web_contents()->GetRenderProcessHost()->GetID()); | 885 web_contents()->GetRenderProcessHost()->GetID()); |
| 886 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 886 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
| 887 webview::kEventLoadCommit, std::move(args))); | 887 webview::kEventLoadCommit, std::move(args))); |
| 888 | 888 |
| 889 find_helper_.CancelAllFindSessions(); | 889 find_helper_.CancelAllFindSessions(); |
| 890 } | 890 } |
| 891 | 891 |
| 892 void WebViewGuest::DidStartNavigation( | 892 void WebViewGuest::DidStartNavigation( |
| 893 content::NavigationHandle* navigation_handle) { | 893 content::NavigationHandle* navigation_handle) { |
| 894 // loadStart shouldn't be sent for same page navigations. | 894 // loadStart shouldn't be sent for same document navigations. |
| 895 if (navigation_handle->IsSamePage()) | 895 if (navigation_handle->IsSameDocument()) |
| 896 return; | 896 return; |
| 897 | 897 |
| 898 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 898 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 899 args->SetString(guest_view::kUrl, navigation_handle->GetURL().spec()); | 899 args->SetString(guest_view::kUrl, navigation_handle->GetURL().spec()); |
| 900 args->SetBoolean(guest_view::kIsTopLevel, navigation_handle->IsInMainFrame()); | 900 args->SetBoolean(guest_view::kIsTopLevel, navigation_handle->IsInMainFrame()); |
| 901 DispatchEventToView(base::MakeUnique<GuestViewEvent>(webview::kEventLoadStart, | 901 DispatchEventToView(base::MakeUnique<GuestViewEvent>(webview::kEventLoadStart, |
| 902 std::move(args))); | 902 std::move(args))); |
| 903 } | 903 } |
| 904 | 904 |
| 905 void WebViewGuest::RenderProcessGone(base::TerminationStatus status) { | 905 void WebViewGuest::RenderProcessGone(base::TerminationStatus status) { |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1558 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1558 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 1559 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 1559 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
| 1560 webview::kEventExitFullscreen, std::move(args))); | 1560 webview::kEventExitFullscreen, std::move(args))); |
| 1561 } | 1561 } |
| 1562 // Since we changed fullscreen state, sending a Resize message ensures that | 1562 // Since we changed fullscreen state, sending a Resize message ensures that |
| 1563 // renderer/ sees the change. | 1563 // renderer/ sees the change. |
| 1564 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1564 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
| 1565 } | 1565 } |
| 1566 | 1566 |
| 1567 } // namespace extensions | 1567 } // namespace extensions |
| OLD | NEW |