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

Unified Diff: webkit/glue/webview_impl.cc

Issue 7320: Rename various text zoom related stuff to be more generic, since we now can... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | webkit/tools/test_shell/event_sending_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webview_impl.cc
===================================================================
--- webkit/glue/webview_impl.cc (revision 3359)
+++ webkit/glue/webview_impl.cc (working copy)
@@ -140,7 +140,7 @@
#ifndef NDEBUG
new_navigation_loader_(NULL),
#endif
- text_zoom_level_(0),
+ zoom_level_(0),
context_menu_allowed_(false),
doing_drag_and_drop_(false),
suppress_next_keypress_event_(false),
@@ -1158,33 +1158,37 @@
return webkit_glue::StringToStdWString(encoding_name);
}
-void WebViewImpl::MakeTextLarger() {
+void WebViewImpl::ZoomIn(bool text_only) {
Frame* frame = main_frame()->frame();
double multiplier = std::min(std::pow(kTextSizeMultiplierRatio,
- text_zoom_level_ + 1),
+ zoom_level_ + 1),
kMaxTextSizeMultiplier);
float zoom_factor = static_cast<float>(multiplier);
if (zoom_factor != frame->zoomFactor()) {
- ++text_zoom_level_;
- frame->setZoomFactor(zoom_factor, false);
+ ++zoom_level_;
+ frame->setZoomFactor(zoom_factor, text_only);
}
}
-void WebViewImpl::MakeTextSmaller() {
+void WebViewImpl::ZoomOut(bool text_only) {
Frame* frame = main_frame()->frame();
double multiplier = std::max(std::pow(kTextSizeMultiplierRatio,
- text_zoom_level_ - 1),
+ zoom_level_ - 1),
kMinTextSizeMultiplier);
float zoom_factor = static_cast<float>(multiplier);
if (zoom_factor != frame->zoomFactor()) {
- --text_zoom_level_;
- frame->setZoomFactor(zoom_factor, false);
+ --zoom_level_;
+ frame->setZoomFactor(zoom_factor, text_only);
}
}
-void WebViewImpl::MakeTextStandardSize() {
- text_zoom_level_ = 0;
- main_frame()->frame()->setZoomFactor(1.0f, false);
+void WebViewImpl::ResetZoom() {
+ // We don't change the zoom mode (text only vs. full page) here. We just want
+ // to reset whatever is already set.
+ zoom_level_ = 0;
+ main_frame()->frame()->setZoomFactor(
+ 1.0f,
+ main_frame()->frame()->isZoomFactorTextOnly());
}
void WebViewImpl::CopyImageAt(int x, int y) {
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | webkit/tools/test_shell/event_sending_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698