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

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

Issue 1009193003: Make options zoom isolated, match embedder zoom on navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comment. Created 5 years, 8 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 | « no previous file | extensions/browser/guest_view/extension_options/extension_options_guest.cc » ('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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 false /* can_show_bubble */)); 128 false /* can_show_bubble */));
129 int render_process_id = web_contents()->GetRenderProcessHost()->GetID(); 129 int render_process_id = web_contents()->GetRenderProcessHost()->GetID();
130 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); 130 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID();
131 if (zoom_mode_ == ZOOM_MODE_ISOLATED || 131 if (zoom_mode_ == ZOOM_MODE_ISOLATED ||
132 zoom_map->UsesTemporaryZoomLevel(render_process_id, render_view_id)) { 132 zoom_map->UsesTemporaryZoomLevel(render_process_id, render_view_id)) {
133 zoom_map->SetTemporaryZoomLevel(render_process_id, render_view_id, 133 zoom_map->SetTemporaryZoomLevel(render_process_id, render_view_id,
134 zoom_level); 134 zoom_level);
135 } else { 135 } else {
136 if (!entry) { 136 if (!entry) {
137 last_client_ = NULL; 137 last_client_ = NULL;
138 // If we exit without triggering an update, we should clear event_data_,
139 // else we may later trigger a DCHECK(event_data_).
140 event_data_.reset();
138 return false; 141 return false;
139 } 142 }
140 std::string host = 143 std::string host =
141 net::GetHostOrSpecFromURL(content::HostZoomMap::GetURLFromEntry(entry)); 144 net::GetHostOrSpecFromURL(content::HostZoomMap::GetURLFromEntry(entry));
142 zoom_map->SetZoomLevelForHost(host, zoom_level); 145 zoom_map->SetZoomLevelForHost(host, zoom_level);
143 } 146 }
144 147
145 DCHECK(!event_data_); 148 DCHECK(!event_data_);
146 last_client_ = NULL; 149 last_client_ = NULL;
147 return true; 150 return true;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); 349 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID();
347 host_zoom_map_->SetPageScaleFactorIsOneForView( 350 host_zoom_map_->SetPageScaleFactorIsOneForView(
348 render_process_id, render_view_id, is_one); 351 render_process_id, render_view_id, is_one);
349 } 352 }
350 353
351 bool ZoomController::PageScaleFactorIsOne() const { 354 bool ZoomController::PageScaleFactorIsOne() const {
352 return content::HostZoomMap::PageScaleFactorIsOne(web_contents()); 355 return content::HostZoomMap::PageScaleFactorIsOne(web_contents());
353 } 356 }
354 357
355 } // namespace ui_zoom 358 } // namespace ui_zoom
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/guest_view/extension_options/extension_options_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698