| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/zoom/zoom_controller.h" | 5 #include "components/zoom/zoom_controller.h" |
| 6 | 6 |
| 7 #include "components/zoom/zoom_event_manager.h" | 7 #include "components/zoom/zoom_event_manager.h" |
| 8 #include "components/zoom/zoom_observer.h" | 8 #include "components/zoom/zoom_observer.h" |
| 9 #include "content/public/browser/host_zoom_map.h" | 9 #include "content/public/browser/host_zoom_map.h" |
| 10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 286 } |
| 287 | 287 |
| 288 void ZoomController::DidFinishNavigation( | 288 void ZoomController::DidFinishNavigation( |
| 289 content::NavigationHandle* navigation_handle) { | 289 content::NavigationHandle* navigation_handle) { |
| 290 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) | 290 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) |
| 291 return; | 291 return; |
| 292 | 292 |
| 293 if (navigation_handle->IsErrorPage()) | 293 if (navigation_handle->IsErrorPage()) |
| 294 content::HostZoomMap::SendErrorPageZoomLevelRefresh(web_contents()); | 294 content::HostZoomMap::SendErrorPageZoomLevelRefresh(web_contents()); |
| 295 | 295 |
| 296 if (!navigation_handle->IsSamePage()) | 296 if (!navigation_handle->IsSameDocument()) |
| 297 ResetZoomModeOnNavigationIfNeeded(navigation_handle->GetURL()); | 297 ResetZoomModeOnNavigationIfNeeded(navigation_handle->GetURL()); |
| 298 | 298 |
| 299 // If the main frame's content has changed, the new page may have a different | 299 // If the main frame's content has changed, the new page may have a different |
| 300 // zoom level from the old one. | 300 // zoom level from the old one. |
| 301 UpdateState(std::string()); | 301 UpdateState(std::string()); |
| 302 DCHECK(!event_data_); | 302 DCHECK(!event_data_); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void ZoomController::WebContentsDestroyed() { | 305 void ZoomController::WebContentsDestroyed() { |
| 306 // At this point we should no longer be sending any zoom events with this | 306 // At this point we should no longer be sending any zoom events with this |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); | 369 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); |
| 370 host_zoom_map_->SetPageScaleFactorIsOneForView(render_process_id, | 370 host_zoom_map_->SetPageScaleFactorIsOneForView(render_process_id, |
| 371 render_view_id, is_one); | 371 render_view_id, is_one); |
| 372 } | 372 } |
| 373 | 373 |
| 374 bool ZoomController::PageScaleFactorIsOne() const { | 374 bool ZoomController::PageScaleFactorIsOne() const { |
| 375 return content::HostZoomMap::PageScaleFactorIsOne(web_contents()); | 375 return content::HostZoomMap::PageScaleFactorIsOne(web_contents()); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace zoom | 378 } // namespace zoom |
| OLD | NEW |