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

Side by Side Diff: webkit/glue/webview_impl.cc

Issue 7314: Make zomm do full page zoom instead of just text zoom. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2007 Google Inc. All Rights Reserved. 2 * Copyright 2007 Google Inc. All Rights Reserved.
3 * 3 *
4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
5 * 5 *
6 * ***** BEGIN LICENSE BLOCK ***** 6 * ***** BEGIN LICENSE BLOCK *****
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 } 1155 }
1156 1156
1157 void WebViewImpl::MakeTextLarger() { 1157 void WebViewImpl::MakeTextLarger() {
1158 Frame* frame = main_frame()->frame(); 1158 Frame* frame = main_frame()->frame();
1159 double multiplier = std::min(std::pow(kTextSizeMultiplierRatio, 1159 double multiplier = std::min(std::pow(kTextSizeMultiplierRatio,
1160 text_zoom_level_ + 1), 1160 text_zoom_level_ + 1),
1161 kMaxTextSizeMultiplier); 1161 kMaxTextSizeMultiplier);
1162 float zoom_factor = static_cast<float>(multiplier); 1162 float zoom_factor = static_cast<float>(multiplier);
1163 if (zoom_factor != frame->zoomFactor()) { 1163 if (zoom_factor != frame->zoomFactor()) {
1164 ++text_zoom_level_; 1164 ++text_zoom_level_;
1165 frame->setZoomFactor(zoom_factor, true); 1165 frame->setZoomFactor(zoom_factor, false);
1166 } 1166 }
1167 } 1167 }
1168 1168
1169 void WebViewImpl::MakeTextSmaller() { 1169 void WebViewImpl::MakeTextSmaller() {
1170 Frame* frame = main_frame()->frame(); 1170 Frame* frame = main_frame()->frame();
1171 double multiplier = std::max(std::pow(kTextSizeMultiplierRatio, 1171 double multiplier = std::max(std::pow(kTextSizeMultiplierRatio,
1172 text_zoom_level_ - 1), 1172 text_zoom_level_ - 1),
1173 kMinTextSizeMultiplier); 1173 kMinTextSizeMultiplier);
1174 float zoom_factor = static_cast<float>(multiplier); 1174 float zoom_factor = static_cast<float>(multiplier);
1175 if (zoom_factor != frame->zoomFactor()) { 1175 if (zoom_factor != frame->zoomFactor()) {
1176 --text_zoom_level_; 1176 --text_zoom_level_;
1177 frame->setZoomFactor(zoom_factor, true); 1177 frame->setZoomFactor(zoom_factor, false);
1178 } 1178 }
1179 } 1179 }
1180 1180
1181 void WebViewImpl::MakeTextStandardSize() { 1181 void WebViewImpl::MakeTextStandardSize() {
1182 text_zoom_level_ = 0; 1182 text_zoom_level_ = 0;
1183 main_frame()->frame()->setZoomFactor(1.0f, true); 1183 main_frame()->frame()->setZoomFactor(1.0f, false);
1184 } 1184 }
1185 1185
1186 void WebViewImpl::CopyImageAt(int x, int y) { 1186 void WebViewImpl::CopyImageAt(int x, int y) {
1187 IntPoint point = IntPoint(x, y); 1187 IntPoint point = IntPoint(x, y);
1188 1188
1189 Frame* frame = main_frame_->frame(); 1189 Frame* frame = main_frame_->frame();
1190 if (!frame) 1190 if (!frame)
1191 return; 1191 return;
1192 1192
1193 HitTestResult result = 1193 HitTestResult result =
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 } 1533 }
1534 1534
1535 void WebViewImpl::DeleteImageResourceFetcher(ImageResourceFetcher* fetcher) { 1535 void WebViewImpl::DeleteImageResourceFetcher(ImageResourceFetcher* fetcher) {
1536 DCHECK(image_fetchers_.find(fetcher) != image_fetchers_.end()); 1536 DCHECK(image_fetchers_.find(fetcher) != image_fetchers_.end());
1537 image_fetchers_.erase(fetcher); 1537 image_fetchers_.erase(fetcher);
1538 1538
1539 // We're in the callback from the ImageResourceFetcher, best to delay 1539 // We're in the callback from the ImageResourceFetcher, best to delay
1540 // deletion. 1540 // deletion.
1541 MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); 1541 MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher);
1542 } 1542 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698