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/ui/zoom/zoom_controller.h" | 5 #include "components/ui/zoom/zoom_controller.h" |
6 | 6 |
7 #include "components/ui/zoom/zoom_event_manager.h" | 7 #include "components/ui/zoom/zoom_event_manager.h" |
8 #include "components/ui/zoom/zoom_observer.h" | 8 #include "components/ui/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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 double zoom_level = GetZoomLevel(); | 334 double zoom_level = GetZoomLevel(); |
335 // We never show a zoom bubble for an event we didn't generate. | 335 // We never show a zoom bubble for an event we didn't generate. |
336 ZoomChangedEventData zoom_change_data(web_contents(), zoom_level, | 336 ZoomChangedEventData zoom_change_data(web_contents(), zoom_level, |
337 zoom_level, zoom_mode_, | 337 zoom_level, zoom_mode_, |
338 false /* can_show_bubble */); | 338 false /* can_show_bubble */); |
339 FOR_EACH_OBSERVER(ZoomObserver, observers_, | 339 FOR_EACH_OBSERVER(ZoomObserver, observers_, |
340 OnZoomChanged(zoom_change_data)); | 340 OnZoomChanged(zoom_change_data)); |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
| 344 void ZoomController::SetPageScaleFactorIsOneForTesting(bool is_one) { |
| 345 int render_process_id = web_contents()->GetRenderProcessHost()->GetID(); |
| 346 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); |
| 347 host_zoom_map_->SetPageScaleFactorIsOneForView( |
| 348 render_process_id, render_view_id, is_one); |
| 349 } |
| 350 |
| 351 bool ZoomController::PageScaleFactorIsOne() const { |
| 352 return content::HostZoomMap::PageScaleFactorIsOne(web_contents()); |
| 353 } |
| 354 |
344 } // namespace ui_zoom | 355 } // namespace ui_zoom |
OLD | NEW |