diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 22:55:17 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 22:55:17 +0000 |
commit | 630e26b1eb3461ee97211856b6ceb2821e99d655 (patch) | |
tree | bde01602f2d82c833642a854a9670f7f25ebd702 /chrome/browser | |
parent | c82e56ca13fefb0a50662ef1cee872c06cd2b5e3 (diff) | |
download | chromium_src-630e26b1eb3461ee97211856b6ceb2821e99d655.zip chromium_src-630e26b1eb3461ee97211856b6ceb2821e99d655.tar.gz chromium_src-630e26b1eb3461ee97211856b6ceb2821e99d655.tar.bz2 |
Rename various text zoom related stuff to be more generic, since we now can
optionally zoom the page. I added an easy way in render_view to toggle between
text zoom and full page zoom, and allowed the embedder to specify this in the
glue layer. This allows me to fix the text zoom layout test, which specifically
asks that the text be zoomed.
Review URL: http://codereview.chromium.org/7320
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_commands.cc | 12 | ||||
-rw-r--r-- | chrome/browser/render_view_host.cc | 4 | ||||
-rw-r--r-- | chrome/browser/render_view_host.h | 9 | ||||
-rw-r--r-- | chrome/browser/tab_contents.h | 1 |
4 files changed, 11 insertions, 15 deletions
diff --git a/chrome/browser/browser_commands.cc b/chrome/browser/browser_commands.cc index 12d70ce..cca8754 100644 --- a/chrome/browser/browser_commands.cc +++ b/chrome/browser/browser_commands.cc @@ -512,8 +512,8 @@ void Browser::ExecuteCommand(int id) { UserMetrics::RecordAction(L"ZoomPlus", profile_); TabContents* current_tab = GetSelectedTabContents(); if (current_tab->AsWebContents()) { - current_tab->AsWebContents()->render_view_host()->AlterTextSize( - text_zoom::TEXT_LARGER); + current_tab->AsWebContents()->render_view_host()->Zoom( + PageZoom::LARGER); } break; } @@ -522,8 +522,8 @@ void Browser::ExecuteCommand(int id) { UserMetrics::RecordAction(L"ZoomMinus", profile_); TabContents* current_tab = GetSelectedTabContents(); if (current_tab->AsWebContents()) { - current_tab->AsWebContents()->render_view_host()->AlterTextSize( - text_zoom::TEXT_SMALLER); + current_tab->AsWebContents()->render_view_host()->Zoom( + PageZoom::SMALLER); } break; } @@ -532,8 +532,8 @@ void Browser::ExecuteCommand(int id) { UserMetrics::RecordAction(L"ZoomNormal", profile_); TabContents* current_tab = GetSelectedTabContents(); if (current_tab->AsWebContents()) { - current_tab->AsWebContents()->render_view_host()->AlterTextSize( - text_zoom::TEXT_STANDARD); + current_tab->AsWebContents()->render_view_host()->Zoom( + PageZoom::STANDARD); } break; } diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc index d269017..990e4c0 100644 --- a/chrome/browser/render_view_host.cc +++ b/chrome/browser/render_view_host.cc @@ -326,8 +326,8 @@ void RenderViewHost::StopFinding(bool clear_selection) { Send(new ViewMsg_StopFinding(routing_id_, clear_selection)); } -void RenderViewHost::AlterTextSize(text_zoom::TextSize size) { - Send(new ViewMsg_AlterTextSize(routing_id_, size)); +void RenderViewHost::Zoom(PageZoom::Function function) { + Send(new ViewMsg_Zoom(routing_id_, function)); } void RenderViewHost::SetPageEncoding(const std::wstring& encoding_name) { diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h index 13b40ac..c0ebefe 100644 --- a/chrome/browser/render_view_host.h +++ b/chrome/browser/render_view_host.h @@ -11,6 +11,7 @@ #include "base/scoped_handle.h" #include "chrome/browser/render_view_host_delegate.h" #include "chrome/browser/render_widget_host.h" +#include "chrome/common/page_zoom.h" #ifdef CHROME_PERSONALIZATION #include "chrome/personalization/personalization.h" #endif @@ -39,10 +40,6 @@ namespace net { enum LoadState; } -namespace text_zoom { -enum TextSize; -} - namespace webkit_glue { struct WebApplicationInfo; } @@ -188,8 +185,8 @@ class RenderViewHost : public RenderWidgetHost { // clear the selection on the focused frame. void StopFinding(bool clear_selection); - // Change the text size of the page. - void AlterTextSize(text_zoom::TextSize size); + // Change the zoom level of a page. + void Zoom(PageZoom::Function function); // Change the encoding of the page. void SetPageEncoding(const std::wstring& encoding_name); diff --git a/chrome/browser/tab_contents.h b/chrome/browser/tab_contents.h index 583358f..fc6fa04 100644 --- a/chrome/browser/tab_contents.h +++ b/chrome/browser/tab_contents.h @@ -14,7 +14,6 @@ #include "chrome/browser/page_navigator.h" #include "chrome/browser/tab_contents_type.h" #include "chrome/common/navigation_types.h" -#include "chrome/common/text_zoom.h" namespace gfx { class Rect; |