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

Unified Diff: components/zoom/zoom_controller.cc

Issue 2662503002: Convert StartPageService and ZoomController to use the new navigation callbacks. (Closed)
Patch Set: fix unittest 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 side-by-side diff with in-line comments
Download patch
Index: components/zoom/zoom_controller.cc
diff --git a/components/zoom/zoom_controller.cc b/components/zoom/zoom_controller.cc
index a28a01dcef71663f17c63d79aeb66ae9d0ecd8bc..f0c56f18d9e09c1daed7270d368a78af0b1d49fc 100644
--- a/components/zoom/zoom_controller.cc
+++ b/components/zoom/zoom_controller.cc
@@ -9,6 +9,7 @@
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -284,14 +285,16 @@ void ZoomController::ResetZoomModeOnNavigationIfNeeded(const GURL& url) {
zoom_mode_ = ZOOM_MODE_DEFAULT;
}
-void ZoomController::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
- if (details.entry && details.entry->GetPageType() == content::PAGE_TYPE_ERROR)
+void ZoomController::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
+ return;
+
+ if (navigation_handle->IsErrorPage())
content::HostZoomMap::SendErrorPageZoomLevelRefresh(web_contents());
- if (!details.is_in_page)
- ResetZoomModeOnNavigationIfNeeded(params.url);
+ if (!navigation_handle->IsSamePage())
+ ResetZoomModeOnNavigationIfNeeded(navigation_handle->GetURL());
// If the main frame's content has changed, the new page may have a different
// zoom level from the old one.
« chrome/browser/ui/app_list/start_page_service.cc ('K') | « components/zoom/zoom_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698