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

Side by Side Diff: components/ui/zoom/zoom_controller.cc

Issue 954923005: Make command-zero reset page scale in addition to zoom level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again again Created 5 years, 9 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
« no previous file with comments | « components/ui/zoom/zoom_controller.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/ui/zoom/zoom_controller.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698