diff options
Diffstat (limited to 'content')
20 files changed, 60 insertions, 62 deletions
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); |