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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 2649213002: Fix regression of webview loadstart events firing for same page navigations. (Closed)
Patch Set: Created 3 years, 11 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 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 args->SetInteger(webview::kInternalProcessId, 853 args->SetInteger(webview::kInternalProcessId,
854 web_contents()->GetRenderProcessHost()->GetID()); 854 web_contents()->GetRenderProcessHost()->GetID());
855 DispatchEventToView(base::MakeUnique<GuestViewEvent>( 855 DispatchEventToView(base::MakeUnique<GuestViewEvent>(
856 webview::kEventLoadCommit, std::move(args))); 856 webview::kEventLoadCommit, std::move(args)));
857 857
858 find_helper_.CancelAllFindSessions(); 858 find_helper_.CancelAllFindSessions();
859 } 859 }
860 860
861 void WebViewGuest::DidStartNavigation( 861 void WebViewGuest::DidStartNavigation(
862 content::NavigationHandle* navigation_handle) { 862 content::NavigationHandle* navigation_handle) {
863 // loadStart shouldn't be sent for same page navigations.
864 if (navigation_handle->IsSamePage())
865 return;
866
863 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 867 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue());
864 args->SetString(guest_view::kUrl, navigation_handle->GetURL().spec()); 868 args->SetString(guest_view::kUrl, navigation_handle->GetURL().spec());
865 args->SetBoolean(guest_view::kIsTopLevel, navigation_handle->IsInMainFrame()); 869 args->SetBoolean(guest_view::kIsTopLevel, navigation_handle->IsInMainFrame());
866 DispatchEventToView(base::MakeUnique<GuestViewEvent>(webview::kEventLoadStart, 870 DispatchEventToView(base::MakeUnique<GuestViewEvent>(webview::kEventLoadStart,
867 std::move(args))); 871 std::move(args)));
868 } 872 }
869 873
870 void WebViewGuest::RenderProcessGone(base::TerminationStatus status) { 874 void WebViewGuest::RenderProcessGone(base::TerminationStatus status) {
871 // Cancel all find sessions in progress. 875 // Cancel all find sessions in progress.
872 find_helper_.CancelAllFindSessions(); 876 find_helper_.CancelAllFindSessions();
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 1528 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue());
1525 DispatchEventToView(base::MakeUnique<GuestViewEvent>( 1529 DispatchEventToView(base::MakeUnique<GuestViewEvent>(
1526 webview::kEventExitFullscreen, std::move(args))); 1530 webview::kEventExitFullscreen, std::move(args)));
1527 } 1531 }
1528 // Since we changed fullscreen state, sending a Resize message ensures that 1532 // Since we changed fullscreen state, sending a Resize message ensures that
1529 // renderer/ sees the change. 1533 // renderer/ sees the change.
1530 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); 1534 web_contents()->GetRenderViewHost()->GetWidget()->WasResized();
1531 } 1535 }
1532 1536
1533 } // namespace extensions 1537 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698