summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-28 22:02:48 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-28 22:02:48 +0000
commit54087fe8d2a28e337a2147d13130586331e918d0 (patch)
tree1192be7b52d8a1d889eefd3a203d8625547f6367
parentca2e7208d1f662943849fbefecb88e38008881b8 (diff)
downloadchromium_src-54087fe8d2a28e337a2147d13130586331e918d0.zip
chromium_src-54087fe8d2a28e337a2147d13130586331e918d0.tar.gz
chromium_src-54087fe8d2a28e337a2147d13130586331e918d0.tar.bz2
Move PageZoom enum into content/public/common and into the content namespace. Also move content_costants to content/public/common.
BUG=98716 Review URL: http://codereview.chromium.org/8413051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107804 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/automation_provider_win.cc4
-rw-r--r--chrome/browser/external_tab_container_win.cc8
-rw-r--r--chrome/browser/tab_contents/web_contents_unittest.cc2
-rw-r--r--chrome/browser/ui/browser.cc13
-rw-r--r--chrome/browser/ui/browser.h4
-rw-r--r--chrome/browser/ui/toolbar/toolbar_model.cc2
-rw-r--r--chrome/default_plugin/plugin_impl_aura.cc2
-rw-r--r--chrome/default_plugin/plugin_impl_gtk.cc2
-rw-r--r--chrome/default_plugin/plugin_installer_base.cc2
-rw-r--r--chrome_frame/cfproxy.h4
-rw-r--r--chrome_frame/cfproxy_private.h2
-rw-r--r--chrome_frame/cfproxy_support.cc2
-rw-r--r--chrome_frame/chrome_active_document.cc6
-rw-r--r--chrome_frame/chrome_frame_automation.cc2
-rw-r--r--chrome_frame/chrome_frame_automation.h4
-rw-r--r--chrome_frame/external_tab.cc2
-rw-r--r--chrome_frame/external_tab.h4
-rw-r--r--chrome_frame/external_tab_test.cc2
-rw-r--r--content/app/content_main.cc2
-rw-r--r--content/browser/renderer_host/render_process_host.cc2
-rw-r--r--content/browser/renderer_host/render_view_host.cc8
-rw-r--r--content/browser/renderer_host/render_view_host.h2
-rw-r--r--content/browser/renderer_host/render_widget_host.h2
-rw-r--r--content/browser/site_instance_unittest.cc2
-rw-r--r--content/browser/tab_contents/navigation_controller.cc2
-rw-r--r--content/browser/tab_contents/navigation_entry.cc2
-rw-r--r--content/browser/tab_contents/tab_contents.cc4
-rw-r--r--content/common/page_zoom.h25
-rw-r--r--content/common/view_messages.h6
-rw-r--r--content/content_common.gypi6
-rw-r--r--content/plugin/webplugin_delegate_stub.cc2
-rw-r--r--content/public/common/common_param_traits.cc2
-rw-r--r--content/public/common/content_constants.cc (renamed from content/common/content_constants.cc)2
-rw-r--r--content/public/common/content_constants.h (renamed from content/common/content_constants.h)6
-rw-r--r--content/public/common/page_zoom.h23
-rw-r--r--content/public/common/webkit_param_traits.cc2
-rw-r--r--content/renderer/render_view_impl.cc18
-rw-r--r--content/renderer/render_view_impl.h4
38 files changed, 93 insertions, 96 deletions
diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc
index fe905ea..a60e8c3 100644
--- a/chrome/browser/automation/automation_provider_win.cc
+++ b/chrome/browser/automation/automation_provider_win.cc
@@ -24,8 +24,8 @@
#include "chrome/common/render_messages.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/page_zoom.h"
#include "content/common/view_messages.h"
+#include "content/public/common/page_zoom.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "views/focus/accelerator_handler.h"
#include "views/widget/root_view.h"
@@ -467,7 +467,7 @@ void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) {
NavigationController* tab = tab_tracker_->GetResource(handle);
if (tab->tab_contents() && tab->tab_contents()->render_view_host()) {
RenderViewHost* host = tab->tab_contents()->render_view_host();
- PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level);
+ content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level);
host->Zoom(zoom);
}
}
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index c2e1bf6..ca579eb 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -44,11 +44,11 @@
#include "content/browser/tab_contents/navigation_details.h"
#include "content/browser/tab_contents/provisional_load_details.h"
#include "content/public/browser/notification_service.h"
-#include "content/common/page_zoom.h"
#include "content/common/view_messages.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/page_transition_types.h"
+#include "content/public/common/page_zoom.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -1047,13 +1047,13 @@ bool ExternalTabContainer::AcceleratorPressed(
int command_id = iter->second;
switch (command_id) {
case IDC_ZOOM_PLUS:
- host->Zoom(PageZoom::ZOOM_IN);
+ host->Zoom(content::PAGE_ZOOM_IN);
break;
case IDC_ZOOM_NORMAL:
- host->Zoom(PageZoom::RESET);
+ host->Zoom(content::PAGE_ZOOM_RESET);
break;
case IDC_ZOOM_MINUS:
- host->Zoom(PageZoom::ZOOM_OUT);
+ host->Zoom(content::PAGE_ZOOM_OUT);
break;
case IDC_DEV_TOOLS:
DevToolsWindow::ToggleDevToolsWindow(
diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc
index ce771b6..accc5f9 100644
--- a/chrome/browser/tab_contents/web_contents_unittest.cc
+++ b/chrome/browser/tab_contents/web_contents_unittest.cc
@@ -20,12 +20,12 @@
#include "content/browser/tab_contents/navigation_details.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/test_tab_contents.h"
-#include "content/common/content_constants.h"
#include "content/common/view_messages.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_source.h"
#include "content/public/common/bindings_policy.h"
+#include "content/public/common/content_constants.h"
#include "content/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/message_box_flags.h"
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 8846965..199caa4 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -151,7 +151,6 @@
#include "content/browser/user_metrics.h"
#include "content/common/content_restriction.h"
#include "content/public/browser/notification_service.h"
-#include "content/common/page_zoom.h"
#include "content/public/browser/notification_details.h"
#include "content/public/common/content_switches.h"
#include "grit/chromium_strings.h"
@@ -1971,7 +1970,7 @@ void Browser::FindPrevious() {
FindInPage(true, false);
}
-void Browser::Zoom(PageZoom::Function zoom_function) {
+void Browser::Zoom(content::PageZoom zoom) {
if (is_devtools())
return;
@@ -1981,10 +1980,10 @@ void Browser::Zoom(PageZoom::Function zoom_function) {
UserMetricsAction("ZoomPlus")
};
- UserMetrics::RecordAction(kActions[zoom_function - PageZoom::ZOOM_OUT]);
+ UserMetrics::RecordAction(kActions[zoom - content::PAGE_ZOOM_OUT]);
TabContentsWrapper* tab_contents = GetSelectedTabContentsWrapper();
RenderViewHost* host = tab_contents->render_view_host();
- host->Zoom(zoom_function);
+ host->Zoom(zoom);
}
void Browser::FocusToolbar() {
@@ -2792,9 +2791,9 @@ void Browser::ExecuteCommandWithDisposition(
case IDC_FIND_PREVIOUS: FindPrevious(); break;
// Zoom
- case IDC_ZOOM_PLUS: Zoom(PageZoom::ZOOM_IN); break;
- case IDC_ZOOM_NORMAL: Zoom(PageZoom::RESET); break;
- case IDC_ZOOM_MINUS: Zoom(PageZoom::ZOOM_OUT); break;
+ case IDC_ZOOM_PLUS: Zoom(content::PAGE_ZOOM_IN); break;
+ case IDC_ZOOM_NORMAL: Zoom(content::PAGE_ZOOM_RESET); break;
+ case IDC_ZOOM_MINUS: Zoom(content::PAGE_ZOOM_OUT); break;
// Focus various bits of UI
case IDC_FOCUS_TOOLBAR: FocusToolbar(); break;
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 9c5a0623..b044d9b 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -44,9 +44,9 @@
#include "chrome/common/extensions/extension_constants.h"
#include "content/browser/tab_contents/page_navigator.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
-#include "content/common/page_zoom.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/common/page_transition_types.h"
+#include "content/public/common/page_zoom.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/rect.h"
@@ -575,7 +575,7 @@ class Browser : public TabHandlerDelegate,
void FindPrevious();
// Zoom
- void Zoom(PageZoom::Function zoom_function);
+ void Zoom(content::PageZoom zoom);
// Focus various bits of UI
void FocusToolbar();
diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc
index d5583dd..588af39 100644
--- a/chrome/browser/ui/toolbar/toolbar_model.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model.cc
@@ -19,7 +19,7 @@
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/webui/web_ui.h"
-#include "content/common/content_constants.h"
+#include "content/public/common/content_constants.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "net/base/cert_status_flags.h"
diff --git a/chrome/default_plugin/plugin_impl_aura.cc b/chrome/default_plugin/plugin_impl_aura.cc
index aabb3c7..cdf8ffb 100644
--- a/chrome/default_plugin/plugin_impl_aura.cc
+++ b/chrome/default_plugin/plugin_impl_aura.cc
@@ -10,7 +10,7 @@
#include "chrome/common/chrome_plugin_messages.h"
#include "chrome/default_plugin/plugin_main.h"
#include "content/common/child_thread.h"
-#include "content/common/content_constants.h"
+#include "content/public/common/content_constants.h"
#include "googleurl/src/gurl.h"
#include "grit/webkit_strings.h"
#include "unicode/locid.h"
diff --git a/chrome/default_plugin/plugin_impl_gtk.cc b/chrome/default_plugin/plugin_impl_gtk.cc
index 378e80d..e39a001 100644
--- a/chrome/default_plugin/plugin_impl_gtk.cc
+++ b/chrome/default_plugin/plugin_impl_gtk.cc
@@ -13,7 +13,7 @@
#include "chrome/common/chrome_plugin_messages.h"
#include "chrome/default_plugin/plugin_main.h"
#include "content/common/child_thread.h"
-#include "content/common/content_constants.h"
+#include "content/public/common/content_constants.h"
#include "googleurl/src/gurl.h"
#include "grit/webkit_strings.h"
#include "unicode/locid.h"
diff --git a/chrome/default_plugin/plugin_installer_base.cc b/chrome/default_plugin/plugin_installer_base.cc
index e863564..9488b4d 100644
--- a/chrome/default_plugin/plugin_installer_base.cc
+++ b/chrome/default_plugin/plugin_installer_base.cc
@@ -6,7 +6,7 @@
#include "base/string_number_conversions.h"
#include "base/string_util.h"
-#include "content/common/content_constants.h"
+#include "content/public/common/content_constants.h"
PluginInstallerBase::PluginInstallerBase()
: renderer_process_id_(0),
diff --git a/chrome_frame/cfproxy.h b/chrome_frame/cfproxy.h
index 6bc8abd..e5169dc 100644
--- a/chrome_frame/cfproxy.h
+++ b/chrome_frame/cfproxy.h
@@ -14,7 +14,7 @@
#include "base/time.h" // for base::TimeDelta
#include "base/file_path.h"
#include "chrome/common/automation_constants.h"
-#include "content/common/page_zoom.h"
+#include "content/public/common/page_zoom.h"
#include "ipc/ipc_channel.h"
class ChromeProxyDelegate;
@@ -93,7 +93,7 @@ class ChromeProxy {
virtual void Tab_MenuCommand(int tab, int selected_command) = 0;
// UI
- virtual void Tab_Zoom(int tab, PageZoom::Function zoom_level) = 0;
+ virtual void Tab_Zoom(int tab, content::PageZoom zoom_level) = 0;
virtual void Tab_FontSize(int tab, enum AutomationPageFontSize font_size) = 0;
virtual void Tab_SetInitialFocus(int tab,
bool reverse, bool restore_focus_to_view) = 0;
diff --git a/chrome_frame/cfproxy_private.h b/chrome_frame/cfproxy_private.h
index 61778e1d..de52039 100644
--- a/chrome_frame/cfproxy_private.h
+++ b/chrome_frame/cfproxy_private.h
@@ -80,7 +80,7 @@ class Interface2IPCMessage : public ChromeProxy {
virtual void Tab_Paste(int tab);
virtual void Tab_SelectAll(int tab);
virtual void Tab_MenuCommand(int tab, int selected_command);
- virtual void Tab_Zoom(int tab, PageZoom::Function zoom_level);
+ virtual void Tab_Zoom(int tab, content::PageZoom zoom_level);
virtual void Tab_FontSize(int tab, enum AutomationPageFontSize font_size);
virtual void Tab_SetInitialFocus(int tab, bool reverse,
bool restore_focus_to_view);
diff --git a/chrome_frame/cfproxy_support.cc b/chrome_frame/cfproxy_support.cc
index 777c854..903397d 100644
--- a/chrome_frame/cfproxy_support.cc
+++ b/chrome_frame/cfproxy_support.cc
@@ -116,7 +116,7 @@ void Interface2IPCMessage::Tab_MenuCommand(int tab, int selected_command) {
tab, selected_command));
}
-void Interface2IPCMessage::Tab_Zoom(int tab, PageZoom::Function zoom_level) {
+void Interface2IPCMessage::Tab_Zoom(int tab, content::PageZoom zoom_level) {
sender_->Send(new AutomationMsg_SetZoomLevel(tab, zoom_level));
}
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index cf903e9..1ee9070 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -35,7 +35,7 @@
#include "chrome_frame/crash_reporting/crash_metrics.h"
#include "chrome_frame/utils.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/page_zoom.h"
+#include "content/public/common/page_zoom.h"
#include "grit/generated_resources.h"
DEFINE_GUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0,
@@ -896,9 +896,9 @@ void ChromeActiveDocument::OnSetZoomRange(const GUID* cmd_group_guid,
if (in_args && V_VT(in_args) == VT_I4 && IsValid()) {
if (in_args->lVal == kZoomIn) {
- automation_client_->SetZoomLevel(PageZoom::ZOOM_IN);
+ automation_client_->SetZoomLevel(content::PAGE_ZOOM_IN);
} else if (in_args->lVal == kZoomOut) {
- automation_client_->SetZoomLevel(PageZoom::ZOOM_OUT);
+ automation_client_->SetZoomLevel(content::PAGE_ZOOM_OUT);
} else {
DLOG(WARNING) << "Unsupported zoom level:" << in_args->lVal;
}
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 61f6ce1..4f6c57c 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -1210,7 +1210,7 @@ void ChromeFrameAutomationClient::SetUrlFetcher(
url_fetcher_->set_delegate(this);
}
-void ChromeFrameAutomationClient::SetZoomLevel(PageZoom::Function zoom_level) {
+void ChromeFrameAutomationClient::SetZoomLevel(content::PageZoom zoom_level) {
if (automation_server_) {
automation_server_->Send(new AutomationMsg_SetZoomLevel(tab_handle_,
zoom_level));
diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h
index 5209c35..83a3e0b 100644
--- a/chrome_frame/chrome_frame_automation.h
+++ b/chrome_frame/chrome_frame_automation.h
@@ -23,7 +23,7 @@
#include "chrome_frame/chrome_frame_delegate.h"
#include "chrome_frame/plugin_url_request.h"
#include "chrome_frame/sync_msg_reply_dispatcher.h"
-#include "content/common/page_zoom.h"
+#include "content/public/common/page_zoom.h"
// By a convoluated route, this timeout also winds up being the sync automation
// message timeout. See the ChromeFrameAutomationProxyImpl ctor and the
@@ -399,7 +399,7 @@ class ChromeFrameAutomationClient
void RemoveBrowsingData(int remove_mask);
// Sets the current zoom level on the tab.
- void SetZoomLevel(PageZoom::Function zoom_level);
+ void SetZoomLevel(content::PageZoom zoom_level);
// Fires before unload and unload handlers on the page if any. Allows the
// the website to put up a confirmation dialog on unload.
diff --git a/chrome_frame/external_tab.cc b/chrome_frame/external_tab.cc
index 38e74aa..0e5b044 100644
--- a/chrome_frame/external_tab.cc
+++ b/chrome_frame/external_tab.cc
@@ -191,7 +191,7 @@ void ExternalTabProxy::BlockExternalTab(uint64 cookie) {
proxy_->BlockTab(cookie);
}
-void ExternalTabProxy::SetZoomLevel(PageZoom::Function zoom_level) {
+void ExternalTabProxy::SetZoomLevel(content::PageZoom zoom_level) {
proxy_->Tab_Zoom(tab_, zoom_level);
}
diff --git a/chrome_frame/external_tab.h b/chrome_frame/external_tab.h
index 26abf8f..2ac46a5 100644
--- a/chrome_frame/external_tab.h
+++ b/chrome_frame/external_tab.h
@@ -19,7 +19,7 @@
#include "chrome/common/automation_constants.h"
#include "chrome_frame/cfproxy.h"
#include "chrome_frame/task_marshaller.h"
-#include "content/common/page_zoom.h"
+#include "content/public/common/page_zoom.h"
#include "googleurl/src/gurl.h"
class Task;
@@ -116,7 +116,7 @@ class ExternalTabProxy : public CWindowImpl<ExternalTabProxy>,
virtual void ConnectToExternalTab(uint64 external_tab_cookie);
virtual void BlockExternalTab(uint64 cookie);
- void SetZoomLevel(PageZoom::Function zoom_level);
+ void SetZoomLevel(content::PageZoom zoom_level);
private:
BEGIN_MSG_MAP(ExternalTabProxy)
diff --git a/chrome_frame/external_tab_test.cc b/chrome_frame/external_tab_test.cc
index 9a30508..0069522 100644
--- a/chrome_frame/external_tab_test.cc
+++ b/chrome_frame/external_tab_test.cc
@@ -73,7 +73,7 @@ struct MockProxy : public ChromeProxy {
FindInPageDirection forward, FindInPageCase match_case, bool find_next));
MOCK_METHOD2(Tab_MenuCommand, void(int tab, int selected_command));
- MOCK_METHOD2(Tab_Zoom, void(int tab, PageZoom::Function zoom_level));
+ MOCK_METHOD2(Tab_Zoom, void(int tab, content::PageZoom zoom_level));
MOCK_METHOD2(Tab_FontSize, void(int tab, AutomationPageFontSize font_size));
MOCK_METHOD3(Tab_SetInitialFocus, void(int tab, bool reverse,
bool restore_focus_to_view));
diff --git a/content/app/content_main.cc b/content/app/content_main.cc
index 21f3f55..2494dc4 100644
--- a/content/app/content_main.cc
+++ b/content/app/content_main.cc
@@ -17,12 +17,12 @@
#include "base/string_number_conversions.h"
#include "content/app/startup_helper_win.h"
#include "content/browser/browser_main.h"
-#include "content/common/content_constants.h"
#include "content/common/main_function_params.h"
#include "content/common/sandbox_init_wrapper.h"
#include "content/common/set_process_title.h"
#include "content/public/app/content_main_delegate.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "crypto/nss_util.h"
diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc
index 251f3bb..50fac3f 100644
--- a/content/browser/renderer_host/render_process_host.cc
+++ b/content/browser/renderer_host/render_process_host.cc
@@ -11,11 +11,11 @@
#include "content/browser/child_process_security_policy.h"
#include "content/browser/webui/web_ui_factory.h"
#include "content/common/child_process_info.h"
-#include "content/common/content_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
namespace {
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index e150822..950bc56 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -30,18 +30,18 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/site_instance.h"
#include "content/browser/user_metrics.h"
-#include "content/common/content_constants.h"
#include "content/common/desktop_notification_messages.h"
#include "content/common/drag_messages.h"
-#include "content/public/browser/notification_service.h"
#include "content/common/speech_input_messages.h"
#include "content/common/swapped_out_messages.h"
#include "content/common/view_messages.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/common/bindings_policy.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/url_constants.h"
#include "net/base/net_util.h"
@@ -1308,8 +1308,8 @@ void RenderViewHost::SetZoomLevel(double level) {
Send(new ViewMsg_SetZoomLevel(routing_id(), level));
}
-void RenderViewHost::Zoom(PageZoom::Function zoom_function) {
- Send(new ViewMsg_Zoom(routing_id(), zoom_function));
+void RenderViewHost::Zoom(content::PageZoom zoom) {
+ Send(new ViewMsg_Zoom(routing_id(), zoom));
}
void RenderViewHost::ReloadFrame() {
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h
index a295822b..cb72b6c 100644
--- a/content/browser/renderer_host/render_view_host.h
+++ b/content/browser/renderer_host/render_view_host.h
@@ -422,7 +422,7 @@ class CONTENT_EXPORT RenderViewHost : public RenderWidgetHost {
void SetZoomLevel(double level);
// Changes the zoom level for the current main frame.
- void Zoom(PageZoom::Function zoom_function);
+ void Zoom(content::PageZoom zoom);
// Reloads the current focused frame.
void ReloadFrame();
diff --git a/content/browser/renderer_host/render_widget_host.h b/content/browser/renderer_host/render_widget_host.h
index 9c82042..e980600 100644
--- a/content/browser/renderer_host/render_widget_host.h
+++ b/content/browser/renderer_host/render_widget_host.h
@@ -16,9 +16,9 @@
#include "base/string16.h"
#include "base/timer.h"
#include "content/common/content_export.h"
-#include "content/common/page_zoom.h"
#include "content/common/property_bag.h"
#include "content/public/browser/native_web_keyboard_event.h"
+#include "content/public/common/page_zoom.h"
#include "ipc/ipc_channel.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
diff --git a/content/browser/site_instance_unittest.cc b/content/browser/site_instance_unittest.cc
index d19ef68..0185daf 100644
--- a/content/browser/site_instance_unittest.cc
+++ b/content/browser/site_instance_unittest.cc
@@ -15,8 +15,8 @@
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/webui/empty_web_ui_factory.h"
-#include "content/common/content_constants.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/url_constants.h"
#include "content/test/test_browser_context.h"
#include "content/test/test_browser_thread.h"
diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc
index c2d5185..65e90ee 100644
--- a/content/browser/tab_contents/navigation_controller.cc
+++ b/content/browser/tab_contents/navigation_controller.cc
@@ -20,8 +20,8 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
#include "content/browser/user_metrics.h"
-#include "content/common/content_constants.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/common/content_constants.h"
#include "content/common/view_messages.h"
#include "content/public/browser/notification_types.h"
#include "net/base/escape.h"
diff --git a/content/browser/tab_contents/navigation_entry.cc b/content/browser/tab_contents/navigation_entry.cc
index 3e60a53b..b84050a 100644
--- a/content/browser/tab_contents/navigation_entry.cc
+++ b/content/browser/tab_contents/navigation_entry.cc
@@ -7,8 +7,8 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "content/browser/site_instance.h"
-#include "content/common/content_constants.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/url_constants.h"
#include "net/base/net_util.h"
#include "ui/base/text/text_elider.h"
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index fd84d52..0067d09 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -38,14 +38,14 @@
#include "content/browser/tab_contents/title_updated_details.h"
#include "content/browser/user_metrics.h"
#include "content/browser/webui/web_ui_factory.h"
-#include "content/common/content_constants.h"
#include "content/common/content_restriction.h"
#include "content/common/intents_messages.h"
-#include "content/public/browser/notification_service.h"
#include "content/common/view_messages.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/navigation_types.h"
+#include "content/public/browser/notification_service.h"
#include "content/public/common/bindings_policy.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/view_types.h"
#include "net/base/net_util.h"
diff --git a/content/common/page_zoom.h b/content/common/page_zoom.h
deleted file mode 100644
index d4606c0..0000000
--- a/content/common/page_zoom.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_COMMON_PAGE_ZOOM_H_
-#define CONTENT_COMMON_PAGE_ZOOM_H_
-#pragma once
-
-#include "base/basictypes.h"
-
-class PageZoom {
- public:
- // This enum is the parameter to various text/page zoom commands so we know
- // what the specific zoom command is.
- enum Function {
- ZOOM_OUT = -1,
- RESET = 0,
- ZOOM_IN = 1,
- };
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(PageZoom);
-};
-
-#endif // CONTENT_COMMON_PAGE_ZOOM_H_
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 847f19d6f..8369ea7 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -11,10 +11,10 @@
#include "content/common/css_colors.h"
#include "content/common/edit_command.h"
#include "content/common/navigation_gesture.h"
-#include "content/common/page_zoom.h"
#include "content/common/renderer_preferences.h"
#include "content/common/view_message_enums.h"
#include "content/public/common/common_param_traits.h"
+#include "content/public/common/page_zoom.h"
#include "content/public/common/webkit_param_traits.h"
#include "content/public/common/window_container_type.h"
#include "ipc/ipc_channel_handle.h"
@@ -51,7 +51,7 @@
IPC_ENUM_TRAITS(CSSColors::CSSColorName)
IPC_ENUM_TRAITS(NavigationGesture)
-IPC_ENUM_TRAITS(PageZoom::Function)
+IPC_ENUM_TRAITS(content::PageZoom)
IPC_ENUM_TRAITS(RendererPreferencesHintingEnum)
IPC_ENUM_TRAITS(RendererPreferencesSubpixelRenderingEnum)
IPC_ENUM_TRAITS(ViewHostMsg_AccEvent::Value)
@@ -912,7 +912,7 @@ IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
// changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
// telling it what url got zoomed and what its current zoom level is.
IPC_MESSAGE_ROUTED1(ViewMsg_Zoom,
- PageZoom::Function /* function */)
+ content::PageZoom /* function */)
// Set the zoom level for the current main frame. If the level actually
// changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
diff --git a/content/content_common.gypi b/content/content_common.gypi
index c8069bbb..832f636 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -30,6 +30,8 @@
'sources': [
'public/common/bindings_policy.h',
'public/common/child_process_sandbox_support_linux.h',
+ 'public/common/content_constants.cc',
+ 'public/common/content_constants.h',
'public/common/content_paths.h',
'public/common/content_switches.cc',
'public/common/content_switches.h',
@@ -40,6 +42,7 @@
'public/common/page_transition_types.cc',
'public/common/page_transition_types.h',
'public/common/page_type.h',
+ 'public/common/page_zoom.h',
'public/common/pepper_plugin_info.cc',
'public/common/pepper_plugin_info.h',
'public/common/resource_dispatcher_delegate.h',
@@ -79,8 +82,6 @@
'common/content_message_generator.cc',
'common/content_message_generator.h',
'common/content_export.h',
- 'common/content_constants.cc',
- 'common/content_constants.h',
'common/content_counters.cc',
'common/content_counters.h',
'common/content_paths.cc',
@@ -178,7 +179,6 @@
'common/npobject_util.h',
'common/p2p_messages.h',
'common/p2p_sockets.h',
- 'common/page_zoom.h',
'common/pepper_file_messages.cc',
'common/pepper_file_messages.h',
'common/pepper_messages.h',
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index 1f98e50..cf6d263 100644
--- a/content/plugin/webplugin_delegate_stub.cc
+++ b/content/plugin/webplugin_delegate_stub.cc
@@ -8,13 +8,13 @@
#include "base/command_line.h"
#include "base/string_number_conversions.h"
-#include "content/common/content_constants.h"
#include "content/common/npobject_stub.h"
#include "content/common/plugin_messages.h"
#include "content/plugin/plugin_channel.h"
#include "content/plugin/plugin_thread.h"
#include "content/plugin/webplugin_proxy.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npruntime.h"
diff --git a/content/public/common/common_param_traits.cc b/content/public/common/common_param_traits.cc
index 9d048e9..95b0d94 100644
--- a/content/public/common/common_param_traits.cc
+++ b/content/public/common/common_param_traits.cc
@@ -4,7 +4,7 @@
#include "content/public/common/common_param_traits.h"
-#include "content/common/content_constants.h"
+#include "content/public/common/content_constants.h"
#include "net/base/host_port_pair.h"
#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
diff --git a/content/common/content_constants.cc b/content/public/common/content_constants.cc
index da22264..949744a 100644
--- a/content/common/content_constants.cc
+++ b/content/public/common/content_constants.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/content_constants.h"
+#include "content/public/common/content_constants.h"
namespace content {
diff --git a/content/common/content_constants.h b/content/public/common/content_constants.h
index 6c8b66d..59ec3f4 100644
--- a/content/common/content_constants.h
+++ b/content/public/common/content_constants.h
@@ -4,8 +4,8 @@
// A handful of resource-like constants related to the Content application.
-#ifndef CONTENT_COMMON_CHROME_CONSTANTS_H_
-#define CONTENT_COMMON_CHROME_CONSTANTS_H_
+#ifndef CONTENT_PUBLIC_COMMON_CHROME_CONSTANTS_H_
+#define CONTENT_PUBLIC_COMMON_CHROME_CONSTANTS_H_
#pragma once
#include <stddef.h> // For size_t
@@ -43,4 +43,4 @@ extern const int kStatsMaxCounters;
} // namespace content
-#endif // CONTENT_COMMON_CHROME_CONSTANTS_H_
+#endif // CONTENT_PUBLIC_COMMON_CHROME_CONSTANTS_H_
diff --git a/content/public/common/page_zoom.h b/content/public/common/page_zoom.h
new file mode 100644
index 0000000..956169f
--- /dev/null
+++ b/content/public/common/page_zoom.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
+#define CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
+#pragma once
+
+#include "base/basictypes.h"
+
+namespace content {
+
+// This enum is the parameter to various text/page zoom commands so we know
+// what the specific zoom command is.
+enum PageZoom {
+ PAGE_ZOOM_OUT = -1,
+ PAGE_ZOOM_RESET = 0,
+ PAGE_ZOOM_IN = 1,
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
diff --git a/content/public/common/webkit_param_traits.cc b/content/public/common/webkit_param_traits.cc
index 45807a0..0a75396 100644
--- a/content/public/common/webkit_param_traits.cc
+++ b/content/public/common/webkit_param_traits.cc
@@ -8,8 +8,8 @@
#include "content/public/common/webkit_param_traits.h"
#include "base/string_number_conversions.h"
-#include "content/common/content_constants.h"
#include "content/public/common/common_param_traits.h"
+#include "content/public/common/content_constants.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
#include "webkit/glue/password_form.h"
#include "webkit/glue/resource_loader_bridge.h"
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index e63843e..3c96456 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -26,7 +26,6 @@
#include "base/utf_string_conversions.h"
#include "content/common/appcache/appcache_dispatcher.h"
#include "content/common/clipboard_messages.h"
-#include "content/common/content_constants.h"
#include "content/common/database_messages.h"
#include "content/common/drag_messages.h"
#include "content/common/file_system/file_system_dispatcher.h"
@@ -40,6 +39,7 @@
#include "content/common/request_extra_data.h"
#include "content/common/view_messages.h"
#include "content/public/common/bindings_policy.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/content_renderer_client.h"
@@ -3524,7 +3524,7 @@ void RenderViewImpl::OnFindReplyAck() {
}
}
-void RenderViewImpl::OnZoom(PageZoom::Function function) {
+void RenderViewImpl::OnZoom(content::PageZoom zoom) {
if (!webview()) // Not sure if this can happen, but no harm in being safe.
return;
@@ -3532,19 +3532,19 @@ void RenderViewImpl::OnZoom(PageZoom::Function function) {
#if !defined(TOUCH_UI)
double old_zoom_level = webview()->zoomLevel();
double zoom_level;
- if (function == PageZoom::RESET) {
+ if (zoom == content::PAGE_ZOOM_RESET) {
zoom_level = 0;
} else if (static_cast<int>(old_zoom_level) == old_zoom_level) {
// Previous zoom level is a whole number, so just increment/decrement.
- zoom_level = old_zoom_level + function;
+ zoom_level = old_zoom_level + zoom;
} else {
// Either the user hit the zoom factor limit and thus the zoom level is now
// not a whole number, or a plugin changed it to a custom value. We want
// to go to the next whole number so that the user can always get back to
// 100% with the keyboard/menu.
- if ((old_zoom_level > 1 && function > 0) ||
- (old_zoom_level < 1 && function < 0)) {
- zoom_level = static_cast<int>(old_zoom_level + function);
+ if ((old_zoom_level > 1 && zoom > 0) ||
+ (old_zoom_level < 1 && zoom < 0)) {
+ zoom_level = static_cast<int>(old_zoom_level + zoom);
} else {
// We're going towards 100%, so first go to the next whole number.
zoom_level = static_cast<int>(old_zoom_level);
@@ -3554,11 +3554,11 @@ void RenderViewImpl::OnZoom(PageZoom::Function function) {
#else
double old_page_scale_factor = webview()->pageScaleFactor();
double page_scale_factor;
- if (function == PageZoom::RESET) {
+ if (zoom == content::PAGE_ZOOM_RESET) {
page_scale_factor = 1.0;
} else {
page_scale_factor = old_page_scale_factor +
- (function > 0 ? kScalingIncrement : -kScalingIncrement);
+ (zoom > 0 ? kScalingIncrement : -kScalingIncrement);
}
webview()->scalePage(page_scale_factor, WebPoint(0, 0));
#endif
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 121974e..8beea4e 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -26,8 +26,8 @@
#include "content/common/content_export.h"
#include "content/common/edit_command.h"
#include "content/common/navigation_gesture.h"
-#include "content/common/page_zoom.h"
#include "content/common/renderer_preferences.h"
+#include "content/public/common/page_zoom.h"
#include "content/public/renderer/render_view.h"
#include "content/renderer/pepper_plugin_delegate_impl.h"
#include "content/renderer/render_widget.h"
@@ -858,7 +858,7 @@ class RenderViewImpl : public RenderWidget,
const gfx::Rect& view_frame);
void OnSelectPopupMenuItem(int selected_index);
#endif
- void OnZoom(PageZoom::Function function);
+ void OnZoom(content::PageZoom zoom);
void OnEnableViewSourceMode();
void OnJavaBridgeInit(const IPC::ChannelHandle& channel_handle);